<start-state name="start">
<transition name="" to="state1"></transition>
</start-state>
<state name="state1">
<event type="node-enter">
<script>System.out.println("this script is entering node "+node);</script>
</event>
<transition name="" to="end1"></transition>
</state>
<end-state name="end1"></end-state>
</process-definition>
JbpmContext jbpmContext = jbpmConfiguration.createJbpmContext();
try {
long processInstanceId =1;
processInstance = jbpmContext.loadProcessInstance(processInstanceId);
Token token = processInstance.getRootToken();
System.out.println(token.getNode());
token.signal();
System.out.println(token.getNode());
//等待外系统响应
token.signal();
System.out.println(token.getNode());
jbpmContext.save(processInstance);
}finally {
jbpmContext.close();
}
}
this script is entering node State(state1)
State(state1)
EndState(end1)