[jboss-user] [JBoss jBPM] - How to start this process instance?

clandestino_bgd do-not-reply at jboss.com
Mon Feb 5 16:48:49 EST 2007


Dear JBPM people,

I am wondering what it would be the best way to start process instance of  process definition, which have in start-state some system action (it is not executed by human). On node-enter event some action should be triggered.

Please look at the example below:

<?xml version="1.0" encoding="UTF-8"?>
  | 
  | <process-definition xmlns="urn:jbpm.org:jpdl-3.1" name="simple">
  |    <swimlane name="admin" />
  |    <action name="messageActionHandler"
  | 		class="org.springmodules.workflow.jbpm31.JbpmHandlerProxy"
  | 		config-type="bean">
  | 		<targetBean>messageActionHandler</targetBean>
  | 	</action>
  | 
  |       <start-state name="start">
  |       <event type="node-enter">
  |          <action ref-name="messageActionHandler" />
  |       </event>
  |       <transition name="to_first" to="first"/>
  |    </start-state>
  |    <task-node name="first">
  |       <task swimlane="admin">
  |       <controller>
  |           <variable name="font" />
  |         </controller>
  |       </task>
  |       <transition name="to_end" to="end"/>
  |         
  |    </task-node>
  |    <end-state name="end"></end-state>
  | </process-definition>

As you can see, here the "start-state" does not contain task and after process instance is created, it cannot be started with:

 taskInstance = processInstance.getTaskMgmtInstance().createStartTaskInstance();

like in JBPM example webapp, because  exception in createStartTaskInstance() occurs, since startTask is NULL.

If I fetch the rootToken and call signall() on it, my Action on node-enter event is not invoked.

Token rootToken = processInstance.getRootToken();
  | rootToken.signal();

Just to mention, everything works fine when the start-state is executed by human, and node-enter event with my action is defined in the next state.

Any hint?
Thank you and regards
Milan

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

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



More information about the jboss-user mailing list