Hi everyone,
I am trying to get a variable value from "java script policy" to "assign message policy" and setting it there in flow variable.
java script-
var resoursepath = 'SetWorkOrderState'; context.setVariable("resoursepath", resoursepath);
assign variable policy-
<AssignVariable> <Name>path</Name> <Value><!-- what goes here? --></Value> </AssignVariable> </AssignMessage>
I want to know what should sit in the value tag to fetch the variable from js policy.
Thanks in advance.
Answer by Priyadarshi Ajitav Jena · Aug 12, 2020 at 05:08 PM
context.setVariable("resourcepath", 'value-for-resourcepath-variable');
This directly sets the resourcepath flow variable to a value.
if you want to use AssignMessage to refer to that variable, you can use something like this:
<AssignMessage name='policy-name-here'> ... <AssignVariable> <Name>some-other-variable</Name> <Ref>resourcepath</Ref> <!-- refer to previously set var --> </AssignVariable> </AssignMessage>
Path suffix not writing variables in new url 1 Answer
Assign Message OR condition check 1 Answer
AssignMessage - How can I get all headers ? 2 Answers
Setting a FormParam overwrites all form params from request 1 Answer
How to generate XML response with the starting XML node describing version and encoding? 1 Answer