2 Replies Latest reply on Jun 9, 2006 12:33 AM by Ephemeris Lappis

    [jBPM][3.1.1] Nodes : reload process instance state

    Ephemeris Lappis Newbie

      Hello again !

      A first application java code may keep a reference on a given process instance.

      In parallel, other applications, or timer execution may change the process state, activating transition, changing variables, etc.

      What is the best way to refresh the process instance for a new operation (signal, task execution, variable modification, etc.) inside a context block ? I've tried the following, and it seems to work :

      jbpmContext = jbpmConfiguration.createJbpmContext();
      try {
       processInstance = jbpmContext.getGraphSession().loadProcessInstance(processInstance.getId());
       Token token = processInstance.getRootToken();
       token.signal();
       jbpmContext.save(processInstance);
      }
      finally {
       jbpmContext.close();
      }