3 Replies Latest reply on Sep 7, 2007 5:20 AM by kukeltje

    getting current task in decisionHandler

    cheets

      Hi All,
      I am using taskInstance.Id to identify variable for taking decion in my DecisionHandler class. For this I need to access the current taskinstance from within the handler.
      If i do executioncontext.getTaskInstance(), it returns null.
      As per my understanding, this function should return the current task instance which called the decision handler.
      Please clarify?
      Thanks!

        • 1. Re: getting current task in decisionHandler
          kukeltje

          there is no current taskinstance in a decisionnode. The taskinstance does not call the decisionhandler, it takes a transition and does not know where this transitions to. Saving and closing a taskinstance saves the variable to the processlevel where it is accessible to the decisionhandler.

          • 2. Re: getting current task in decisionHandler
            cheets

            ohh... ok. this definitely clears up things. thanks!

            I understand that the executioncontext is sent to all action/decision handlers,but then, shouldn't this be mentioned somewhere that decision handler will not get a current task instance from executioncontext,
            executionContext.getTaskInstance() is kind of misleading.
            (Although now, after your explanation, it looks so obvious :) , but I am sure there will be others like me..)
            Thanks again!

            • 3. Re: getting current task in decisionHandler
              kukeltje

              then they now have this forum post to find out ;-)