[jboss-dev-forums] [Design of JBoss jBPM] - Re: MessageService and JMS

mteira do-not-reply at jboss.com
Wed Oct 11 06:58:39 EDT 2006


After the previous changes, I was able to create new ProcessInstances for an already deployed ProcessDefinition called 'Async' using a JMS standalone client, basically doing:

NewProcessInstanceCommand npic = new NewProcessInstanceCommand();
  | npic.setProcessName("Async");
  | //Setup for JMS session and producer using JNDI (omitted)
  | ObjectMessage om = session.createObjectMessage();
  | om.setObject(npic);
  | producer.send(om);

The process instances are created, and I can see them into the Oracle database I'm using as datasource. But now, I'm a little confused about how to start those process instances:

My first attempt was to add to the 'start-state' node the attribute async with value 'true'. But it seems that's not valid under the DTD as I got that error while trying to deploy such process definition. 

So, I guess that perhaps I should send a SignalCommand targetting that newly created process instance. To do so, it seems that I need to know the tokenId I want to signal (and it looks logical to me), but how could I know it from my JMS client. 

What I'm going after is to be able to run the complete process inside the JBoss threads. I just want to launch it from the JMS client.

Why the start-state node can not be run asynchronously? Is that a design limitation?

Shouldn't I receive some feedback from my NewProcessInstanceCommand to know at least what ProcessInstance id I've launched (in order to send signals to that process instance tokens, for example) ?

What's the previousToken for, in the SignalCommand class ?

Regards.




View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=3977488#3977488

Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=3977488



More information about the jboss-dev-forums mailing list