[JBoss jBPM] - Transacted JMS from an Action
by andyredhead
Hi,
I have an action on a transition, in that action I post a message onto a JMS queue (using a jms session created with transact=true).
jBPM is being called from an EJB3 stateless session bean with the default "REQUIRED" transaction setting.
The behaviour I was hoping to see was that if the execution of jBPM failed (because of a problem in a later action), the whole transaction is rolled back - including not posting the jms message...
It seems that when I look up the jms connection factory from the action and create the transacted session, I get a new XA session, which needs to be committed seperately from the surrounding ejb3 transaction.
Any ideas how I can get the jms session and jbpm to "be in the same transaction"?
One option I'm trying to avoid is putting an asynchronous execution onto the later actions. However, if the work on JMS based asyc execution is ok for production use then I guess this might be a way forward (on the basis that doing the transition can't really fail so failures in later steps shouldn't really be a problem for the current client...).
Cheers,
Andy
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=3975717#3975717
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=3975717
19 years, 1 month
[JBoss jBPM] - Help:type of nodes returned by root.getNode() is unnarrowed
by gmournos
I have created a custom node type and I need to cast to it during the workflow execution.
However, when I cast the result of calling token.getNode() to my custom type, I get a ClassCastException, although the token is at my custom node at the time.
My code is complicated so I created a simple test case, and added it to the already existing GraphSessionDbTest.java (basically I just added three assertions to the existing test case).
The test case breaks, in the third assertion. The node has name 's' but it is not an instance of StartState...
| // added to jbpm-3.1/src/java.jbpm.test/org/jbpm/db/GraphSessionDbTest.java
|
| public void testUpdateProcessInstance2() {
| ProcessDefinition processDefinition = ProcessDefinition.parseXmlString(
| "<process-definition>" +
| " <start-state name='s' />" +
| " <node name='n' />" +
| "</process-definition>");
|
| processDefinition = saveAndReload(processDefinition);
|
| ProcessInstance processInstance = new ProcessInstance(processDefinition);
|
| processInstance = saveAndReload(processInstance);
| long pid = processInstance.getId();
|
| //this is the actual part added to the already existing testUpdateProcessInstance() case
| assertNotNull(processInstance.getRootToken().getNode());
| assertTrue(processInstance.getRootToken().getNode() instanceof Node);
| assertTrue(processInstance.getRootToken().getNode() instanceof StartState);
|
| assertEquals("s", processInstance.getRootToken().getNode().getName());
| processInstance.getRootToken().setNode(processInstance.getProcessDefinition().getNode("n"));
|
| processInstance = saveAndReload(processInstance);
| assertEquals("n", processInstance.getRootToken().getNode().getName());
| assertEquals(pid, processInstance.getId());
| }
|
|
Is this normal?
I am not a hibernate expert.
In my normal code (not when I am running the simple test case), during the execution of signal() I get hibernate warnings of the type:
14:01:34,429 [main] WARN StatefulPersistenceContext : Narrowing proxy to class org.jbpm.graph.node.StartState - this operation breaks ==
|
Are these relevant?
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=3975716#3975716
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=3975716
19 years, 1 month