Welcome Guest! Log in


The forum is in read only mode.
Stambia versions 2.x, 3.x, S17, S18, S19 and S20 are reaching End of Support January, 15th, 2024. Please consider upgrading to the supported Semarchy xDI versions. See Global Policy Support and the Semarchy Documentation.

The Stambia User Community is moving to Semarchy! All the applicable resources have already been moved or are currently being moved to their new location. Read more…

Topic-icon Question How to split the values of an input parameter with scripting ?

  • Nicolas Verscheure
  • Nicolas Verscheure's Avatar Topic Author
  • Offline
16 Dec 2014 18:07 - 17 Dec 2014 09:32 #1 by Nicolas Verscheure
It's possible to call a delivery with a parameter like that : 'ABC', 'DEF', 'GHI'
Unfortunately, it's not always possible to use the singles quotes especially when you are using a professional scheduler like Visual Tom. Indeed the singles quotes are interpreted by the scheduler.
You can solve it simply using this scripting :

var str = "${~/inListOfValues}$";
var n = str.split(",");
var result = "";
for(var i = 0;i < n.length;i++) {
    if(result != "") result += ",";
    result += "'"+n[i]+"'";
println("inListOfValues = ${~/inListOfValues}$");
println("inListOfValues splitted = " + result);

Result :

Thus you can use the splitted values in a filter in a mapping for example.
Last edit: 17 Dec 2014 09:32 by Nicolas Verscheure.