cancel
Showing results for 
Search instead for 
Did you mean: 

Get the Step identifier for process call and groovy script

S0014399387
Explorer
0 Kudos
1,335

I'm using the Eclipse plugin. If you add a new step to the flow you can right click it, select technical information and see the ID of the step (for example CallActivity_6). I would like to have this identifier available in two cases:

  • Local integration process: I want to know which Process Call step is triggering the process
  • Groovy script: I want to know which script step is calling the Groovy script

I know that the message properties contain a parameter called ModelStepId which know the calling ID, but I cannot seem to obtain it (other than apply the toString function on the message properties).

So my question is: how to get the step identifier out of the properties map?

Thanks in advance!

Bram

View Entire Topic
filipe_rieger
Explorer
0 Kudos

You can parse the message history to get the latest activity ID. With following script you will be able to identify the activity ID of the groovy script itself.

//Read Activity ID of groovy
    def messageHistories = message.getProperty(Exchange.MESSAGE_HISTORY).join(',')
    def lastCallActivity = messageHistories.substring(messageHistories.lastIndexOf("CallActivity"), messageHistories.length());
    def activityIDOfGroovy = lastCallActivity.substring(0, lastCallActivity.indexOf("]"));