2 Replies Latest reply on Sep 12, 2011 7:33 AM by d.y.

    How to get current node of process

    process15

      Hi

       

      I'm having trouble in finding the current node of the process in jbpm v5.1. In the API, it seems I have to get the ProcessContext but I can't find how I can get the ProcessContext from the KnowledgeBase or Session etc to get the current executing node etc ? Is there a simple way to get the current node from the process instance ?

       

      Thanks Dave

        • 1. Re: How to get current node of process
          eaa

          You have to use a little bit of "magical casting":   ProcessInstance process = ksession.startProcess("some.process");  //To get the name of the first node where the process is waiting: ((org.jbpm.workflow.instance.WorkflowProcessInstance)process).getNodeInstances().iterator().next().getNodeName()WorkflowProcessInstance

          • 2. Re: How to get current node of process
            d.y.

            Since this Thread is being quoted quite often i suggest you remove the "WorkflowProcessInstance" at the end of the Statement (((org.jbpm.workflow.instance.WorkflowProcessInstance)process).getNodeInstances().iterator().next().getNodeName()WorkflowProcessInstance)  because it can be a bit confusing imho.