Home JBpm JBoss Jbpm superstates
11 | 03 | 2010
JBoss 5 AS Book
"JBoss AS 5 development" reviews
Please share your feedback/review with other readers!
Banner
Dashboard
Advertise with Us
Banner
RSS Feed
Login
Sign here for the NewsLetter.



Poll
What book could be in your wish list next XMas ?
 
JBoss admin resources
Banner
JBPM Books
JBoss howto

How can you solve deployment errors caused by large war/jar/ear files ?

jboss recipe of the day ...
Read More

How do you configure your .war to be deployed after your EJB ?

jboss recipe of the day ...
Read More

How do I configure a Queue/Topic to work in a cluster?

JBoss recipe of the day ...
Read More
JBoss Jbpm superstates
Written by Mark S.   
What is a superstate ? a Superstate is a group of nodes.
Superstates are a convenient way to group nodes into related sets, denoting for instance phases in a process. For example, one application could be to group all the nodes of a process in phases. Actions can be associated with superstate events. A consequence is that a token can be in multiple nested nodes at a given time. This can be convenient to check wether a process execution is e.g. in the start-up phase.

 
Superstate transitions
All transitions leaving a superstate can be taken by tokens in nodes contained within the super state. Transitions can also arrive in superstates. In that case, the token will be redirected to the first node in the superstate. Nodes from outside the superstate can have transitions directly to nodes inside the superstate. Also, the other way round, nodes within superstates can have transitions to nodes outside the superstate or to the superstate itself. Superstates also can have self references

jboss jbpm

Jbpm superstate events
 
There are 2 events unique to superstates: superstate-enter and superstate-leave. These events will be fired no matter over which transitions the node is entered or left respectively. As long as a token takes transitions within the superstate, these events are not fired.
Note that we have created separate event types for states and superstates. This is to make it easy to distinct between superstate events and node events that are propagated from within the superstate

 
Hierarchical names
Node names have to be unique in their scope. The scope of the node is its node-collection. Both the process definintion and the superstate are node collections.

jbpm tutorialTo refer to nodes in superstates, you have to specify the relative, slash (/) separated name. The slash separates the node names. Use '..' to refer to an upper level. The next example shows how to reference a neighbouring superstate.



<process-definition>

 ...

 

<fork name="fork1">

 

<transition to="Send Mail" name="to Send Mail"></transition>

 

<transition to="super-state1/Check Money"></transition>

 
 

</fork>
 

<join name = "join1" />


......
<
super-state name="super-state1">

 

<state name="Check Money">

 

<transition to="Check Identity"></transition>

 

</state>

 

<state name="Check Identity">

 

<transition to="../join1"></transition>

 

</state>

 

</super-state>

In this sample a node points directly to a node inside the superstate: however a transition can point just to a super state.

jbpm tutorialWhen a transition arrive to a superstate and the node is not specified then the token is redirected to the first node without an incoming transition.

 


JBoss.org Search
Custom Search
Comments
Search
Kukeltje  - Nice turorial     |2008-10-06 20:07:07
Small addition. Afaik, if no node in a superstate is specified, the first node
*without* an incomming transition is choosen. That is the same as with jBPM
itself. A start-node is not needed there anymore (since 3.2.2 I think), not sure
Mark   |2008-10-07 09:31:24
Hi Ronald, thank you for your hint. I have added it to the closing
sentence.
Hope to see you again around here
vignesh  - Developer     |2009-06-01 15:35:33
Dear Mark,
1000 Thanks for posting useful articles here. I am a beginner & the
official documentation is no where when compared to your simple
step-by-step tutorials
AKINFIEVA   |2009-07-01 09:30:43
Hi! Thank you for your useful tutorials! I am a beginner and I am trying to use
a Fork with two process-states.

Could you please tell me the difference between
using process-states and super-states?

On the other hand, could you please
give me the Java code of how would you call signal() in Your example, so that
both branches execute concurrently? The problem is that in my example I have 3
states on each branch of the fork: A1, A2, A3 and B1, B2, B3. When I call
signal() to get to the fork, A1 and B1 are executed. When I call signal again,
A1 is executed again! And then A2 and A3.

Thank you very much!
Only registered users can write comments!

3.26 Copyright (C) 2008 Compojoom.com / Copyright (C) 2007 Alain Georgette / Copyright (C) 2006 Frantisek Hliva. All rights reserved."