-
1. Re: Timer Task never fired
kukeltje Oct 23, 2007 6:53 AM (in response to olivier.ch)do you have a task in the tasknode? You should otherwise it will go straightly through.
-
2. Re: Timer Task never fired
olivier.ch Oct 23, 2007 7:56 AM (in response to olivier.ch)Yes there is a task. I have tried to set the timer on my task :
<task-node name="Prise En Charge"> <task name="Prendre en charge"> <timer name="timer-AlerteDeclenchee" duedate="2 seconds" repeat="true" > <action name="Renotification" class="ocd.common.workflow.process.action.NotificationTimerHandler"></action> </timer> <assignment class="ocd.common.workflow.process.action.AssignerUtilisateur"></assignment> <controller> <variable name="acteurID" access="read,write,required"></variable> <variable name="txtMessage" access="read,write,required"></variable> <variable name="listeDeDiffusion" access="read,write,required"></variable> </controller> </task> <event type="node-enter"> <action name="Notification (Alerte declenchee)" class="ocd.common.workflow.process.action.NotificationTimerHandler" config-type="bean"> </action> </event> <event type="node-leave"> <action name="Notification (Alerte prise en charge)" class="ocd.common.workflow.process.action.NotificationHandler"></action> </event> <transition name="Alerte prise en charge" to="Decision Crise"> </transition> </task-node>
Then I have the create timer on my logs :13:43:03,505 DEBUG GraphElement:247 - executing action 'CreateTimerAction(1a82e92)' 13:43:03,505 DEBUG Token:648 - token[5654] is locked by token[5654] 13:43:03,505 DEBUG GraphElement:170 - event 'timer-create' on 'Task(Prendre en charge)' for 'Token(/)'
but I do not have a delete timer (Perhaps because on my Junit Test, I do not have a task.end() I just use the context.signal () to jump on the other node )
In conclusion, I steel do not have any fired timer ...
My action timer is never use and I do not have any log of this event ...
Is there something else to set configuration on because I do not use JBoss. For the moment only Junit and Spring, and after Tomcat will be my Web Application Server... ?
Thanks for your help -
3. Re: Timer Task never fired
kukeltje Oct 23, 2007 8:43 AM (in response to olivier.ch)do you have a jobscheduler running?
-
4. Re: Timer Task never fired
olivier.ch Oct 23, 2007 9:41 AM (in response to olivier.ch)
I put my timer back on my task-node.
I have a DBScheduler defined in my jbpm.cfg.xml
I didn't have any jobscheduler, i just had this on my jbpm.cfg.xml :<bean name="jbpm.job.executor" class="org.jbpm.job.executor.JobExecutor"> <field name="jbpmConfiguration"> <ref bean="jbpmConfiguration" /> </field> <field name="name"> <string value="JbpmJobExector" /> </field> <field name="nbrOfThreads"> <int value="1" /> </field> <field name="idleInterval"> <int value="1000" /> </field> <field name="maxIdleInterval"> <int value="10000" /> </field> </bean>
But doesn't work ... It is a job, but do I have to start it programmaticaly ? How do I do this ... and when do I have to start it, at the beginging of my process instance ? -
5. JobExecutor exception
olivier.ch Oct 30, 2007 9:34 AM (in response to olivier.ch)Hello,
I am would like to use a timer with JBPM 3.2.1. and Spring framework
I found the way with a JobExecutor :
in JBPM.cfg.xml I put the JobExecutor configuration like this :<bean name="jbpm.job.executor" class="org.jbpm.job.executor.JobExecutor"> <field name="jbpmConfiguration"><ref bean="jbpmConfiguration" /></field> <field name="name"><string value="JbpmJobExecutor" /></field> <field name="nbrOfThreads"><int value="1" /></field> <field name="idleInterval"><int value="5000" /></field> <field name="maxIdleInterval"><int value="3600000" /></field> <!-- 1 hour --> <field name="historyMaxSize"><int value="20" /></field> <field name="maxLockTime"><int value="20000" /></field> <!-- 20 sec --> <field name="lockMonitorInterval"><int value="10000" /></field> <!-- 10 sec --> <field name="lockBufferTime"><int value="5000" /></field> <!-- 5 seconds --> </bean>
And I put my JobExecutorServlet on the web.xml :<servlet> <servlet-name>JobExecutorServlet</servlet-name> <servlet-class>org.jbpm.job.executor.JobExecutorServlet</servlet-class> <load-on-startup>1</load-on-startup> </servlet> <servlet-mapping> <servlet-name>JobExecutorServlet</servlet-name> <url-pattern>/jobs</url-pattern> </servlet-mapping>
When I start my web application with this new Servlet I get an error but I can't see the relationship between my JobExecutor and the error.
The Job seems to start correctly :14:30:43,689 DEBUG ObjectFactoryImpl:59 - adding object info 'jbpm.job.executor' 14:30:43,689 DEBUG ObjectFactoryImpl:59 - adding object info 'jbpmConfiguration' 14:30:43,705 DEBUG JobExecutor:41 - starting thread group 'JbpmJobExector'... 14:30:43,736 DEBUG JobExecutor:87 - starting new job executor thread 'JbpmJobExector:10.138.101.47:1'
When It try to close the JBPMContext It throws an exception about JBPM_NODE table ...14:31:34,691 DEBUG JbpmContext:133 - closing JbpmContext 14:31:34,691 DEBUG Services:221 - closing service 'persistence': org.jbpm.persistence.db.DbPersistenceService@19ee8a 14:31:36,878 ERROR JobExecutorThread:83 - exception in job executor thread. waiting 5000 milliseconds org.hibernate.MappingException: An association from the table JBPM_NODE refers to an unmapped class: org.jbpm.graph.action.Script at org.hibernate.cfg.Configuration.secondPassCompileForeignKeys(Configuration.java:1249) at org.hibernate.cfg.Configuration.secondPassCompile(Configuration.java:1167) at org.hibernate.cfg.Configuration.buildSessionFactory(Configuration.java:1283) at org.jbpm.persistence.db.DbPersistenceServiceFactory.getSessionFactory(DbPersistenceServiceFactory.java:91) at org.jbpm.persistence.db.DbPersistenceService.getSessionFactory(DbPersistenceService.java:107) at org.jbpm.persistence.db.DbPersistenceService.getSession(DbPersistenceService.java:111) at org.jbpm.persistence.db.DbPersistenceService.getJobSession(DbPersistenceService.java:401) at org.jbpm.JbpmContext.getJobSession(JbpmContext.java:563) at org.jbpm.job.executor.JobExecutorThread.acquireJobs(JobExecutorThread.java:110) at org.jbpm.job.executor.JobExecutorThread.run(JobExecutorThread.java:56)
Can somebody explain me why ? and how to correct this problem ? It seems to be a configuration problem but I don't know what to change ...
Thanks for your help -
6. Re: Timer Task never fired
kukeltje Oct 30, 2007 5:30 PM (in response to olivier.ch)uncomment the reference to the script hbm file in the hibernate config
-
7. Re: Timer Task never fired
olivier.ch Oct 31, 2007 4:20 AM (in response to olivier.ch)
It's already un-commented :<!-- following mapping file has a dependendy on --> <!-- 'bsh-{version}.jar'. --> <!-- uncomment this if you don't have bsh on your --> <!-- classpath. you won't be able to use the --> <!-- script element in process definition files --> <mapping resource="org/jbpm/graph/action/Script.hbm.xml"/>
Is it possible that my JobExecutor doesn't find my hibernate.cfg.xml file in spite of my process is correctly instanciated ?
Everything works find ... except this JobExecutor and my timer.
Can somebody explain me how the timer, the DbSchedulerServiceFactory and the JobExecutor work together because I don't understand the User Guide explication and I don't see the JobExecutor... (http://docs.jboss.com/jbpm/v3.2/userguide/html/scheduler.html#timers)?
[/url] -
8. Re: Timer Task never fired
olivier.ch Nov 7, 2007 4:14 AM (in response to olivier.ch)I am steel in a dead end...
I have my jbpm 3.2 , my jbpm.job.executor and my DbSchedulerServiceFactory defined on mya jbpm.cfg, my JobExecutorServlet defined on my web.xml and my timer on my task process but nothing seems to work ...
Does somebody have any idea ? -
9. Re: Timer Task never fired
olivier.ch Nov 9, 2007 8:48 AM (in response to olivier.ch)I found the solution....
I am using the spring_module for jbpm3.1. with jbpm3.2.1
The problem is in the LocalJbpmConfigurationFactoryBean of the module.
This class instanciate the jbpmConfiguration but the problem is that it uses only anew JbpmConfiguration(ObjectFactory)
to instanciate my configuration.
This methode doesn't put this instanciation on the jbpmConfiguration's ObjectFactory.
The JobExecutor use this ObjectFactory to get the JbpmConfiguration ... Then if you don't modify this module sources it won't work ....
I changed this : -
10. Re: Timer Task never fired
kukeltje Nov 9, 2007 2:04 PM (in response to olivier.ch)changed what? ;-)
-
11. Re: Timer Task never fired
olivier.ch Dec 18, 2007 9:26 AM (in response to olivier.ch)Used this code in the java class LocalJbpmConfigurationFactoryBean of the spring for jbpm module :
JbpmConfiguration.Configs.setDefaultObjectFactory(objectFactory); jbpmConfiguration = JbpmConfiguration.getInstance();