AnsweredAssumed Answered

How to get the 'ActivityId' from an execution

Question asked by jjfutt on Apr 7, 2012
Latest reply on Apr 9, 2012 by schikkal
Using Runtime Service, or Execution, how can we get the activity id of the current activity?

For example, consider the case of this simple process consisting of three Java Service tasks:
[attachment=0]MyProcess.png[/attachment]

Let's the the process instance id 1001. Then in the Java Delegate code, if we invoke:

execution.getProcessInstanceId(), it will be 1001
exeuction.getId() will also be 1001

When the process eventually goes through ServiceTask2 and ServiceTask3, the execution id will still be the same 1001. If we want to differentiate or identify the unique activity that is being executed, executionId doesn't point to such a unique id. However, it appears that activitiId will give us the name of that activiti as defined in the process definition and that's exactly what we want. How can we get this programmatically .. I see the activityIds() being stored in internal tables, just need to access the same in our Java handlers as well?

Thanks.

Attachments

Outcomes