eiConsole v.24R1
Tutorial & Working Directory
eiConsole Tutorial – Topology
Splitting Attachment Data (Forking)
Note: The Quick Start and Foundation tutorials should be completed before proceeding with the Topology Tutorials.
Overview
This interface demonstrates how to perform content forking; if you have a transaction with multiple “attachments” or a single incoming data stream representing multiple outgoing streams, this is the function you need to perform. In addition, this interface demonstrates how to use the eiConsole to separate a single data stream into multiple data streams – each based on a subset of the original stream’s contents for independent handling and processing.
Transaction Splitting May Be Used When:
- An incoming transaction contains multiple data payloads
- An incoming transaction needs to have different components processed separately
Core Concepts
- Forking
- XPath
How to Run This Example
You may run this from the eiConsole Testing mode at any point in the process prior to the routing module itself, using the attached document input-sample.xml.
How it Works
The forking module is configured in the Source format.
When viewing the forking configuration, you will notice an XPath expression and namespaces; the namespaces define prefixes for the XPath configuration. The XPath defines which elements from the original sample file will be output.
For each node evaluated by the XPath expression, a transaction is generated and passed downstream to the directory Transport.
Before You Begin
Download the Splitting-Attachment-Data-Forking-Working-Directory.zip file with the sample Working Directory and unzip it on your computer to a convenient place. In our case, it’s c:\Users\{USER _NAME}\PilotFish eiConsole Working Directories\Splitting Attachment Data (Forking) where {USER_NAME} is the user’s name.
Open the eiConsole, browse to the Splitting Attachment Data (Forking) folder icon, and open it. The fully configured route (Splitting Attachment from Data) is included in the working directory. Your Route File Management screen will open as shown below.
Double-click on the Splitting Attachment from Data route.
This interface has three functioning pieces: the Listener (the Listener stage), the Listener Transformation forking (the Source Transform stage), and the Transport (the Transport stage).
Listener Configuration
The Listener polls a directory set. As in the previous tutorials, we use the relative path to our directory ..\..\in. The absolute path is c:\Users\{USER _NAME}\PilotFish eiConsole Working Directories\Splitting Attachment Data (Forking)\in.
The sample file intended to be used with this interface is provided alongside this instructional guide. It is input-sample.xml. You can find it in the c:\Users\{USER _NAME}\PilotFish eiConsole Working Directories\Splitting Attachment Data (Forking)\data folder.
Transport Configuration
The Transport uses a directory that is set here. Similar to the Listener, we use a relative path ..\..\out. This means the already created folder is in our Working Directory c:\Users\{USER _NAME}\PilotFish eiConsole Working Directories\Splitting Attachment Data (Forking)\out.
Forking Configuration
When viewing the Transaction Forking Configuration dialog box, you will notice an XPath expression and namespaces; the namespaces define prefixes for the XPath configuration. The XPath defines which elements from the original sample file will be output.
In our case, the forking configuration uses a simple XPath-based rule, which searches the document for all available Attachment” objects, and creates new transactions out of them.
Below is our sample transaction (this is in the input-sample.xml file) :
- <?xml version=“1.0” encoding=“UTF-8”?>
- <ns2:AttachmentGroup xmlns:ns2=“Sample2.Namespace” Id=“2.000003590486”>
- <ns2:Locale/>
- <ns2:CreatedDate>2012-07-18</ns2:CreatedDate>
- <ns2:LastModifiedDate/>
- <ns2:LifeCycleId/>
- <ns2:Attachments>
- <ns2:Attachment Id=“1”>
- <ns2:CreatedDate>2012-07-18</ns2:CreatedDate>
- <ns2:LastModifiedDate/>
- <ns2:LifeCycleId/>
- <ns2:Mime>Text/XML</ns2:Mime>
- <ns2:AttachmentData>VEhJUyBJUyBBIFRFU1QgVEVYVCBTQU1QTEU=</ns2:AttachmentData>
- <ns2:AttachmentReason>Order</ns2:AttachmentReason>
- </ns2:Attachment>
- <ns2:Attachment Id=“2”>
- <ns2:CreatedDate>2012-07-18</ns2:CreatedDate>
- <ns2:LastModifiedDate/>
- <ns2:LifeCycleId/>
- <ns2:Mime>Text/XML</ns2:Mime>
- <ns2:AttachmentData>VEhJUyBJUyBBTFNPIEEgU0FNUExFIFRFWFQgQVRUQUNITUVOVA==</ns2:AttachmentData>
- <ns2:AttachmentReason>Order</ns2:AttachmentReason>
- </ns2:Attachment>
- <ns2:Attachment Id=“3”>
- <ns2:CreatedDate>2012-07-18</ns2:CreatedDate>
- <ns2:LastModifiedDate/>
- <ns2:LifeCycleId/>
- <ns2:Mime>Text/XML</ns2:Mime>
- <ns2:AttachmentData>VEhJUyBJUyBXSUsgV0lLIEEgU0FNUExFIFRFWFQgQVRUQUNITUVOVA==</ns2:AttachmentData>
- <ns2:AttachmentReason>Order</ns2:AttachmentReason>
- </ns2:Attachment>
- </ns2:Attachments>
- </ns2:AttachmentGroup>
There are 3 attachments here, so when this is executed in the Testing Mode, we should see 3 outputs; verify this by running this transaction in Testing Mode. In order to go into Testing Mode, click Mode on the main menu and then click Testing Mode in the drop-down list.
Once in Testing Mode, place the input-sample.xml file found in ..\Splitting Attachment Data (Forking)\data into ..\Splitting Attachment Data (Forking)\in directory. All the question marks are replaced by green checkmarks.
Check each attachment by clicking Testing Results and then clicking the View Stage Output button.
Output Files
A transaction is generated and passed downstream to the directory Transport for each node evaluated by the XPath expression.
We use the input-sample file name and the xml extension for the output of this Transport. Note that because we have 3 incoming transactions that will share this information, the output file name will have a number appended to the end, subsequent to the first file output.
This concludes the demonstration of content-based data forking in PilotFish’s eiConsole.