0 Replies Latest reply on Mar 22, 2013 4:39 AM by bird86

    how can i do, make it to work? about signal event

    bird86 Newbie

      ”my/test/event/signal/signalevent.bpmn“

       

      <process processType="Private" isExecutable="true" id="signalevent" name="" >

          <!-- nodes -->

          <startEvent id="_1" name="Start" />

          <intermediateCatchEvent id="_2" name="Signal" >

            <signalEventDefinition signalRef="signalevent"/>

          </intermediateCatchEvent>

          <endEvent id="_3" name="End" >

              <terminateEventDefinition/>

          </endEvent>

          <!-- connections -->

          <sequenceFlow id="_1-_2" sourceRef="_1" targetRef="_2" />

          <sequenceFlow id="_2-_3" sourceRef="_2" targetRef="_3" />

        </process>

       

       

       

      public class SignalEventTest extends MyJbpm5TestCase {
      
      
                public void testSignalEvent() {
                          String[] pro = { "my/test/event/signal/signalevent.bpmn" };
                          StatefulKnowledgeSession ksession = newStatefulKnowledgeSession(pro,
                                              new String[]{});
                          ProcessInstance startProcess = ksession.startProcess("signalevent");
                          long processInstanceId = startProcess.getId();
                          //myAssertNodeActive(processInstanceId, ksession, new String[] { "Signal" });
        
                          WorkflowProcessInstance processInstance = (WorkflowProcessInstance)ksession.getProcessInstance(processInstanceId);
                          println(processStateName[processInstance.getState()]);
                          Collection<NodeInstance> nodeInstances = processInstance.getNodeInstances();
                          for (NodeInstance nodeInstance : nodeInstances) {
                                    if(nodeInstance==null){
                                              println("nodeInstance==null");
                                    }else{
                                              println(nodeInstance.getNodeName());
                                    }
                          }
                }
        
      }
      

       

      新建位图图像.bmp

      Sorry, My English is very poor!!!!