3 Replies Latest reply on Feb 10, 2006 12:57 AM by fanrenheit

    JBPM 3.0 + How go I get Actor ID or Previous Actor ID

    vikaskadam

      Hi,

      In JBPM 2.0 I could get actor Id and previous actor Id using executionContext.getActorId() or executionContext.getPreviousActorId() call. However, JBPM 3.0 does not have Actor ID or Previous Actor ID associated to executionContext.

      I have business requirement in my decisionHandler that requires actorID and previousID. And, based on this information I take appropriate actions.

      So far I have tried
      (1) String actorId = executionContext.getTaskInstance().getActorId();
      (2) String prevActorId = executionContext.getTaskInstance).getPreviousActorId(); and
      (3) String actorId1 = executionContext.getTaskMgmtInstance().getSwimlaneInstance(swimlane).getActorId().

      In first two cases, TaskInstance is null and I do not get actor Id or previous actor Id. In third case, I have to give swimlane to get an actor id. I am interested in getting actor Id (user) who initiated the task and not the actor who is associated to the swimlane.

      Please let me know.

      Thanks in advance,

      Vikas Kadam
      vikas_kadam@hotmail.com.

        • 1. Re: JBPM 3.0 + How go I get Actor ID or Previous Actor ID
          zinasoft

          I have the same problem, can anybody illuminate me...??

          thanks

          • 2. Re: JBPM 3.0 + How go I get Actor ID or Previous Actor ID
            brittm

            Options 1 and 2 probably don't work because it is possible to have more than one task associated with a state and token at the same time. executionContext.getTaskInstance() is probably giving you back a new, empty TaskInstance that you could fill in and persist (just guessing).

            If you want to know who INITIATED the task(s) you probably need to know the actor who initiated the transition into your current state, since by default, tasks are created upon entry into a task-node.

            If you want to know to whom an open task is assigned, or to whom the task was previously assigned, you can either use taskMgmtSession.findTaskInstancesByToken(tokenId) and get the one you want out of the returned list, or use taskMgmtSession.loadTaskInstance(taskInstanceId).

            Of course, it would be nice if the API allowed you to load taskInstances by name in some of these cases.

            -Britt

            • 3. Re: JBPM 3.0 + How go I get Actor ID or Previous Actor ID
              fanrenheit

              this i a bug of jbpm3.0