In this section: |
Provides a step-by-step example of creating a process flow.
In this section: |
The function of the process flow in this example, is to route two specific XML document types, identified by the root element, to specific directories on your system. To accomplish this, we must use multiple Decision Test objects using a True/False test. A single Decision Test Object testing for multiple value switching cannot handle testing for a document tag name. Once the XML documents are identified, they will be routed through the process flow to File objects that are configured to write the XML document contents to a file in a designated directory.
The following image shows the process flow we will create. It includes a Start object, two Decision Test objects, each with a true and false path, three File objects, and an End object.
Normally, you will have multiple XML documents as input to a process flow. For illustrative purposes, we will use just two documents as input to our example process flow.
Use a text editor, such as Notepad, to create the following two XML documents.
<SWIFT1>Route1 <USER>Atlas</USER> </SWIFT1>
<SWIFT2>Route2 <USER>USA</USER> </SWIFT2>
This section walks you through the steps to create the example process flow. You will begin by creating a new project and process flow, and continue by adding and defining each object that makes up the flow. As you add objects, you will define the relationship between them. Finally, you will validate and test the flow using the XML documents you created as input to the process flow.
To create the Router_Example project and the SWIFT_ROUTER process flow:
The Integration Project Configuration dialog box opens.
The Router_Example project node appears in the Navigation Pane.
The New Process Flow properties dialog box opens, as shown in the following image.
The new SWIFT_ROUTER process flow node appears under the Flows folder, and the workspace displays a Start object, as shown in the following image.
You are ready to build the SWIFT_ROUTER process flow.
To create the first Decision Test object:
The Test Operands dialog box opens, as shown in the following image.
The XPath Builder tool opens.
The Select Destination dialog box opens.
The Route1 XML document contents appear in the XPath Builder dialog box, as shown in the following image.
The XPath Builder - Build an XPath dialog box opens.
You are returned to the Test Operands dialog box, which now contains the XPath expression you just created, as shown in the following image.
These parameters allow any XML input documents with a <SWIFT1> root tag to be captured.
The Value Occurrences dialog box opens, as shown in the following image.
The Decision Test object appears in the workspace, as shown in the following image.
To define the relationship between the Start and IsType1 objects:
The Configuration dialog box opens, as shown in the following image.
A line appears between Start and IsType1, showing that a relationship has been established. This line is blue to indicate an OnCompletion event.
We want all XML documents captured by IsType1 that contain the <SWIFT1> element, sent to a File object named File_1. In addition, we want the File_1 object to write its output document to a disk.
To create the File_1 object:
The New File Object dialog box opens, as shown in the following image.
The File Type dialog box opens, as shown in the following image.
The New File Object - Properties dialog box opens, as shown in the following image.
The File_1 object appears in the workspace, as shown in the following image.
Build a relationship between the IsType1 Decision Test object and the File_1 File object, so that an XML document coming into IsType1 that has a <SWIFT1> element, is sent onto the File_1 object. To build this relationship:
The Relation Configuration dialog box opens.
The following image shows the Relation Configuration dialog box with the OnCustom event and true case selections.
A line appears between IsType1 and File_1, showing that a relationship has been established. This line is brown to indicate a Custom event.
Create the second Decision Test object, which will receive all documents that do not contain the <SWIFT1> element. We want this object to capture all documents containing <SWIFT2> elements and route them to the second File object. We will route all other files to a dead-end File object.
The Test Operands dialog box opens, as shown in the following image.
The XPath Builder tool opens.
The Route2 XML document contents appear in the XPath Builder dialog box, as shown in the following image.
The XPath Builder - Build an XPath dialog box opens.
You are returned to the Test Operands dialog box, which now contains the XPath expression you just created, as shown in the following image.
These parameters allow any XML input documents with a <SWIFT2> root tag to be captured.
The Value Occurrences dialog box opens, as shown in the following image.
The Decision Test object, IsType2, appears in the workspace, as shown in the following image.
Build a relationship between Decision Test objects IsType1 and IsType2, so that an XML document coming into IsType1 does not have the tag <SWIFT1>, and then send it to IsType2.
The Line Configuration dialog box opens.
The following image shows the Line Configuration dialog box with the OnCustom event, false case selections.
A line appears between IsType1 and IsType2, showing that a relationship has been established. This line is brown to indicate a Custom event.
The following image shows the routing of XML documents from the Decision Test object IsType1, based on a true or false condition. If the document coming into IsType1 has the <SWIFT1> element, it will be routed to File_1. If it does not, it will be routed to IsType2.
We want the XML documents captured by the IsType2 Decision Test object that contain a <SWIFT2> element, to be sent to a File object named File_2. To create the File_2 object:
The New File Object dialog box opens, as shown in the following image.
The File Type dialog box opens, as shown in the following image.
The New File Object - Properties dialog box opens, as shown in the following image.
The File_2 object appears in the workspace.
Build a relationship between Decision Test object IsType2 and the File_2 object, so that XML documents with a <SWIFT2> element coming into IsType2 will be sent to File_2.
The Line Configuration dialog box opens.
The following image shows the Line Configuration dialog box with the OnCustom event and true case selections.
A line appears between IsType2 and File_2, showing that a relationship has been established. This line is brown to indicate a Custom event.
We want all XML documents captured by the IsType2 Decision Test object that do not contain the <SWIFT1> or <SWIFT2> XML element, to be sent to the NONE File object. To set this up:
The New File Object dialog box opens, as shown in the following image.
The File Type dialog box opens, as shown in the following image.
The New File Object - Properties dialog box opens, as shown in the following image.
The NONE File object appears in the workspace.
Build a relationship between Decision Test object IsType2 and the NONE File object, so that any XML documents coming into IsType2 without a <SWIFT2> tag are not routed to any other object in the process flow.
The Line Configuration dialog box opens.
The following image shows the Line Configuration dialog box with the OnCustom event and false case selections.
A line appears between IsType2 and NONE, showing that a relationship has been established. This line is brown to indicate a Custom event.
The following image shows the process flow with all of the required Decision Test and File objects.
The final step is to terminate the SWIFT_ROUTER process flow with an End object.
To terminate the process flow, add an End object, and then build a relationship between it and the File_1, File_2, and None objects.
The New End Object - End Name and Description dialog box opens.
The End Object Schema dialog box opens, as shown in the following image.
The End object appears in the workspace, as shown in the following image.
Build a relationship between the File_1 object and the End object to end the process flow.
The Relation Configuration dialog box opens.
A line appears between File_1 and End, showing that a relationship has been established. This line is blue to indicate an OnCompletion route, meaning the document will always follow this path.
You are now ready to save, validate, and test the process flow.
The complete process flow is shown in the following image.
Note: You can add text to the diagram to easily identify an area of the process flow. In this example, the text identifies the true and false decision paths. To add text to the workspace, drag the Text icon to the workspace, type the text you want to appear, click outside of the text box to paste the text in the workspace, then drag the text to its location in the diagram.
To save the process flow, in the File menu, select Save from the drop-down list.
The validate feature verifies that the process flow structure is complete and properly assembled. Once the process flow is validated, you can test it with one of the input documents we created at the beginning of our example.
To validate the SWIFT_ROUTER process flow:
The status of the validation appears in the Validation Results dialog box, as shown in the following image.
To test this process flow:
The Edit configuration and launch dialog box opens, as shown in the following image.
Click the Runtime Options tab, as shown in the following image.
The process flow goes through the test run and displays a status dialog box, as shown in the following image.
The test results are displayed in the Message Console pane, as shown in the following image.
The workspace area displays a message that the test was successful, as shown in the following image.
|
iWay Software |