Creating the Process Flow

In this section:

How to:

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.


Top of page

x
Procedure: How to Create the Project and Process Flow

To create the Router_Example project and the SWIFT_ROUTER process flow:

  1. Connect to the repository from which you want to work.
  2. Right-click the repository node and select New Project from the drop-down list.

    The iWay Project Configuration dialog box opens.

  3. In the Name field, type Router_Example as the project name, and select base as the configuration.
  4. Click Finish.

    The Router_Example project node appears under the repository node in which it was created.

  5. Expand the Router_Example project node to expose the project elements.
  6. Right-click the Processes folder and select New Process from the drop-down list.

    The iWay Process Configuration dialog box opens, as shown in the following image.

  7. In the Name field, type SWIFT_ROUTER as the process flow name.
  8. Click Finish.

    The new SWIFT_ROUTER process flow node appears under the Processes folder and the workspace displays a Start object, as shown in the following image.

You are ready to build the SWIFT_ROUTER process flow.


Top of page

x
Procedure: How to Create the First Decision Test Object

To create the first Decision Test object:

  1. Drag and drop the Decision Test object from the toolbar to the workspace. The New Test Object dialog box opens.
  2. Name the Decision Test object IsType1, and click Next.

    The Test Operands dialog box opens, as shown in the following image.

  3. For Operand One of the test parameters we will create an XPath expression. Select Create XPath expression from the Operand One drop-down list.

    The XPath Builder tool opens.

  4. Click Load XML File and browse to the Route1 XML document that you created earlier.

    The Route1 XML document contents appear in the XPath Builder dialog box, as shown in the following image.

  5. Click Next.

    The XPath Builder - Build an XPath dialog box opens.

  6. In the left pane of XPath Builder, double-click the Swift1 element. This adds the /SWIFT1 element to the XPath field, as shown in the following image.

  7. Click Next twice, and then click Finish.

    You are returned to the New Test Object - Test Operands dialog box, which now contains the XPath expression you just created, as shown in the following image.

  8. From the Operation drop-down list, select Is Not Null.

    These parameters allow any XML input documents with a <SWIFT1> root tag to be captured.

  9. Click Next.

    The Value Occurrences dialog box opens, as shown in the following image.

  10. Select Any and click Finish.

    The Decision Test object appears in the workspace, as shown in the following image.


Top of page

x
Procedure: How to Define the Relationship Between Start and IsType1

To define the relationship between the Start and IsType1 objects:

  1. Select the Start object, press the Shift key and then select the IsType1 object.
  2. Right-click IsType1 and select Build Relation from the drop-down list.

    The Configuration dialog box opens, as shown in the following image.

  3. Since this is the first relationship in the process flow, you can only choose OnCompletion as the Event. This means the document will always follow this path.
  4. Click OK.

A blue line appears between Start and IsType1, indicating an OnCompletion relationship is established.


Top of page

x
Procedure: How to Route the Document Based on Decision Test Result

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:

  1. Drag and drop the File Object from the toolbar to the workspace.

    The New File Object dialog box opens, as shown in the following image.

  2. In the Name field, type File_1 and leave the Description as File object.
  3. Click Next.

    The File Type dialog box opens, as shown in the following image.

  4. From the Type drop-down list, select FileWrite. This tells the File_1 object to write the incoming document to the disk.
  5. Click Next.

    The New File Object - Properties dialog box opens, as shown in the following image.

    1. In Target Directory, type a path to the directory where the file will be written. In this example, we direct the file to D:\Temp\Out.
    2. In File Pattern, type TYPE_1_*.xml.
    3. In Avoid Preemitter, select true. This ignores any assigned preemitters.
    4. In Return, select status to return a status document.
  6. Click Finish.

    The File_1 object appears in the workspace, as shown in the following image.


Top of page

x
Procedure: How to Define the Relationship Between IsType1 and File_1

Build a relationship between 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:

  1. Select the IsType1 object, press the Shift key and then select the File_1 object.
  2. Right-click File_1 and select Build Relation from the drop-down list.

    The Line Configuration dialog box opens.

  3. Select OnCustom from the Events drop-down list.
  4. Select true as the case for the event.

    The following image shows the Line Configuration dialog box with the OnCustom event and true case selections.

  5. Click OK.

    A line appears between the objects to indicate a relationship is established. This line is brown to indicate a custom event.


