2 Replies Latest reply on May 5, 2011 10:26 PM by zorin

    How do you get the active node of a process

    jdh

      I am using IjBPM 5.0.  Given the ProcessInstance, how do you get the name of the active node?  Better than the answer would be if someone could provide me with where to find this information on my own?  Thanks.

       

      Jim

        • 1. Re: How do you get the active node of a process
          eaa

          You need to use one of the "magic" castings of jBPM...

          For example:

           

          WorkflowProcessInstance process = (WorkflowProcessInstance) ksession.startProcess("some.id");

          Assert.assertEquals("Ask for Emergency Information", process.getNodeInstances().iterator().next().getNodeName());

           

          Remember that the active nodes are those that left the process instance in a waiting state. So, for example, you will never see a Script Task here.

          • 2. How do you get the active node of a process
            zorin

            You can also monitor entries into nodes by using method public void beforeNodeTriggered( ProcessNodeTriggeredEvent event )

            of your implementation of org.drools.event.process.ProcessEventListener interface.