2 Replies Latest reply on May 11, 2008 3:04 PM by kukeltje

    forcing propogation of variables from process to task form

    rbradwell

      I have a scenerio whereby a message queue consumer receives a message and then the relevant jbpm process instance is pulled out via

      context.getProcessInstance(processInstanceId)

      It then adds variables to the process via

      contextInstance.setVariable(..)

      and then saves the process instance.

      Concurrenly I have another process that is responsible for actioning the workflow and retrieving the current user tasks with a call such as

      context.getTaskMgmtSession().findTaskInstancesByProcessInstance(processInstance);

      The problem I am having is that when I am pulling the user tasks back I am not getting the variables set in the task form by the message queue consumer process.

      I have wrote my own TaskControlHandler to do the copying of the process variables to the task form variables. This doesn't seem to be getting called when I am doing the call to findTaskInstancesByProcessInstance().

      I remember reading in the docs that the flushing from process to form and vice versa only happens on creation/ending of task. Therefore my question is how do I force the propogation of vars from the process to the task form when I do the findTaskInstancesByProcessInstance() call?

      Any thoughts? cheers!

        • 1. Re: forcing propogation of variables from process to task fo
          rbradwell

          I'll just try and bump this one more time because i'm struggling. I'll try and explain it a bit more consisely this time.

          - I have a java process that calls jbpm anywhere in my workflow and sets some variables on the jbpm process.

          - I have another java process that talks to the jbpm process via forms.

          The problem is that the second process doesn't necessarily see the changes the first process made to the variables on the process because TaskControlHandler isn't called until a task is created or close.

          • 2. Re: forcing propogation of variables from process to task fo
            kukeltje

            it is very hard for us to know what is going on if you have written your own taskcontroller.

            Normally, creating a task, it copies the variables from the process to the task and when finishing the task, it copies them back (watch out with parallel tasks!!!)

            That is all I can say