cancel
Showing results for 
Search instead for 
Did you mean: 

CPI: Access current "Model Step" from groovy script

Florian_Kube
Participant
0 Kudos
777

Hi all,

I would like to access the current Model Step in Groovy. Is there a way I can access it?

Thanks in advance,

Regards Florian

MortenWittrock
Active Contributor
0 Kudos

Hi Florian

I don't think that's possible. Could you expand a bit on what you're trying to accomplish?

Regards,

Morten

View Entire Topic
filipe_rieger
Explorer
0 Kudos

Hi Florian,

you can at least read the ID from the message history to dynamically set the MPL name. A little bit ugly, but for me it works.

def messageHistories = message.getProperty(Exchange.MESSAGE_HISTORY).join(',')
def lastCallActivity = messageHistories.substring(messageHistories.lastIndexOf("CallActivity"), messageHistories.length());
def activity = lastCallActivity.substring(0, lastCallActivity.indexOf("]"));