Log out?

Exercise 2.4 – Creating and Using Custom Attributes

Purpose:

To practice creating custom Transaction Attributes and using them with OGNL


Steps:

  1. Create a Route
    1. From the eiConsole File Management screen, select the “Add Route” button.
    2. In the dialog that appears, enter the name “Custom Attributes” and select “OK”.
    3. The Route should now appear in the table on the screen. Double click it to open it.

    C


  2. Document Source System
    1. Select the “Source System” stage in the “Route Editing Grid”. The configuration panel will appear at the bottom.
    2. Change the “System Name” to “XML File”
    3. Select the “Choose Source Icon” button, and scroll down to select one of the XML icons

    C


  3. Configure the Listener
    1. Select the “Listener” stage in the “Route Editing Grid”. The configuration panel will appear at the bottom.
    2. Select “Directory / File” from the “Listener Type” selection box. Optionally, click the “…” button to open the Module Search Dialog, which provides a faster way to find the module you’re looking for.
    3. Assign a polling directory, using the “…” button to open the file chooser. The polling directory should NOT be the directory with all the sample files, since files will be moved/deleted by the listening process.

    B-C


  4. Set Transaction Attribute With a Processor
    1. Select the “Processor Configuration” tab, next to the already selected “Listener Configuration” tab.
    2. Click the “Add Processor” button in the new configuration panel. The “Add Processor” dialog will appear.
    3. Select the “Transaction Attribute Population” Processor from the “Processor Type” selection box. Optionally, click the “…” button to open the Module Search Dialog, which provides a faster way to find the module you’re looking for.
    4. In the “Transaction Attribute Name” field, write “output.file.name”.
    5. In the “Evaluate Expression” field, write “attribute-output”.

    B

    C

    D-E


  5. Initial Transport Configuration
    1. Select the “Transport” stage in the “Route Editing Grid”. The configuration panel will appear at the bottom.
    2. Select “Directory / File” from the “Transport Type” selection box. Optionally, click the “…” button to open the Module Search Dialog, which provides a faster way to find the module you’re looking for.
    3. Select the “Target Directory”, using the “…” button to open the file chooser.
    4. Set “xml” as the “Target File Extension”.

    B-D


  6. Configure Transport Target File Name with OGNL Expression
    1. For the “Target File Name”, choose the button on the very far right of the field to open the “Enhanced Settings” panel. New buttons and a new text field should appear.
    2. Of the new buttons, one of them has an icon with two overlapping circles on it. This is the “OGNL Expression” button. Select it to open the “OGNL Expression Constructor”.
    3. In the “ONGL Expression Constructor”, scroll down the top panel list to find the “getAttribute(‘INSERT_ATTR_NAME’)” item. Select it, and click the “Insert” button on the far right.
    4. The selected expression is now populated in the text field at the bottom of the dialog.
    5. Select the “INSERT_ATTR_NAME” portion of the expression, and delete it. Make sure the opening and closing ‘ are still present.
    6. Write “output.file.name” in the spot that the deleted text once was. The new expression should now read: “getAttribute(‘output.file.name’)”.
    7. Select the “OK” button at the bottom of the dialog. The “Target File Name” field should now be populated with the “OGNL Expression”.

    B

    C-F

    G


  7. Document the Target System
    1. Select the “Target System” stage in the “Route Editing Grid”. The configuration panel will appear at the bottom.
    2. Change the “System Name” to “XML File”
    3. Select the “Choose Target Icon” button, and scroll down to select one of the XML icons

    C


  8. Prepare to Test
    1. In the menu bar at the top, select “Route” -> “Testing Mode”. Make sure the changes to the Route are saved.
    2. Copy the file called “people.xml” from the “Samples” directory provided into the directory chosen as the polling directory.

    A


  9. Perform the Test
    1. At the top of the “Testing Mode” screen, select the “Execute Test” button.
    2. If the “Route” was configured successfully, all the Stages should light up with green checkmarks.
    3. In the OS File Explorer, open the directory selected as the “Target Directory”. The file “attribute-output.xml” should be there, with contents identical to the “people.xml” input file.

    A-B


  10. Output Files
    1. Compare the results from the exercise with the following example output files to see if they are correct.
      1. attribute-output.xml

This is a unique website which will require a more modern browser to work! Please upgrade today!

Thanks!

Our editors are notified.

Close