Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

Questions:

  • In the sections up front that describe each part of the toolbox, do we now need
    • Processing Tasks section that describes processing task icons such as MessageRouter? When do the Processing Tasks options appear?  
    • Objects section that describes objuects such as Router's Choice? When do the Objects options appear?  
    • Ditto Router's Lib, Translator's Lib sections of Toolbox
  • Is router_translator a new type of translator Activity in the Toolbox? Does a new icon need to be added to the Activities page that describes toolbox options? 

This article describes how you can build Message Center Editor-style routing inside a single IWS translator. This kind of routing allows you to route different messages to different translators based on conditions derived from incoming data fields.

To define MCE-style routing in IWS translator:

...

The router's main function is to look at the incoming message (one of the many messages which comes in the data file) and, based on values in this message, route it to one translator or another. For example, a BUY trade may need a different treatment than a SELL. And you may need yet another mapping for CANCELs.

In this example, you create multiple translators (although they are just dummies) and you add router choices. The router choices are essentially just expressions, based on which a specific message goes to one translator or another.

On this page

Table of Contents

Create a Simple Workflow

You can create a simple workflow with a Begin shape, Task Translator shape, and End shape. In this example, you create a solution that is not based on an existing template.

Open IWS and create a simple solution by dragging a Begin shape, a Task Translator shape, and an End shape from the toolbox onto the worksheet.

Workflow with Begin, Task Translator, and End ShapesImage Added

When you drop the Task Translator shape onto worksheet, it becomes an empty "shell" of the translator, This is fine if you are just building a sketch of your future workflow, But eventually you need to provide the details, such as how the messages will be routed inside the translator, and how they will be mapped from the incoming format to the outgoing format. 

Provide Task Translator Details

When you drop the Task Translator shape onto worksheet, it becomes an empty "shell" of the translator, This is fine if you are just building a sketch of your future workflow, But eventually you need to provide the details, such as how the messages will be routed inside the translator, and how it will be mapped from the incoming format to the outgoing format. 

To provide those details: 

  1. Double-click the Task Translator shape, task_translator. 
    You see the Add task box.
  2. In the Name box, enter the name of the translator, and then click OK.
    Add Task boxImage AddedYou see the Select parameters box. In the Select Parameters box, you provide information about incoming and outgoing data formats.
  3. In this example, it is sufficient to select  Delimited File for delimited (CSV) on both the Source Format andDestination Format tabs, and click Apply. 
    (Do not worry about adding other details for the purpose of this example).
    Select Parameters boxImage Added

    After you click the Apply button (and ok the warning about deprecated classic mode), the system finally creates your translator, Right away, the system opens the translator tab, where you see the routing diagram with the MessageRouter shape, identified with a red box in the following figure. Notice that the Processing Tasks options are now available in the Toolbox pane.
    Translator tabImage Added

    The next time you double-click the Task Translator shape in the diagram (the shape with the gears), you see this translator tab immediately. You perform the creation/initialization part of the setup just once. The content of the toolbox is different, because you are now in the "second level" of design – inside the task_translator.


    There is also a "third level" of design. You can double-click the router (MessageRouter shape in red box in the previous figure). When you do so, you see the Router's Choice option in the Objects toolbox.
    Router's Choice optionImage Added

    Alternately, you can double-click the translator (MessageTranslator shape #4 in the prior figure) to define the mapping, which is also at the third level of design. 

Define Routing Expressions and Mappings

After you create the translator, you can define routing expressions and mappings.

Tip

When you define routing expressions and mappings in more granular level tabs and save them, the system does not automatically refresh the diagram shown in the higher level router_translator tab. You must refresh the router_translator tab information manually to reflect your most recent changes by clickingImage Added Apply settings from the router worksheet button on the worksheet.

To define routing expressions and mappings:

  1. Double-click the router translator shape to add and manage routing expressions.Router Translator TasksImage Added
    You see the "third level" of design. 
  2. In the Objects toolbox, drag one or more Router's Choice elements onto the worksheet
    The router's choice is a shape which holds the condition (expression). Based on that condition, a specific message is routed to one translator or another. There is a default choice as well. The system uses the default choice if none of the provided conditions are met, that is, if none were evaluated to true.
  3. Populate an expression for the router and

...

  1. enter a value for the Description property, which is an info label visible in the router translator

...

  1. . 
    For ease of mapping, you can also add the Source grid to the worksheet, but it is not necessary.

...

  1. Set Up Router's Choice ElementsImage Modified
  2. Click the router_translator tab and then clickImage Modified Apply settings from the router worksheet button below the router block to refresh the worksheet.
    The canvas expands to show you the newly added router's choices

...

  1. .

...


  1. View Router's ChoicesImage Modified
  2. In the Processing Tasks toolbox, drag two Message Translator tasks and drop them to the right of each router choice, Then connect the elements. 
    In the following example, Translator1 and Translator2 are currently just empty shapes.
    Create Translator1 and Translator2 ShapesImage Modified
  3. Double-click the Translator1 and Translator2 shapes and define the mapping for each one.
    Define Translator1 and Translator2 MappingsImage Modified
    By default, outbound rules group incoming data.
  4. To avoid that situation, and to have line-by-line routing instead, click the router_translator tab, and then click Properties.
  5. Clear the Enable Grouping check box in the router translator's Worksheet Properties dialog box.
    Worksheet Properties Box - Enable Grouping check boxImage Modified
  6. Click Publish.
    In the Publish Solution preview screen, you can now see that the stream contains additional translators, and there are appropriate mapping expressions in the rsf file.
    Publish Solution windowImage Modified