Exercise 2

This exercise will implement a basic mapping from a CSV (Comma separated) to a TSV (tab separated) file.

It will use the Transports established in the first Exercise. We will need to setup two messages standards and mapping between them. The sample file we will translate will be the following

HDR,TABLE,3,$99.95

LIN,01,CHAIR,9

LIN,02,TOP,3

LIN,03,LEG,9

This exercise will involve the following steps:

    1. Setup Source Message Standard

    2. Setup Destination Message Standard

    3. Create Partner

    4. Create Event

    5. Create Process Mapping Source and Destination Standards

Setup Source Message Standard

Select the Crossfire Admin module, select the Config tab, select Message Standards and click New.

Enter ‘Your Name Example Two CSV’ as the Name for the Message Standard.

Enter the Entity Name as 'Demo Entity' and select the 'Delimited' Format option. Once that is done click the 'Create New Standard' button

Select the Definition tab.

Right click the top node of the tree and select add new segment. Setup the new Segment as shown in the image below:

The Tag Value is the value that identifies the segment, in this case it is “HDR”.

Add the remaining data elements and segment groups until the standard looks as in the image on the next page.

Note: The Line segment has been configured to allow up to 99 repetitions, where the header only allows one.

Note: Avoid using spaces in data element names, as the data element names are used as the tags in Xml messages.

Click OK, the setup of the Message Standard is complete

Setup Destination Message Standard

Select the Edited tab, and click Copy.

Close the window which is displayed.

In the Work With section, select Message Standards and click Refresh.

A copy of the existing standard has been created. Double click to open this standard.

Change the Name to ‘Your Name Example Two TSV’.

Update the Decimal value in the data element separator to 9. This represents the number for a tab (more examples available at http://www.asciitable.com)

Click OK. The standard has been completed.

We have now created two new Message Standards, we will need to setup a process to map between them, first we need create a Partner and Event for this Process.

A Partner and Event is a way of classifying a Process by the Customer and the action the message performs.

Select Partners, click New and enter a Unique Code and Name for the Partner.

Click OK to save.

You may choose to create a new Event, or use an existing Event. This will depend on the purpose of the Message. Events are primarily used for grouping messages which perform the same actions together.

In this example we will create a new Event call ‘Transport Order’.

Select Events, and click New. Enter a Code and Name for the Event, as in the image below:

Click OK to save.

We are ready to create a Process to translate between these message standards.

Select Processes and click New.

Select the Partner, Event and Message Standard. We will translate from the CSV to the TSV. This is the Source we are creating, so we will select the CSV as the Message Standard.

Click Apply to Save the Process.

Select the Transports tab, then add the Transport we created in Exercise One, by selecting it from the drop down, and clicking Add.

Once the Transport has been added, click on the Transport in the list.

Select or type “Crossfire’ into the System field. Click OK to save the change.

This Tells Crossfire Messaging to pass the message to the Crossfire Engine when it has received it.

Return to the General tab and click the New Destination Mapping button.

Select the TSV Message Standard. Enter a File Name this can be any file name, you can use Variables from within your Message Mapping here.

Click Apply. Select the Mappings tab

On the left is the destination Message Standard.

Select the “Product Name” data element from the destination, ensure ‘Data Element’ is selected as the “Map Using” selection. Click Select.

The source Message Standard is displayed, select the “Product Name” from the source.

Repeat this for the remaining data elements.

When you have completed your mapping, click on the Transports Tab.

Select the Transport we created in Exercise One and click Add

Click OK to any close any open windows.

Go to the Messaging module, then select Transport Routes. Click Refresh, Open the Route created in the first Exercise, select the Edited tab and click Delete.

This will prevent the message from being routed, as it will be passed to the Crossfire Engine for processing instead.

Test

The mapping is completed and is ready to be tested by putting the provided csv text into a csv file and dropping it in your In folder, it should then be moved to your Out folder as a TSV file.