on ‎2023 Feb 09 1:19 PM
Hello friends,
I have a scenario in my development, In an integration flow, I need to access and modify few global variables (I created these global variables in another integration flow)
In flow 1: Using general splitter, I created global variables with the help of write variables adapter. You can see this from the attached file of .writevariable.png
In flow 2: I used a content modifier with a source type as "Global Variable" and source value as "${header.globalname}" contentmodifier.png.
But when I tried to read these global variables in flow 2, this doesn't seem to work.
Is there any solution for this?
Is it posiible to access these variables via Groovy Script?
Thank you!
Request clarification before answering.
Dear Veena,
We can not use camel Simple expression as a value for a parameter defined in content modifier with a source type as "Global Variable" or "Local Variable". It's a limitation as of now in SAP CPI.
So I have found a clever alternative for that either if you are setting up some values in global variable in you 1st iFlow then I would recommend you to create a HashMap with all the global patameter's name and it's value using Groovy and then create only one global variable using write step and assign your HashMap to that.
Luckily we can assign objects to the values in Write variable step.(Do it via HashMap->Property->Global Variable)
Then in the 2nd iFlow you can retrieve the global variable and then use another groovy to fetch your required parameter's value from the HashMap.
If you follow it properly, you will surely get your dynamic global variables 🙂
Thanks,
Asutosh Maharana
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
As per SAP Note 3014782, assigning camel simple expression for Global variable is not supported in content modifier. But today i have tried and i think right now expressions are also supported. May be your tenant has lower camel core version that's why it's not working but you can anyhow implement the trick I have mentioned above if your tenant do not support.
Hi Asutosh,
Good thinking!
Thank you very much for your answer!!!
I will definitely try this too and let you know about it.
With these I would like to say that, I got 3 solutions for my issue.
Regards,
Veena
I think it may be because you are naming you variable to include where it is.
See if this older Blog helps: Global Variable: Write Variable in CPI | SAP Blogs
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
| User | Count |
|---|---|
| 9 | |
| 7 | |
| 6 | |
| 4 | |
| 4 | |
| 2 | |
| 2 | |
| 2 | |
| 2 | |
| 2 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.