User development,
A new message was posted in the thread "Problem Signaling a Waiting Execution":
http://community.jboss.org/message/520950#520950
Author : Andy Barreras
Profile :
http://community.jboss.org/people/FlyNavy
Message:
--------------------------------------------------------------
Ronald,
I think you are on to something. Here's the issue. I have a Process Definition with
8 steps (i.e activities) in it (Activity1 through Activity8). Each step is a state. When
I create a instance of the Process Definition, I get the exception because
programatically, the API only recognizes the first activity (state) so when I signal the
ProcessEngine to advance, there is nothing to advance to. Here's how I tested it
where's as the executionListener variable is an instance to the
EventListenerExecution that is passed as an argument in my Listener class:
System.out.println("CURRENT EXECUTION NAME: " +
executionListener.getName());
System.out.println("CURRENT EXECUTION ID: " +
executionListener.getId());
System.out.println("CURRENT EXECUTION KEY: " +
executionListener.getKey());
System.out.println("CURRENT EXECUTION STATE: " +
executionListener.getState());
System.out.println("CURRENT EXECUTION PRIORITY: " +
executionListener.getPriority());
System.out.println("IS PROCESS INSTANCE: " +
executionListener.getIsProcessInstance());
Set<String> s = executionListener.findActiveActivityNames();
Iterator<String> i = s.iterator();
while(i.hasNext()) {
String activity = i.next();
System.out.println("ACTIVITY NAME IN SET [CURRENT]: " + activity);
}
Outputs:
1. I know the ExecutionListener is a ProcessInstance since the
executionListener.getIsProcessInstance()returns 'true'
2. There is only one activity (Activity1) in the Set that is returned from
executionListener.findActiveActivityNames()method even though (as you can see in the JPDL
code below), there are 8 activities.
JPDL code:
<?xml version="1.0" encoding="UTF-8"?>
<process name="Simple Activity Scheduling"
xmlns="http://jbpm.org/4.0/jpdl">
<start g="188,25,48,48" name="start">
<transition g="-110,-11" name="to Activity1"
to="Activity1"/>
</start>
<state g="137,123,150,52" name="Activity1">
<on event="end">
<event-listener class="my.package.MyListener1"/>
</on>
<transition name="to Activity2" to="Activity2"
g="-138,-18"/>
</state>
<state g="137,220,152,52" name="Activity2">
<on event="end">
<event-listener class="my.package.MyListener2"/>
</on>
<transition name="to Activity3" to="Activity3"
g="-153,-18"/>
</state>
<state g="128,322,170,52" name="Activity3">
<on event="end">
<event-listener class="my.package.MyListener3"/>
</on>
<transition name="to Activity4" to="Activity4"
g="-129,-18"/>
</state>
<state g="141,420,142,52" name="Activity4">
<on event="end">
<event-listener class="my.package.MyListener4"/>
</on>
<transition name="to Activity5" to="Activity5"
g="-150,-18"/>
</state>
<state g="129,527,168,52" name="Activity5">
<on event="end">
<event-listener class="my.package.MyListener5"/>
</on>
<transition name="to Activity6" to="Activity6"
g="-137,-18"/>
</state>
<state g="127,632,170,52" name="Activity6">
<on event="end">
<event-listener class="my.package.MyListener6"/>
</on>
<transition name="to Activity7" to="Activity7"
g="-46,-18"/>
</state>
<state g="165,739,92,52" name="Activity7">
<on event="end">
<event-listener class="my.package.MyListener7"/>
</on>
<transition name="to Activity8" to="Activity8"
g="-130,-18"/>
</state>
<state g="142,846,139,52" name="Activity8">
<on event="end">
<event-listener class="my.package.MyListener8"/>
</on>
<transition name="to end" to="end"
g="-36,-18"/>
</state>
<end g="651,849,48,48" name="end"/>
</process>
--------------------------------------------------------------
To reply to this message visit the message page:
http://community.jboss.org/message/520950#520950