1
0
-1

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

 

    CommentAdd your comment...

    2 answers

    1.  
      1
      0
      -1

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

       

        CommentAdd your comment...
      1.  
        1
        0
        -1

        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!

        1. Ranjith

          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

        2. Justin

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

        3. Ranjith

          No its not involved in workflow

        4. Justin

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

        CommentAdd your comment...