2 Replies Latest reply on Mar 19, 2007 5:29 PM by Ronald van Kuijk

    How to find out current node/state in process instance?

    Kirill Shepitko Newbie


      I'm actively investigating jBPM, therefore I'm writing appropriate tests.
      I've defined one test, that starts a new process instance (creates one via JbpmContext, saves into DB).

      Second test should get the newest process instance from DB, and continue it.
      I do it by calling GraphSession.findProcessInstances(aProcessDefinitionFromDB);

      The question is: how second test can detect, which is the current wait state?
      Alas, jBPM API description is rather poor (I mean jbpm-3.1.4, and API docs that are attached to the distributive), and the only thing I could find was ProcessInstance.getRootToken() --but it seems to return a reference to the start state...

      How can I decide, for example, which node transition to activate, if I don't know at which node the process instance is currently?
      Why there's no a method like ProcessInstance.getCurrentToken() or ProcessInstance.getCurrentNode()?