0 Replies Latest reply on Apr 7, 2010 1:54 AM by Shishir Choubey

    Issue while manually skipping few nodes in a process instance

    Shishir Choubey Newbie

      Hi All,


      I am using jBPM 3.2.2 in my project & we have developed quite complex WF using it. But in one of a WF we have scenario where I am querying the jBPM schema to get the process instance & trying to skip/close/cancel few task in it, basically i just want to skip these nodes & make sure process reach to certain node, so that it can execute further normally.


      In my WF there is fork, from fork one transition goes to a subprocess & another goes to a task, both meet to a join which goes to another task. In a subprocess I have three task nodes. so my objective is, in another instance of this process based on certain decision I have identify old instance of this process (that i am able to do) and then programmatically close/skip/cancel all the task in subprocess & same for another fork transition so that old process instance can reach to the task which is after the join.


      To achieve this i tried lot of things till now & facing the below issues -


      1. At a time taskMgmtInstance.getTaskInstances() gives only active task instance, after closing taskInstance process will create next instance of Task.

         for this I tried doing below -

                                //Closing all the Task
                                       taskInstanceCol = getTaskInstanceCollection(processInstance);

           But this also wont work as in few cases it will take some time to create the task Instances.


      2. As it is a subprocess in one of the fork of the main process I updated the JBPM_TASKINSTANCE table manually for all open task & forcefully end the subprocess. for other side of the fork I closed the task(as i have a single task here). So ideally the process should reach to join & the task which is after the join should be created.

                               But it is not the case, the process still waiting in fork (checked the jBPM schema fork end is still null).


      Please reply me ASAP to this post if anybody have some idea about this.

      (I tried to put all of my observations here, please let me know if any thing is not clear)


      Thanks in Advance,