Top of page

x
Procedure: How to Create the Second Decision Test Object

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 second File object. We will route all other files to a dead-end File object.

  1. Drag and drop the Decision Test Object from the toolbar to the workspace. The New Test Object dialog box opens.
  2. Name the Decision Test object IsType2, and click Next.

    The Test Operands dialog box opens, as shown in the following image.

  3. From the Operand One drop-down list, select Create XPath expression.

    The XPath Builder tool opens.

  4. Click Load XML File and browse to the Route2 XML document that you created earlier.

    The Route2 XML document contents appear in the XPath Builder dialog box, as shown in the following image.

  5. Click Next.

    The XPath Builder - Build an XPath dialog box opens.

  6. In the left pane of XPath Builder, double-click the Swift2 element. This adds the /SWIFT2 element to the XPath field, as shown in the following image.

  7. Click Next twice, and then click Finish.

    You are returned to the New Test Object - Test Operands dialog box, which now contains the XPath expression you just created, as shown in the following image.

  8. From the Operation drop-down list, select Is Not Null.

    These parameters allow any XML input documents with a <SWIFT2> root tag to be captured.

  9. Click Next.

    The Value Occurrences dialog box opens, as shown in the following image.

  10. Select Any and click Finish.

    The Decision Test object, IsType2, appears in the workspace, as shown in the following image.


Top of page

x
Procedure: How to Define the Relationship Between IsType1 and IsType2

Build a relationship between Decision Test objects IsType1 and IsType2 so that an XML document coming into IsType1 does not have the tag <SWIFT1>, then send it to IsType2.

  1. Select the IsType1 object, press the Shift key and then select the IsType2 object.
  2. Right-click IsType2 and select Build Relation from the drop-down list.

    The Line Configuration dialog box opens.

  3. Select OnCustom from the Events drop-down list.
  4. Select false as the case for the event.

    The following image shows the Line Configuration dialog box with the OnCustom event, false case selections.

  5. Click OK.

    A line appears to represent the relationship between IsType1 and IsType2. 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.


Top of page

x
Procedure: How to Route the Document Based on Second Decision Test True Result

We want the XML documents captured by the IsType2 Decision Test object that contains a <SWIFT2> element to be sent to a File object named File_2. To create the File_2 object:

  1. Drag and drop the File object from the toolbar to the workspace.

    The New File Object dialog box opens, as shown in the following image.

  2. In the Name field, type File_2 and leave the Description as File object.
  3. Click Next.

    The File Type dialog box opens, as shown in the following image.

  4. From the Type drop-down list, select FileWrite. This tells the File_2 object to write the incoming document to the disk.
  5. Click Next.

    The New File Object - Properties dialog box opens, as shown in the following image.

    1. In Target Directory, type a path to the directory where the file will be written. In this example, we will send the file to D:\Temp\Out.
    2. In File Pattern, type TYPE_2_*.xml.
    3. In Avoid Preemitter, select true. This ignores any assigned preemitters.
    4. In Return, select status to return a status document.
  6. Click Finish.

    The File_2 object appears in the workspace.


Top of page

x
Procedure: How to Define the Relationship Between IsType2 and File_2

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.

  1. Select the IsType2 object, press the Shift key, and then select the File_2 object.
  2. Right-click File_2 and select Build Relation from the drop-down list.

    The Line Configuration dialog box opens.

  3. Select OnCustom from the Events drop-down list.
  4. Select true as the case for the event.

    The following image shows the Line Configuration dialog box with the OnCustom event and true case selections.

  5. Click OK.

A line appears to represent the relationship between IsType2 and File_2. This line is brown to indicate a custom event.


Top of page

x
Procedure: How to Route the Document Based on Second Decision Test False Result

