1) Well, as you know, endpoints backed by a BPEL process are stateful. In 
general, you will have a process instance per request, unless two or more 
requests correlate to the same process instance. In this case these requests 
will execute the same instance.

This is a consequence of the design of the BPEL language. You can expect 
performance similar to stateful session beans in the EJB domain.

2) In jBPM, a process instance is composed of one or more tokens. Each token 
represents a path of execution. Initially, a process instance contains a single 
token which represents the main path. When the process logic encounters an 
activity with more than one path of execution (the flow activity, a scope with 
event handlers, etc) the engine spaws one token per path.

jBPM runs these paths serially to avoid starting new threads because this is 
forbidden in a Java EE environment. This might look bad, but in practice it is 
not: jBPM stops executing a path of execution when it encounters a blocking 
activity (these include inbound message and time-driven activities). 

When jBPM stops executing a path, a separate server thread must resume the 
execution of that path. This is where JMS  is critical to the BPEL runtime: it 
allows for executing more than one path of the same process instance in 
parallel, while fully adhering to Java EE guidelines.

To illustrate, consider the following example:
<sequence>
  |  <receive name="a" createInstance="yes"/>
  |  <flow>
  |   <sequence name="b">
  |    <invoke name="b1"/>
  |    <receive name="b2"/>
  |   </sequence>
  |   <sequence name="c">
  |    <assign name="c1 />   
  |    <receive name="c2" />
  |   </sequence>
  |  </flow>
  |  <reply name="d"/>
  | </sequence>
The order of execution is:
[thread-1]
a, b1, c1
[thread-2]
b2
[thread-3]
c2, d

Note that d executes in either thread-2 or thread-3 depending on what request 
arrives first, b2 or c2

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

Reply to the post : 
http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=3977059
_______________________________________________
jboss-user mailing list
[email protected]
https://lists.jboss.org/mailman/listinfo/jboss-user

Reply via email to