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.
To configure a process flow:
The New Process Flow Wizard opens, as shown in the following image.
This Service object will set the required Special Registers (SREGs) that are required by the process flow.
The SREG Agent service type allows SREGs to be used throughout the business logic for data manipulation and processing.
The Object Properties pane opens, as shown in the following image.
The User Properties pane opens, as shown in the following image.
XPATH(http/url/queryparms/queryparm[contains(@name,'file')])
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:
This File object checks to see if the file with the given title exists.
The File Object Type pane opens, as shown in the following image.
The Object Properties pane opens, as shown in the following image.
Parameter |
Value |
---|---|
Operation |
exist |
File (from) |
c:\temp\sreg(file) |
Out Document |
Result |
Action on Failure |
input |
Note: Error handling is not being configured in this sample configuration. However, it is recommended to add error handling in production applications.
This File object reads the requested file if it exists.
The File Object Type pane opens, as shown in the following image.
The Object Properties pane opens, as shown in the following image.
Parameter |
Value |
---|---|
Name of File |
c:\temp\sreg(file) |
Response Type |
flat |
This Service object will set a default error message if the requested file is not found in the specified location.
The Object Properties pane opens, as shown in the following image.
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 |
The following image shows the completed process flow.
The Publish Resource Wizard opens, as shown in the following image.
iWay Software |