We want all XML documents captured by 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:

  1. Drag and drop the File object from the toolbar to the workspace.

    The New File Object dialog box opens, as shown in the following image.

  2. In the Name field, type NONE, and leave the description as File object.
  3. Click Next.

    The File Type dialog box opens, as shown in the following image.

  4. From the Type drop-down list, select FileWrite. This tells the NONE File object to write the incoming document to the disk.
  5. Click Next.

    The New File Object - Properties dialog box opens, as shown in the following image.

    1. In Target Directory, type a path to the directory where the file will be written. In this example, we will write the file to D:\Temp\Out.
    2. In File Pattern, type NONE_OF_THE_ABOVE_*.xml.
    3. In Avoid Preemitter, select true. This ignores any assigned preemitters.
    4. In Return, select status to return a status document.
  6. Click Finish.

The NONE File object appears in the workspace.


Top of page

x
Procedure: How to Define the Relationship Between IsType2 and NONE

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.

  1. Select the IsType2 object, press the Shift key and then select the NONE object.
  2. Right-click NONE and select Build Relation from the drop-down list.

    The Line Configuration dialog box opens.

  3. Select OnCustom from the Events drop-down list.
  4. Select false as the case for the event.

    The following image shows the Line Configuration dialog box with the OnCustom event and false case selections.

  5. Click OK.

    A line appears to represent the relationship between IsType2 and NONE. 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.


Top of page

x
Procedure: How to Terminate the Process Flow

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.

  1. Drag and drop the End object onto the workspace.

    The New End Object - End Name and Description dialog box opens.

  2. Keep the default name, End, and description of the End object.
  3. Click Next.

    The End Name Schema dialog box opens.

  4. Select <None> from the Schema drop down list.
  5. Click Next.

    The New End Object - Properties dialog box opens, as shown in the following image.

  6. From the Terminate value drop-down list, select false. This indicates that you want to obtain output from the process flow.
  7. Click Finish.

    The End Object appears in the workspace, as shown in the following image.


Top of page

x
Procedure: How to Define Relationships Between the End Object and File_1, File_2, and NONE

Build a relationship between the File_1 object and the End object to end the process flow.

  1. Select the File_1 object, press the Shift key, and then select the End object.
  2. Right-click the End object and select Build Relation from the drop-down list.

    The Line Configuration dialog box opens.

  3. Select OnCompletion from the Events drop-down list. This directs the process flow to always follow this route.

    The next Line Configuration dialog box opens, as shown in the following image.

  4. Click OK.

    A line appears to represent the relationship between File_1 and End. This line is blue to indicate an OnCompletion route, meaning the document will always follow this path.

  5. Follow Steps 1 through 4 using the OnCompletion as the event type to establish a relationship between the File_2 object and End, and then between the NONE object and End.

You are now ready to save, validate, and test the process flow.


Top of page

x
Save 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 it identifies the true and false decision paths. To add text to the workspace, drag and drop 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 Navigator pane right-click the SWIFT_ROUTER node and select Save from the drop-down list. A message appears in the Results tab of the Message Log pane, as shown in the following image.


Top of page

x
Validate and Test the Process Flow

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.


Top of page

x
Procedure: How to Validate the Process Flow

To validate the SWIFT_ROUTER process flow:

  1. In the Navigator pane, right-click the SWIFT_ROUTER process flow node.
  2. Select Validate from the drop-down list.

    The status of the validation appears in the Validate tab of the Message Log pane, as shown in the following image.


Top of page

x
Procedure: How to Test the Process Flow

To test this process flow:

  1. From the Build menu, select Test, then Run.

    The Locate a Test Server dialog box opens.

  2. Type the server URL, and the user name and password to log into the process server. An example of this dialog box is shown in the following image.

  3. Click Next.

    The Message Log pane displays the status of your login.

    The Select Server Configuration dialog box opens.

  4. From the Configuration drop-down list, select the configuration and click Next.

    The Trace and Transactions Options dialog box opens, as shown in the following image.

  5. You can select the level of debugging that you want through the Process Object Debugging and Server Side Tracing options. In this example we will select to trace all active objects, and Commit Transactions so that the transaction of the process flow will be performed during the test.
  6. Click Next.

    The Input Document dialog box opens.

  7. Type the path or browse to the Route2 XML file you created at the beginning of this example.

    The contents of Route2.xml appears in the Input Document dialog box, as shown in the following image.

  8. Click Finish.

    The process flow goes through the test run and displays a status and results in the Message Log pane. The following image shows the test results in the Message Log pane.


iWay Software