Declaring global variable

Hi,

 

Please help me variablize "name" and "description" as global variable. This XML is a header string (BODY for REST POST method).

 

<securityTag>
<objectTypeName>SecurityTag</objectTypeName>
<type><typeName>SecurityTag</typeName></type>
<name>XYZ</name>
<description>Demo</description>
<extendedAttributes/>
</securityTag>

 

 

Thanks,

Sam

Parents
  • Hi Sam,

     

    Thanks for raising this question! You may use the 'System properties', which are global flow variables with values that never change and can be used in any flow.

    Please refer to the Studio Guide - 'Configuring System Properties' section for more info on this matter.

     

    Let me know if this helps!

     

    Regards,

    Mitko

  • Hi Mitko,

     

    Thanks for the reply. I understand that I will have to declare global variable in system properties however it is an XML header so wondering how can I variablize it. I can variablize a URL but not sure about an attribute of an XML header body.

     

     

    Thanks,

    Sam

  • Hi Sam,

     

    Which operation are you using?

     

    Is this the request or the response header?

     

    If this is the request header you can create a new result for the operation, assign it the value of your input XML header and use an Xpath or XML Get Element Value filter to take out the values that you require.

     

    If this is the response header, again you can filter the response using XML Get Element Value or a XPath Query filter.

     

    If you are using the InvokeMethod2 operation you can simply add a Scriptlet in it and make use of the rawXMLRequest:

     

    scriptletContext.put("rawXML", scriptletRawResult['rawXMLRequest']);

     

    This will add the rawXMLRequest in the Step Context and from there you can easily use a filter on the result and afterwards Set Flow Variable as the next step and grab the actual value.

     

    Best regards,

    Daniel

Reply
  • Hi Sam,

     

    Which operation are you using?

     

    Is this the request or the response header?

     

    If this is the request header you can create a new result for the operation, assign it the value of your input XML header and use an Xpath or XML Get Element Value filter to take out the values that you require.

     

    If this is the response header, again you can filter the response using XML Get Element Value or a XPath Query filter.

     

    If you are using the InvokeMethod2 operation you can simply add a Scriptlet in it and make use of the rawXMLRequest:

     

    scriptletContext.put("rawXML", scriptletRawResult['rawXMLRequest']);

     

    This will add the rawXMLRequest in the Step Context and from there you can easily use a filter on the result and afterwards Set Flow Variable as the next step and grab the actual value.

     

    Best regards,

    Daniel

Children