Mapping variables
Freemarker official documentation
RunMyProcess Freemarker Functions
Basic Mapping
Let's say you have a variable "firstname1" in your process, and you want to store its value into "firstname2", how to do this into RunMyProcess?
First possibility
You enter, either in input variables or output variables of an activity
firstname2 = ${firstname1}
Second possibility
You click on the 'open an editing window' link and you write
<#assign tmp = firstname1>
${tmp}
it means : store the value of 'firstname1' into 'tmp' then return 'tmp' value, that will be assigned to 'firstname2'
2011-06-14_122309.png
Parsing a structure
OK, now let's say you want to parse a structure and access to a specific item.
JSONObject
Here's my structure :
If i click on 'my_json', i see this :
As you can see, a json structure starts with '{' and ends with '}' and contains couples of key:value
To create a variable my_address containing the address above, i'll write :
my_address = ${my_json.address}
JSONArray
Now let's try to parse an array :
As you can see, this is an array with 2 elements (index 0 then index 1)
If i want to retrieve the address of the first element, i'll write :
my_address = ${my_array[0].address}
Note : I access to the first element with my_array[0]
, which is a json structure, then I add .address
Please give details of the problem