JBoss Community

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

created by bird86 in jBPM - View the full discussion

”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());
                              }
                    }
          }
  
}

 

https://community.jboss.org/servlet/JiveServlet/downloadImage/2-804221-20496/450-158/%E6%96%B0%E5%BB%BA%E4%BD%8D%E5%9B%BE%E5%9B%BE%E5%83%8F.bmp

Sorry, My English is very poor!!!!

Reply to this message by going to Community

Start a new discussion in jBPM at Community