2 Replies Latest reply on Jan 27, 2008 6:57 AM by Vitaliy

    Duplicate tasks.

    Dung Nguyen Newbie

      Dear all,

      I use jBPM to develop my business and I face the problem when I integrated with Fork node. My process is:

      ----------------------------------/ Task1-->...
      Start ---> Task0 --> Fork -->|

      I wrote MyController that extends from TaskControllerHandler and assign every task on my process. In this code I override initializeTaskVariables and submitTaskVariables function. In initializeTaskVariables function I force end task when the forceCompleted task is true.
      So, when I'm in Task0 and force end task 0. First, when end task the task 1 send the signal to fork and fork transfer data and send signal to Task1 and Task 2, at this time Task0 is not complete. Second, when Task0 completed, the Task0 resubmit a signal to Fork and Fork do the same thing in previous task. So in current system we have 2 Task1 instance and 2 Task2 instance.
      I dont know why, and I want to solve this bug. I only want the Task0 send the signal to Fork node when Task0 completed.

      Please help me to solve this bugs.
      If you have any idea, please send me to me at dungnguyen@truthinte.com

      Dzung Nguyen.

        • 1. Re: Duplicate tasks.
          Dung Nguyen Newbie

          Dear all,

          I found the solutions to solve this issue and I show my idea to discuss:
          When calling task.end(transition) the task will fire EVENTTYPE_END_EVENT, Fork receive the event and do its task. At that time, the task check the signal flag (isSignalling) to make sure that 'the end of this task triggers continuation of execution' and this condition is passed, so the token of this task to send the signal by calling token.signal(transition) and Fork node will receive this signal again.
          So, I think, we will off the signal flag by calling the function task.setSignalling(false) when calling task.end(transition) in the internal of this task.

          Note: This situation only appear when you force end task in internal of this task.


          • 2. Re: Duplicate tasks.
            Vitaliy Newbie

            dungnguyen, thank You SO MUCH.
            Same trouble - Your workaround works.