how add coupling data using a script

how add coupling data using a script

gguedia5QZFN
Enthusiast Enthusiast
321 Views
1 Reply
Message 1 of 2

how add coupling data using a script

gguedia5QZFN
Enthusiast
Enthusiast

Hello,

I am trying to use a flexsript code to set the value of a treenode. As you can see on the image below, the node is expecting a coupling data. I wonder,  what is the line of code if I want the results in processflow to be "token.queue".

gguedia5QZFN_0-1749064114921.png

 

Thank you in advance for your help.

0 Likes
Accepted solutions (1)
322 Views
1 Reply
Reply (1)
Message 2 of 2

FelixMoehlmann
Collaborator
Collaborator
Accepted solution

You can't assign a direct reference to the node since it needs to be dynamic. Toggle the node as flexscript and assign the script to return the token label. You can check out the default header for that field by opening the code editor for it.

moehlmann_fe_0-1749105158826.png

Noting that the token gets passed in as "param(3)" you can shorten this to the following.

moehlmann_fe_1-1749105233035.png

 

treenode activity = ...;
treenode assignTo = getvarnode(activity, "assignObjectTo");
assignTo.dataType = DATATYPE_STRING;
switch_flexscript(assignTo, 1);
assignTo.value = "return param(3).as(Token).labels.assert(\"MyQueue\", 0);";
0 Likes