Uploaded image for project: 'jBPM'
  1. jBPM
  2. JBPM-4031

Fork/Join with async nodes and variable updates fails

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Done
    • Icon: Major Major
    • jBPM 3.2.15
    • jBPM 3.2.13
    • Runtime Engine
    • None

      We have succeed in reproducing the issue in a very simple process you can try yourself.

      Write an action called "SetVariableLocallyAction" with the following content:

      package test;
      
      import org.jbpm.graph.def.ActionHandler;
      import org.jbpm.graph.exe.ExecutionContext;
      
      
      public class SetGlobalVariableAction extends AbstractBpmHandler implements ActionHandler {
      
          @Override
          public void execute(ExecutionContext executionContext) throws Exception {
              System.out.println("NODE EXECUTION: " + executionContext.getToken().getId());
              executionContext.getContextInstance().setVariableLocally("MYVARIABLE", executionContext.getToken().getId(), executionContext.getToken());
              executionContext.leaveNode();
          }
      
      }
      

      Then do the followiong simple process

      1) A start state
      2) A fork
      3) Two nodes (for the two branches of the fork) with the previously defined action associated as Action handler.
      4) A join
      5) An End State

      Try the process and you will see that everything is working fine.

      Now set the nodes of the two branches of the fork to be "async=true" and try again the ame process. You will then have a org.hibernate.StaleObjectStateException.

              marco.rietveld Marco Rietveld (Inactive)
              rhn-support-mputz Martin Weiler (Inactive)
              Votes:
              0 Vote for this issue
              Watchers:
              4 Start watching this issue

                Created:
                Updated:
                Resolved: