Integration Forum
cancel
Showing results for 
Search instead for 
Did you mean: 
Read only

Testing Cloud Integration Groovy 4

MMZ
Explorer
0 Likes
867

Hi everyone,

I wanted to check with you about an issue I’m not able to overcome. I watched your video on the topic “Future-proof your scripts in SAP Cloud Integration” by @MortenWittrock on DevOctoberFest, interesting one

In the past, I have been using the Exchange object for several things, and I’d like to future-proof those scripts, but I haven’t been able to get it working.

In my tenant, I’m testing this very simple Groovy script:

// This Groovy Flowstep Version 2, running with Groovy 4, Downgrade the script if older behaviour needed.

import com.sap.it.script.v2.api.Message
import com.sap.it.script.v2.api.proxy.Exchange

def Message processData (Message message)
{
Exchange e = message.exchange
message.setProperty("ExchangeName",e.getContext().getName())
message.setProperty("GroovyVersion",GroovySystem.version)
return message
}

This is exactly the same script used in the demo (Min 27 Second 17), but in my tenant, even after upgrading the Groovy version for this script, it’s throwing the following exception (during simulation and also in runtime):

unable to resolve class com.sap.it.script.v2.api.proxy.Exchange
@ line 4, column 1.
import com.sap.it.script.v2.api.proxy.Exchange

Am I missing something? I’m finding it difficult to leverage this Groovy 4 feature, and I couldn’t find much information on the provided classes either.

Thanks in advance for your help!

Best regards,

Mikel

 

1 ACCEPTED SOLUTION
Read only

manish_kn
Explorer
0 Likes
577

Hi, 
You probably mean this class:

import com.sap.it.script.v2.api.Exchange

View solution in original post

2 REPLIES 2
Read only

manish_kn
Explorer
0 Likes
578

Hi, 
You probably mean this class:

import com.sap.it.script.v2.api.Exchange
Read only

MMZ
Explorer
0 Likes
501

Thanks Manish!