Calling a .NET Library Function From a FlowLast Updated: 08/11/2016 Introduced in Verision: 2.0
The .NET Library contains a wide range of common functions, classes, and methods that can expedite the development process.
To call a .NET Library function from a flow, in the Flow Designer, expand the category Integration > .NET Libraries, and drag a component to the workspace.
In the example, we will create a flow that calls the Copy method to copy text entered into a form . . .
. . . and display it in another form.
Two forms have been created for this example, Basic Form and EndForm.
To begin, we navigate to a Designer folder and click the Create Flow button.
We give the flow a name and click OK to open it in the Flow Designer.
We start building our flow by adding the form that will capture the text to copy.
In the Flow Designer start-up window, in the category All Steps[Catalog] > Forms [Interaction] > [Current Folder], we select a Basic Form component and click Add to add it to the workspace.
We then add the method that will copy the text.
We expand the category Integration > .NET Libraries > System > String (Class) and drag a Copy (Method) component to the workspace.
Finally, we add the form that will displays the copied text.
We expand the category Forms [End] > [Current Folder], and drag an EndForm 1 component to the workspace.
All of the steps display alert icons until we connect the outcome paths in the flow.
We connect the Start step to the Basic Form step, the form that first opens when the flow runs. We connect the Basic Form step to the Copy step, which will copy the text. We connect the Copy step to the EndForm step, which will then display the copied text. Since this is all the flow should do, we connect the EndForm step to the End step.
Now that the paths are connected, we configure two of the components.
First we select the Copy step and click the Show Mapping Editor link.
In the Mapping Editor, we connect the form output, the text collected in the Basic Form, to the str input and click OK.
Next, we map the objects for the EndForm.
We select the EndForm step and click the Show Mapping Editor link.
In the Mapping Editor, we connect the Copy1_output to the end form’s input and click OK.
This completes the flow, so we save it and run it in the Debugger to test it.
Note that in Decisions version 3.5 and above, you will need to click Test Flow to access the Debugger.
We click the Form tab to open the Basic Form. We enter text in the field, and click OK.
After the flow completes, the copied text displays on the EndForm on the Form tab.
We click the Diagram tab to see the flow’s execution.