Configuring a Process Flow

How to:

A process flow contains all the business logic and performs the required processing. It parses the received event document to retrieve the parameter for the requested file name. It validates that the requested file exists. If the file exists, the process flow retrieves the content of the file. If the file is not available, the process flow returns a default error message.


Top of page

x
Procedure: How to Configure a Process Flow

To configure a process flow:

  1. Open iWay Integration Tools (iIT) and create a new Integration Project called REST, as shown in the following image.

  2. Expand the REST Integration Project node, right-click the Flows subfolder and select Process Flow from the context menu, as shown in the following image.

    The New Process Flow Wizard opens, as shown in the following image.

  3. Create a new process flow called GetFile.pFlow under the new REST Integration Project.
  4. Click Finish.
  5. Add a Service object to the new process flow.

    This Service object will set the required Special Registers (SREGs) that are required by the process flow.

  6. Name the new Service object as Set Title Register and select SREG Agent as the service type.

    The SREG Agent service type allows SREGs to be used throughout the business logic for data manipulation and processing.

  7. Click Next.

    The Object Properties pane opens, as shown in the following image.

  8. Leave the default values that are provided and click Next.

    The User Properties pane opens, as shown in the following image.

  9. Click the green plus sign (+) icon to define a new design time property.
  10. Enter the following settings for the new property:
    • Name: file
    • Type: string
    • Value:
      XPATH(http/url/queryparms/queryparm[contains(@name,'file')])
    • Description: Sets file registers to the value received from the incoming event document parameter.

    Note: The iFL statement for the value will perform an XPATH into the event document that is received by the nHTTP listener. It will extract the parameter value from this document that holds the value for the parameter named file. This parameter from the incoming document will contain the file title that will be retrieved. The following is a sample of the event signal document returned by nHTTP with a marked file parameter. In this example, the file SREG will be set to myfile.txt.

    The following is a sample URL provided by the user:

    http://localhost:2222/get?file=myfile.txt

    The following is a sample event document that is generated:

  11. Connect the Start object and the Set Title Register object using the On Completion relation.
  12. Add a File object named Check if File Exists to the process flow, as shown in the following image.

    This File object checks to see if the file with the given title exists.

  13. Click Next.

    The File Object Type pane opens, as shown in the following image.

  14. Select PF File Ops Agent {com.ibi.agents.XDPFFileOpsAgent} from the Type drop-down list.
  15. Click Next.

    The Object Properties pane opens, as shown in the following image.

  16. Provide values for the parameters as listed in the following table.

    Parameter

    Value

    Operation

    exist

    File (from)

    c:\temp\sreg(file)

    Out Document

    Result

    Action on Failure

    input

  17. Click Finish.
  18. Connect the Set Title Register object and the Check if File Exists object using the On Completion relation.

    Note: Error handling is not being configured in this sample configuration. However, it is recommended to add error handling in production applications.

  19. Add a File object named Read File to the process flow, as shown in the following image.

    This File object reads the requested file if it exists.

  20. Click Next.

    The File Object Type pane opens, as shown in the following image.

  21. Select PF File Read Agent {com.ibi.agents.XDPFFileReadAgent} from the Type drop-down list.
  22. Click Next.

    The Object Properties pane opens, as shown in the following image.

  23. Provide values for the parameters as listed in the following table.

    Parameter

    Value

    Name of File

    c:\temp\sreg(file)

    Response Type

    flat

  24. Click Finish.
  25. Connect the Check if File Exists object and the Read File object using the On Success relation.
  26. Add another Service object to the process flow.

    This Service object will set a default error message if the requested file is not found in the specified location.

  27. Name the new Service object as Default MSG if No File.

  28. Select Constant Agent as the service type, which sets the current content of the document to the application provided value.

  29. Click Next.

    The Object Properties pane opens, as shown in the following image.

  30. Provide values for the parameters as listed in the following table.

    Parameter

    Value

    Constant Output To Emit

    Error: Requested file not found!

    This indicates to the user that the file does not exist in the current system.

    Output Format

    flat

  31. Click Finish.
  32. Connect the Check if File Exists object and Default MSG if No File object using the On Custom (not found) relation.
  33. Add an End object to the process flow.
  34. Connect the Read File object to the End object using the On Success relation.
  35. Connect the Default MSG if No File object to the End object using the On Success relation.

    The following image shows the completed process flow.

  36. Right-click the GetFile.pFlow process flow, select Integration Tools, and then click Publish, as shown in the following image.

    The Publish Resource Wizard opens, as shown in the following image.

  37. Provide the required connection parameters to iSM and click Finish.

iWay Software