1 Reply Latest reply on Sep 24, 2007 4:30 AM by Ronald van Kuijk

    Strange instances

    Martin Ehrlich Newbie


      I found some strange instances of ActionHandlers.

      We wrote our own sub process handler. We needed more control over the communication between parent and child and over the embedding of the child into the parent.

      For testing purposes I tried to let our sub process node as part of process A call process A again. This is a recursive call which we will not allow and there will be checks against.

      This is the situation.

      Let AP be the parent process instance and AC the child instance.

      We create the AC like this:

      JbpmContext jbpmContext =executionContextOfAP.getJbpmContext()
      GraphSession graphSession = jbpmContext.getGraphSession();
      List processDefinitions = graphSession.findAllProcessDefinitions();
      <... Looking for process by the name of AP ... >
      ProcessInstance processInstanceOfAC = processDefinitionOfAC.createProcessInstance();

      When ok, we start processInstanceOfAC with


      This causes an Exception of a type I didn't expect in I OUR code. Looking for the reason I found:

      processDefinitionOfAP and processDefinitionOfAC are different instances of ProcessInstance. That's ok and what I expected.
      But the instances of the used ActionHandlers are the same. So parent and child use the same instance of ActionHandler. (Which causes our code to crash.)

      My questions:
      1. Is this behaviour deliberate?
      2. If yes, then why?
      3. We are using Jbpm 3.1.2. Is it the same in 3.2?