-
1. Re: Invoking JBoss ESB BPM through Web Services
mageshbk Nov 24, 2011 5:45 AM (in response to while_true)Could you share the action configuration which starts the jBPM flow?
-
2. Re: Invoking JBoss ESB BPM through Web Services
while_true Nov 24, 2011 6:10 AM (in response to mageshbk)Hey Magesh,
Here it is:
<service category="GetInfoServices" description="Get the info" name="GetInfo"> <listeners> <jms-listener busidref="getInfoGwChannelBpm" is-gateway="true" name="GetInfoGwChannelBpm"/> <jms-listener busidref="getInfoEsbChannelBpm" name="GetInfoEsbChannelBpm"/> </listeners> <actions mep="RequestResponse"> <action class="actions.CreateOrderAction" name="createOrderAction" process="createOrder"/> <action class="org.jboss.soa.esb.services.jbpm.actions.BpmProcessor" name="getInfoBpmFlow" process="process"> <property name="command" value="StartProcessInstanceCommand"/> <property name="process-definition-name" value="getInfo"/> <property name="esbToBpmVars"> <mapping bpm="theBody" esb="BODY_CONTENT"/> </property> </action> <action class="actions.CloseOrderAction" name="closeOrderAction" process="closeOrder"/> </actions> </service>
-
3. Re: Invoking JBoss ESB BPM through Web Services
mageshbk Nov 28, 2011 3:21 AM (in response to while_true)1 of 1 people found this helpfulAntónio,
Invoking the service GetInfoServices:GetInfo using deliverySync will indeed return as soon as all the actions have been completed in that pipeline. Here one of your action is a BpmProcessor action that invokes a StartProcessInstanceCommand. This is a jBPM API command and will only initiate the process. It will not poll and wait for the process to complete. You will have to poll for process completion in a separate action to acheive what you need. Ideally the process could involve human tasks and can run for days/months. So you should take these into consideration when designing services.
-
4. Re: Invoking JBoss ESB BPM through Web Services
while_true Nov 28, 2011 6:18 AM (in response to mageshbk)Thank you, Magesh.
I'll try to use the separate action approach to check either if the jBPM process as ended or not and then I'll let you know how it went!
Best regards.
-
5. Re: Invoking JBoss ESB BPM through Web Services
while_true Nov 28, 2011 12:25 PM (in response to mageshbk)Magesh,
I tried to add some kind of synchronization to my service but unfortunately I wasn't able to accomplish what I intended..
At the CloseOrderAction, a class that extends ESB's AbstractActionLifecycle class, I've added the following:
public class CloseOrderAction extends AbstractActionLifecycle { public final Message closeOrder(final Message message) { synchronized(message) { message.wait(); } ... } }
And at the last action of the jBPM process I've something like this:
public class DummyProcess extends AbstractActionLifecycle { public final Message executeDummyAction(final Message message) { ... synchronized(message) { message.notify(); } } }
Well the problem is that, using the ESB's process flow message as the synchronization token, the process stays blocked at the CloseOrderAction's closeOrder method...
What do you think is the better approach for the use of the synchronization token in the ESB's flow?