Trusted Contributor.. KedarB Trusted Contributor..
Trusted Contributor..
1015 views

assign output of customized operation using Scriptlet into flow varible

I am facing an issue in assigning results to flow variable though Scriptlet

in my scriptlet i have some local variables that i want in my flows/Operations output as flow variable/Output

 

Please help me in same.

 

thanks in advance.

Labels (1)
0 Likes
1 Reply
seppler Respected Contributor.
Respected Contributor.

Re: assign output of customized operation using Scriptlet into flow varible

Assuming that I'm understanding your issue correctly, you should be able to do this using the examples from the Script Template.  Here is the relevant area from the Rhino template:

To set the result of the operation:
scriptletResult = "Your Result Here";

Use the context to hold data for use by other steps. It is also helpful to place information into the context to examine variables when developing and debugging scriptlets. For example to place the OutputString information into a context key called 'Output':
scriptletContext.putGlobal("Output", data);

Note that the Key and Value are both strings. For example to place 'code' into the context:
scriptletContext.putGlobal("Code", code.toString());

You can also place data into the local context, which means it will only be available to the current flow, but not to its parent flow or other subflows. To do this:
scriptletContext.put("LocalVariable","LocalValue"); 

To further explain... the first option "scriptletResult=" is for

the first option "scriptletResult=" is for Scriplets used in the "Output" filters only and will set the output of your filter to whatever you put here.  Think of it as the final result of the Filter.

The next two are both "scriptletContext.putGlobal()" and they will create/update a Global variable that will be available to your entire flow.  This may not show up in your selection list as inputs/outputs when authoring but if you manually type it in it will work.

The last one, "scriptletContext.put()" is similar to the putGlobal.  The only difference is that the variable will be a Local variable and so will only be available to the specific flow and not passed to any sub- or parent flow.

I hope that helps answer your question.

-Scott Eppler · Cloud Engineer · Coda Global
The opinions expressed above are the personal opinions of the authors, not of Micro Focus. By using this site, you accept the Terms of Use and Rules of Participation. Certain versions of content ("Material") accessible here may contain branding from Hewlett-Packard Company (now HP Inc.) and Hewlett Packard Enterprise Company. As of September 1, 2017, the Material is now offered by Micro Focus, a separately owned and operated company. Any reference to the HP and Hewlett Packard Enterprise/HPE marks is historical in nature, and the HP and Hewlett Packard Enterprise/HPE marks are the property of their respective owners.