Get running activity id from process insrance

Confluence User - 26 Jul, 2018

I need a activity id to set workflow variable. I have process id. Is any bean shell method to fetch migrated process id and current running activity id ?

Please help

 

form;workflow;variable;activity;processid

6


26 Jul, 2018
confluenceUser
confluenceUser

Hello Ranjith,

I'm not sure of your use case. I assume you're writing bean shell in the context of a process flow. In this case, you may use this hash variable: #assignment.activityId#

Just a side note, you can use hash variables in bean shell by treating the hash variable as a literal string, such as --> String activityID = "#assignment.activityId#";

Hope this helps!

26 Jul, 2018
confluenceUser
confluenceUser

Thanks. But my use case is to make all employee list with account manager workflow variable need to be updated. in this case i have used separate form and in store binder i tried to change workflow variable based on process id which is not working. But Activity id is what its using

26 Jul, 2018
confluenceUser
confluenceUser

The above solution should work then, since your use case seem involved in a process flow. Test it out!

26 Jul, 2018
confluenceUser
confluenceUser

No its not involved in workflow

26 Jul, 2018
confluenceUser
confluenceUser

Then it will depend on where you place your bean shell codes. The codes must be within a process context for this to work.

27 Jul, 2018
confluenceUser
1
confluenceUser

Hi, i think you can try using this method WorkflowManager#getActivityList to retrieve the running activity. Usually, the first 1 is the running 1.

 

RELATED QUESTIONS

Your answer


To answer a question you'll need an account.

Print