[JBoss jBPM] - Re: Problems with JBPM Ttimer EJB from a simple Web App
by Toriton
Ok seems i found what i was missing.. a couple of thing :P at last..
put this in my web.xml (i had to look as first at web.xml of console web-app :) )
| <listener>
| <description>
| Closes the jBPM configuration on servlet context destruction, releasing
| application resources. This listener should appear after the job executor
| launcher to avoid reopening the configuration.
| </description>
| <listener-class>org.jbpm.web.JbpmConfigurationCloser</listener-class>
| </listener>
|
| <resource-ref>
| <description>
| Logical name of the data source that provides connections to the persistence service.
| Must match the hibernate.connection.datasource property in the Hibernate
| configuration file.
| </description>
| <res-ref-name>jdbc/JbpmDataSource</res-ref-name>
| <res-type>javax.sql.DataSource</res-type>
| <res-auth>Container</res-auth>
| </resource-ref>
|
| <resource-ref>
| <description>
| Logical name of the factory that provides JMS connections to the message service.
| Required for processes that contain asynchronous continuations.
| </description>
| <res-ref-name>jms/JbpmConnectionFactory</res-ref-name>
| <res-type>javax.jms.ConnectionFactory</res-type>
| <res-auth>Container</res-auth>
| </resource-ref>
|
| <ejb-ref>
| <description>
| Link to the local entity bean that implements the scheduler service. Required for
| processes that contain timers.
| </description>
| <ejb-ref-name>ejb/TimerEntityBean</ejb-ref-name>
| <ejb-ref-type>Entity</ejb-ref-type>
| <home>org.jbpm.ejb.TimerEntityHome</home>
| <remote>org.jbpm.ejb.TimerEntity</remote>
| </ejb-ref>
|
| <message-destination-ref>
| <description>
| The message service sends job messages to the queue referenced here. To ensure
| this is the same queue from which the JobListenerBean receives messages, the
| message-destination-link element points to a common logical destination, JobQueue.
| </description>
| <message-destination-ref-name>jms/JobQueue</message-destination-ref-name>
| <message-destination-type>javax.jms.Queue</message-destination-type>
| <message-destination-usage>Produces</message-destination-usage>
| <message-destination-link>JobQueue</message-destination-link>
| </message-destination-ref>
|
and then the jboss-web.xml file.
Sorry for boring you ^_^..
T.
View the original post : http://www.jboss.org/index.html?module=bb&op=viewtopic&p=4221467#4221467
Reply to the post : http://www.jboss.org/index.html?module=bb&op=posting&mode=reply&p=4221467
15 years, 8 months
[JBoss jBPM] - Get Action from Timer. Earlies execution time
by jjrs
Hello,
In my process definition we have several nodes (containing actions), that have to have an "earliest start time" associated to them. The best way I found for implementing this functionality was creating a State node, create a timer inside it , and associate the action to the timer. Something like the example below:
<state name="LoadConvertedCont1" async="true">
| <timer duedate='#{executionStartTime + 1 Hour}' >
| <action class="com.xxxxx.jbpm.actions.Adaptor" async="true" name="loadConvertedContributions">
| <taskBeanId>
| loadConvertedContributions
| </taskBeanId>
| <maxDurationMinutes>
| 60
| </maxDurationMinutes>
| </action>
| </timer>
| <transition to="LoadConvertedCon2"></transition>
| </state>
Everything is fine, until I try to stop the execution of the action. I have my own implementation of the JobExecutorThread. I extended the API for being to interrupt the execution of an the action. If the action was inside a node of type node, the code for accessing it, is quite easy :
Action action = job.getToken().getNode().getAction();
But when the action is inside a timer and the timer is inside a Node of type State, I don't see an easy way of retrieving the action object, and the only possible way that I have found is using the HibernateProxy provided by Hibernate, although I don't consider this is the best option
Timer timer = (Timer)((HibernateProxy)job).getHibernateLazyInitializer().getImplementation();
| Action action = timer.getAction();
Is there any way, using the JBPM API for retrieving the action being executed from the JobExecutorThread ?
job.getToken().getNode().getName();
| //is providing me the correct name of the Node (even if it is if type State)
|
| runningJob.getToken().getNode().getAction();
| //is null when the action is inside the timer, and the timer inside the State Node.
Regards.
Jose.
View the original post : http://www.jboss.org/index.html?module=bb&op=viewtopic&p=4221371#4221371
Reply to the post : http://www.jboss.org/index.html?module=bb&op=posting&mode=reply&p=4221371
15 years, 8 months