0 Replies Latest reply on Nov 13, 2012 7:50 PM by eodsf

    jBPM 5.3 - simple workflow w/ non-terminating end event that terminates the process

    eodsf Newbie

      sample3.png

      Hi,

       

      My company is evaluating jBPM, and I'm coming up to speed on it. While trying out some things in the Eclipse modeler & testing w/ unit tests, I've run into some issues w/ early experimentation. This is likely to be the first of some posts as I try to model what we need in our business execution & find out what is feasible.

       

      The above is an example of a simple workflow I have that have that terminates early before I can send in an event that will trigger the 'Main task'; acc.to the documentation '

      A Signal Event should have no incoming connections and one outgoing connection' (http://docs.jboss.org/jbpm/v5.1/userguide/ch05.html),  suggesting that this workflow should wait for a signal event of the type expected before executing the 'Main task' and then terminating. What I am seeing in my unit test is that after executing the 'Initial' task, the process instance is in a 'STATE_COMPLETE' (2) state. Further code that signals events w/ the expected event type (ksession1.signalEvent(....)) does not trigger execution of the 'Main task' (nor does it throw any exceptions or errors).

       

       

       

      Some snippets from my test & log below :

       



      ProcessInstance pi = ksession1.startProcess("unknownQC");





      long pid = pi.getId();


      System.out.println("Process instance started ... id = " + pid);





      boolean stillActive = ProcessInstance.STATE_COMPLETED != pi.getState();


      System.out.println("Process still active ? " + stillActive + " : state = " + pi.getState());



       

       

      Retreiving session ... id = 61

      BEFORE RULEFLOW STARTED process:Sample Process[id=unknownQC]

      BEFORE PROCESS NODE TRIGGERED node:StartProcess[id=1] process:Sample Process[id=unknownQC]

      BEFORE PROCESS NODE EXITED node:StartProcess[id=1] process:Sample Process[id=unknownQC]

      BEFORE PROCESS NODE TRIGGERED node:Initial[id=2] process:Sample Process[id=unknownQC]

      >>>>>>> Completing job

      >>>>>>> Process Id = 79

      >>>>>>> Work Item Id = 218

      >>>>>>> Work Item Name = Jbpm

      Work Item parameter = WORKFLOW_PROCESS_NAME  value =  unknownQC

      Work Item parameter = WORKFLOW_TASK_HANDLER  value =  jobAccepted

      Work Item parameter = WORKFLOW_TASK_NAME  value =  Job Accepted

      BEFORE PROCESS NODE EXITED node:Initial[id=2] process:Sample Process[id=unknownQC]

      BEFORE PROCESS NODE TRIGGERED node:End[id=11] process:Sample Process[id=unknownQC]

      BEFORE PROCESS NODE EXITED node:End[id=11] process:Sample Process[id=unknownQC]

      BEFORE RULEFLOW COMPLETED process:Sample Process[id=unknownQC]

      AFTER RULEFLOW COMPLETED process:Sample Process[id=unknownQC]

      AFTER PROCESS NODE TRIGGERED node:End[id=11] process:Sample Process[id=unknownQC]

      AFTER PROCESS NODE TRIGGERED node:End[id=11] process:Sample Process[id=unknownQC]

      AFTER PROCESS NODE TRIGGERED node:Initial[id=2] process:Sample Process[id=unknownQC]

      AFTER PROCESS NODE TRIGGERED node:Initial[id=2] process:Sample Process[id=unknownQC]

      AFTER PROCESS NODE TRIGGERED node:StartProcess[id=1] process:Sample Process[id=unknownQC]

      AFTER PROCESS NODE TRIGGERED node:StartProcess[id=1] process:Sample Process[id=unknownQC]

      AFTER RULEFLOW STARTED process:Sample Process[id=unknownQC]

      Process instance started ... id = 79

      Process still active ? false : state = 2

       

       

      Should this workflow work as expected ? Am I missing something obvious ?

       

      The above btw is a simplifcation of a larger workflow I'm working on, which will require being able to accept multiple events of any type (and multiple of the same tyoe) at any time before terminating if an event of a certain type is receievd ... but baby steps, I want to know why the above doesn't work so I can plan accordingly on what constructs I have at my disposal.

       

      Thanks !

       

       

      PS. I'm placing this in the jBPM 5.2 category b/c there is no 5.3 one (can somone add that please?), and taggint it w/ jBPM 5.3.0.final