In this section:
How to: |
This section describes how to configure process flows using the Samba agent in iWay Designer.
The Designer Project Information dialog box opens.
The Designer Project Bindings dialog box opens.
The choice of project association depends on where you intend to publish (deploy) your process flow. If you are developing a process flow for use as part of a channel, you must publish it to the Registry for subsequent deployment.
The SambaAgent project node appears under the repository in which it was created (in this example, it appears under iWay).
The iWay Process Configuration dialog box opens.
The new SambaPflow node appears under the Processes folder, and the workspace displays a Start object.
You are ready to build the SambaPflow by adding objects to it and specifying their relationships.
To add a Samba agent Service object:
The Service Name and Description dialog box opens.
The Service Type dialog box opens.
To view a list of parameters that are required to configure the Samba Read agent, see Samba Read Agent Configuration Parameters.
To view a list of parameters that are required to configure the Samba Emit agent, see Samba Emit Agent Configuration Parameters.
To view a list of parameters that are required to configure the Samba Ops agent, see Samba Ops Agent Configuration Parameters.
The Define Service dialog box opens.
The new Service object appears in the workspace.
Now you need to connect the Start object to the Service object.
The Line Configuration dialog box opens.
This option indicates that there are no conditions that affect the path, and that the path between the two objects will always be followed.
A line appears between the objects to indicate that a relationship has been established.
All processing paths must terminate with an End object.
The End Name and Description dialog box opens.
The End Name Schema dialog box opens.
The Properties dialog box opens.
The new End object appears in the workspace.
The Line Configuration dialog box opens.
This option indicates that the path will be followed if there is a normal completion.
You can reposition the objects as desired.
Now you need to validate the process flow and publish it to the Registry of the iWay Service Manager Administration Console for use in the route in the channel for inbound processing.
Validating a process flow ensures that its structure is correct. Publishing a process flow makes it available in the Registry for use in channel configuration.
For instructions on validating and publishing the process flow, see the iWay Designer User's Guide.
Note: This is the simplest possible process flow to configure. In a real world scenario, most users will have more complex business logic. For more information on how to construct process flows and use the supported object types, see the iWay Designer User's Guide.
Your next step is to add a new route to the Registry of the iWay Service Manager Administration Console and associate the process flow with it.
This section describes how to create and test a process flow for the Samba Read agent using iWay Designer.
To test the Samba Read agent for a read operation from a Samba drive:
To view a list of parameters that are required to configure the Samba Read agent, see Samba Read Agent Configuration Parameters.
On successful execution, the success edge is returned. For an error condition such as an invalid file path, the failure edge is returned.
The Samba Read agent can be used in conjunction with a File listener to embed file contents (the file picked up by the listener) into the XML file that is read from the Samba drive by specifying a tag. In the case of a process flow, the test document can be used as the enclosing document.
The full file path must be provided for the InputFile property. The document that is read from the Samba drive as specified by the InputFile property is:
<Test>Hello World</Test>
The input file to the process flow (given at runtime) is:
<?xml version="1.0" encoding="ISO-8859-1" ?> <parent><test1>Test By Soumya</test1></parent>
The properties of the Samba Read agent can be specified as shown in the following image.
After running the process flow, the test result is:
<parent>><Test>Hello World</Test><test1>Test By Soumya</test1 </parent>
Parameter |
Description |
---|---|
Input file |
The share name to be read. For example: //SambaDrive/file |
Delete After Read |
If set to true, the file is deleted after a successful read. |
Domain |
DNS name or IP address of the server. |
Port |
TCP open port for the receipt of server requests. |
UserId |
Authorized user on the share. |
Password |
Password for the authorized user on the share. |
Format |
File format to be transferred. |
Tag |
Name of the XML tag to wrap the data read in. Required if data is flat. |
Character Set Encoding of the read document |
Character set encoding of the document to be read. |
Embed |
Determines whether to embed the data from the read operation into the input document. |
Base64 Encode |
Base64 encode the read in document when embedding. |
Parent Tag |
Determines the location in the input document where the input data should be embedded. |
This section describes how to create and test a process flow for the Samba Emit agent using iWay Designer.
To test the Samba Emit agent for an emit operation to a Samba drive:
To view a list of parameters that are required to configure the Samba Emit agent, see Samba Emit Agent Configuration Parameters.
Leave the Source field blank
If the Samba emit is successful, the emitSample.xml file is generated for the destination directory containing the contents of <test/>.
If the Return field was set to input, the input document, <test/> will be returned by the stream in the process flow.
This section describes the behavior of the Samba Emit agent for a Status return type.
You can use the same process flow as explained in How to Test the Samba Emit Agent for an Emit Operation to a Samba Drive. In this example, the file that will be emitted is emit.xml.
The emit.xml file is generated under the Samba drive that is specified for the Destination field.
The following output is obtained at the end of the stream.
<?xml version="1.0" encoding="UTF-8" ?> - <emitstatus status="0"> <protocol>Samba</protocol> - <parms> <parm name="nopreemit">false</parm> <parm name="b64">false</parm> <parm name="uncpathin">\\SoumyaPC\softwares\testSmaba\file_out</parm> <parm name="pattern">emit.xml</parm> <parm name="userid">sr12231</parm> <parm name="return">status</parm> <parm name="password">***</parm> </parms> <timestamp>2009-01-23T17:54:37.755Z</timestamp> <status>0</status> <count>1</count> <name>smb://sr12231:*******@SoumyaPC/softwares/testSmaba/file_out/ </name> </emitstatus>
To check the Samba Emit agent for a status (return) code and branch accordingly:
In the following example, a Decision Test object is added to the result of the Samba Emit agent. If a success condition is returned, a database operation is performed. If an error condition is returned, an email is sent to the user to inform them of the error.
XPATH (/emitstatus/@status) equals 0 (indicating success).
A status code other than 0 indicates an error condition and is routed to the SendEmail object.
As a test, run the process flow and provide an incorrect password when connecting to the Samba drive. The SendEmail object will be reached because a failure edge is returned. The status code is 1.
Parameter |
Description |
---|---|
Source of Data |
Specify a data source location using XPATH() or any other function for the source of data to write. If omitted, the input document will be used by default. |
Destination |
The share name to be written to. For example: //SambaDrive/file |
Domain |
DNS name or IP address of the server. |
Port |
TCP open port for the receipt of server requests. |
UserId |
Authorized user on the share. |
Password |
Password for the authorized user on the share. |
File Pattern |
The output file name which can contain wildcard characters. |
Avoid Preemitter |
If set to true, the preemitter is avoided. |
Return |
Select one of the following options:
|
This section describes how to create and test a process flow for the Samba Ops agent using iWay Designer.
The Samba Ops agent can perform various operations on files in the Samba drive. The size operation returns the size (value) of the file that is acquired from the Samba location specified by the agent.
To test the Samba Ops agent for a size operation:
To view a list of parameters that are required to configure the Samba Ops agent, see Samba Ops Agent Configuration Parameters.
The output is shown in the following image.
The prepend operation refers to prepending the contents of the file specified by the From File property to the file specified by the To File property. The resulting file is stored in To File. The full file path must be specified for both the From File and To File fields. For example:
'\\SoumyaPC\softwares\testSamba\file_in\in.xml'.
Create a new Service object for the Samba Ops agent by setting the properties as shown in the following image.
The content of From File is:
<test/>
The content of To File is:
<parent><test1>Hello World</test1></parent>
The To File content is modified as:
<test/> <parent><test1>Hello World</test1></parent>
Parameter |
Description |
---|---|
From File |
UNC directory path where input messages are received. |
Domain |
DNS name or IP address of the server. |
Port |
TCP open port for the receipt of server requests. |
UserID |
Authorized user on the share. |
Password |
Password for the authorized user on the share. |
To File |
UNC directory path where output messages are placed. |
Domain |
DNS name (or IP address) of the server to which you want to connect. |
Port |
TCP open port for the receipt of server requests. |
UserID |
Authorized user on the share. |
Password |
Password for the authorized user on the share. |
Size |
Special register that is designated to hold the size value. This parameter is required only if you are configuring the Size operation. This field must be left blank for all other operations. |
Out Document |
Document returned by operation (bad input defaults to result). |
Action on Failure |
Indicates whether the input document or the status document would be returned on failure. |
Retry |
Number of attempts to retry. |
iWay Software |