Configuring Process Flows Using the Samba Agent

In this section:

How to:

This section describes how to configure process flows using the Samba agent in iWay Designer.


Top of page

x
Procedure: How to Create an iWay Designer Project and Start the Process Flow
  1. From the Windows Start menu select Programs, iWay 6.0 SM, tools, and then iWay Designer.
  2. Connect to the repository from which you want to work, for example, iWay.
  3. Right-click the repository node and select New Project from the drop-down list.

    The Designer Project Information dialog box opens.

  4. In the Name field, type SambaAgent as the project name.
  5. Click Next.

    The Designer Project Bindings dialog box opens.

  6. To create the project in the iWay Registry, select iWay Registry and click Finish.

    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).

  7. To save the project to the repository, right-click the project node and select Save from the drop-down list.
  8. Expand the SambaAgent project node to expose the project elements (Processes, Services, Transforms, and so on).
  9. Right-click the Processes folder and select New Process from the drop-down list.

    The iWay Process Configuration dialog box opens.

  10. In the Name field, type SambaPflow as the process flow name.
  11. Click Finish.

    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.


Top of page

x
Procedure: How to Add a Samba Agent Service Object

To add a Samba agent Service object:

  1. Drag and drop the Service object icon from the toolbar to the workspace.

    The Service Name and Description dialog box opens.

  2. In the Name field, type a new name for this Service object, and leave the default value (Service object) in the Description field.
  3. Click Next.

    The Service Type dialog box opens.

  4. Select Class Name and enter one of the following class names (depending on which Samba agent you want to use).
  5. Click Next.

    The Define Service dialog box opens.

  6. Select the Define Service Globally check box.
  7. Click Finish.

    The new Service object appears in the workspace.

    Now you need to connect the Start object to the Service object.

  8. Select the Start object, right-click the Service object, and select Build Relation from the context menu.

    The Line Configuration dialog box opens.

  9. From the Event drop-down list, select OnCompletion and click OK.

    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.


Top of page

x
Procedure: How to Add an End Object for the Samba Agent Service Object

All processing paths must terminate with an End object.

  1. Drag and drop the End object icon from the toolbar to the workspace.

    The End Name and Description dialog box opens.

  2. In the Name field, type a new name for this End object, and leave the default value (End object) in the Description field.
  3. Click Next.

    The End Name Schema dialog box opens.

  4. Since no schemas are used in this processing path (that is, the process flow will not be exposed as a Web service), from the Schema drop-down list, select None.
  5. Click Next.

    The Properties dialog box opens.

  6. Click Finish to accept the default values and close the dialog box.

    The new End object appears in the workspace.

  7. Select the Service object, right-click the End object, and select Build Relation from the context menu.

    The Line Configuration dialog box opens.

  8. From the Event drop-down list, select OnSuccess and click OK.

    This option indicates that the path will be followed if there is a normal completion.

    You can reposition the objects as desired.

  9. To save the process flow, right-click the SambaPflow node and select Save from the drop-down list.

    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.

  10. Close iWay Designer.

    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.


Top of page

x
Samba Read Agent Examples

This section describes how to create and test a process flow for the Samba Read agent using iWay Designer.



x
Procedure: How to Test the Samba Read Agent for a Read Operation from a Samba Drive

To test the Samba Read agent for a read operation from a Samba drive:

  1. Create a new Service object for the Samba Read agent by setting the properties as shown in the following image.

    To view a list of parameters that are required to configure the Samba Read agent, see Samba Read Agent Configuration Parameters.

  2. Click OK.
  3. Enter a name and an optional description, and click Finish.

    On successful execution, the success edge is returned. For an error condition such as an invalid file path, the failure edge is returned.



x
Testing the Samba Read Agent for Embedding File Contents Along With a Read Operation

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>
               


x
Reference: Samba Read Agent Configuration Parameters

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.



x
Samba Emit Agent Examples

This section describes how to create and test a process flow for the Samba Emit agent using iWay Designer.



x
Procedure: How to Test the Samba Emit Agent for an Emit Operation to a Samba Drive

To test the Samba Emit agent for an emit operation to a Samba drive:

  1. Create a new Service object for the Samba Emit agent by setting the properties as shown in the following image.

    To view a list of parameters that are required to configure the Samba Emit agent, see Samba Emit Agent Configuration Parameters.

  2. In the Destination field, enter the path to the file directory (do not include the file name).

    Leave the Source field blank

  3. In the File Pattern field, enter the name of the output file name.
  4. Publish and run the process flow. Specify the input document as <test/> (default).

    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.



x
Testing the Samba Emit Agent for a Status Return

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.

  1. Right-click the Samba Emit agent Service object and select Properties from the context menu.
  2. From the Return drop-down list, select status.
  3. Run the process flow.

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>


x
Testing the Samba Emit Agent for a Status (Return) Code

To check the Samba Emit agent for a status (return) code and branch accordingly:

  1. Create a new process flow.
  2. Add a control to check for the status code and to 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.

  3. Check the status code by using an XPATH function in the Decision Test object.
  4. Provide the following condition:
    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.



x
Reference: Samba Emit Agent Configuration Parameters

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:

  • status

    The standard status document represented in tree format.

  • input

    The input document.



x
Samba Operations (Ops) Agent Examples

This section describes how to create and test a process flow for the Samba Ops agent using iWay Designer.



x
Procedure: How to Test the Samba Ops Agent for a Size Operation

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:

  1. Create a new Service object for the Samba Ops agent by setting the properties as shown in the following image.

    To view a list of parameters that are required to configure the Samba Ops agent, see Samba Ops Agent Configuration Parameters.

  2. Add a Decision Test object by setting the properties as shown in the following image.

  3. Test the process flow for the size operation:
    1. Under From File, assign the file as having a size less than 5 KB.

      The output is shown in the following image.

    2. Under From File, assign the file as having a size greater than 5 KB. The Test Result in this case will be True and the success edge is returned.

Top of page

x
Testing the Samba Ops Agent for a Prepend Operation

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>

Top of page

x
Reference: Samba Ops Agent Configuration Parameters

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