Skip to main content
Skip table of contents

Splitter - For each processing

Objective

To demonstrate the capability of XMLSplitter component which takes in XML input from an input device and splits it into multiple parts based on the provided XPath and changing the pattern of output by using a Group operation.

Prerequisites

  • Start Fiorano Enterprise Server (FES) and Fiorano Peer Server (FPS)
  • Login to eStudio application
  • Understand the basic menus and perspectives (panels) in eStudio application

Scenario

  1. Create an Event Process with two XMLSplitter components and configure these with Split and Group operations.
  2. Connect Feeder and Display components on both XMLSplitter components separately.
  3. Send message using each Feeder component to demonstrate the difference in output that appears in the Display components

Components used

How it Works

XMLSplitter performs the following two types of operations using Xpath:

  1. Split: Splits the input XMLs at XPath defined and sends out multiple XMLs, each XML containing one element defined at XPath.
  2. Group: Splits the input XML at the element whose XPath is specified by the property XPath and then regroups the split XMLs which have the same value for that element into a single message based on the property Select Path.

Setting up the Example

Configuring XMLSplitter component for Split operation

To configure XMLSplitter component, perform the following action in eStudio:

  1. Add a new Event Process with name 'XMLSplitter_Example'.
  2. Drag the XMLSplitter component from MOMs category in the Micro Service Palette to the Fiorano Orchestrator.


    Figure 1: Adding XMLSplitter component to Fiorano Orchestrator
     
  3. Click the XMLSplitter component and do any of the following to rename the component from 'XMLSplitter' to 'XMLSplitter_Split':
    1. Press F2, change the name and click OK.


      Figure 2: Renaming using Keyboard action 'F2'
       
    2. Go to Name property under General tab in Properties, change the name and press ENTER.


      Figure 3: Renaming using General Properties

    Change in name is to distinguish it from the XMPLSplitter component that will be configured for Group operation.

  4. Double-click the XMLSplitter_Split component in the Orchestrator to open Configuration Property Sheet (CPS).


    Figure 4: XMLSplitter CPS
     

  5. In the Interaction Configurations section, select Schema option under Attributes and perform the following actions:
    1. Click the Ellipsis

      button that appears on the Schema row in Configuration dialog box and paste a valid schema in the Schema editor. Then click the Ellipsis
      button present in the bottom-right part of the Schema panel to open Root Element dialog box.

      Use this Schema for the present example.

      <?xml version="1.0" encoding="UTF-8"?>

      <xsd:schema xmlns="http://www.fiorano.com/fesb/activity/Text2XML1"

        xmlns:xsd="http://www.w3.org/2001/XMLSchema" elementFormDefault="qualified"

        targetNamespace="http://www.fiorano.com/fesb/activity/Text2XML1">

         <xsd:element name="MovieSchema">

            <xsd:complexType>

               <xsd:sequence>

                  <xsd:element minOccurs="0" maxOccurs="unbounded" name="client">

                     <xsd:complexType>

                        <xsd:sequence>

                           <xsd:element name="customer_name" type="xsd:string"/>

                           <xsd:element name="movie_name" type="xsd:string"/>

                           <xsd:element name="show_timings" type="xsd:string"/>

                           <xsd:element name="clients_email_id" type="xsd:string"/>

                        </xsd:sequence>

                     </xsd:complexType>

                  </xsd:element>

               </xsd:sequence>

            </xsd:complexType>

         </xsd:element>

      </xsd:schema>


      Figure 5: Navigating to Root element after pasting Schema
       

    2. In the Root Element dialog box, select 'MovieSchema' and click OK. The root element will appear within Select Root Element brackets present next to the Ellipsis
      button. Click OK in Schema editor.


      Figure 6: Selecting Root Element
       
    3. As Schema section lists all the namespace prefixes used by XML schema, leave Namespaces section without any changes.
  6. Click XPath Ellpsis
    button and perform the following actions in the XPath dialog box:
    1. Select and delete the default Schema present in the editor.
    2. Drag the client part under MovieSchema tree from the left panel to the editor and click OK.


      Figure 7: Selecting XPath for XMLSplitter_Split
       
  7. Retain the Operation value as 'Split' itself, click Next twice and then click Finish.

Configuring XMLSplitter component for Group operation

To configure XMLSplitter component for Group operation, follow the same steps as in "Configuring XMLSplitter component for Group operation" section, change the component name to 'XMLSplitter_Group' (as in Step#2) and perform the following actions in Step#6 (setting XPath):

  1. Click XPath Ellpsis
    button and perform the following actions in the XPath dialog box:
    1. Select and delete the default Schema present in the editor.
    2. Drag the customer_name part under MovieSchema tree from the left panel to the editor, and click OK.


      Figure 8: Selecting XPath for XMLSplitter_Group
       
  2. Select the Operation value 'Group'. Select Path attribute appears.
  3. Click Select Path Ellpsis
    button, delete the default value and drag client to the editor, and then click OK.
    This helps to club the content with same 'customer_name' present under 'client' to consider as one message in the entire data that is sent.
  4. Click Next twice and then click Finish.

Composing the Event Process

To work with the XMLSplitter components, compose the Event Process by performing the below actions:

  1. Drag two Feeder components and two Display components from Util category in the Micro Service Palette to the xmlSplitter_Example Fiorano Orchestrator.
  2. Change the names as follows to differentiate from one another:
    1. Feeder1 to 'Feeder_Split'
    2. Display1 to 'Display_Split'
    3. Feeder2 to 'Feeder_Group'
    4. Display2 to 'Display_Group'
  3. Connect the components in following order:
    1. Feeder_Split component output port to XMLSplitter_Split component input port and connect the XMLSplitter_Split component output port to Display_Split component input port.
    2. Feeder_Group component output port to XMLSplitter_Group component input port and connect the XMLSplitter_Group component output port to Display_Group component input port.


Figure 9: xmlSplitter_Example event process with all the components connected

Configuring Feeder component

To configure the Feeder components, perform the following actions:

  1. Double-click Feeder_Split component and perform the following actions to configure it:
    1. In the Message Type Configuration page, retain Output Message Format option as 'XML' and click the Connected Port Schemas button.
    2. In the Connected ports dialog box, select IN_PORT to enable connection between output port of Feeder_Split and input port of XMLSplitter_Split component. Click OK and then click Next.


      Figure 10: Connecting port schemas
       
    3. In the Message Details Configuration page, click the Generate Sample button. Click OK in the XSD Sample Generation Dialog window to load sample input.
      In the XSD Sample Generation Dialog window, as the max value in No.of Repeatable elements to be generated section is '3', 3 messages gets generated in Display
      .


      Figure 11: Generating sample
       
  2. Click Finish to save Feeder_Split configuration.
  3. Perform the same actions mentioned in the above steps to configure Feeder_Group.

Running the Example

To run the example, perform the following actions in the Orchestrator:

  1. Click Check Resource and Connectivity 
    icon (or press ALT+SHIFT+C) to check resource and connectivity.
  2. Click Run Event Process 
    icon (ALT+SHIFT+R) to run the event process. Four windows: Feeder_Split, Display_Split, Feeder_Group and Display_Group get open.
  3. In both Feeder_Split and Feeder_Group, rename customer_name on all three occurrences as explained below:
    1. first and second names to 'customer_name_1'
    2. third to 'customer_name_3'.

    Two of the names have to be the same to test grouping; you may use your preferred names different from those used in this example.

  4. In Feeder_Split, click Send.


    Figure 12: Changing customer_name in Feeder_Split and sending the message
     
  5. Three messages appear in Display_Split window.


    Figure 13: Three messages appearing in Display_Split
     
  6. In Feeder_Group, click Send.


    Figure 14: Changing customer_name in Feeder_Group and sending the message
     
  7. In Display_Group, only two messages appear, because the first and second client entries are grouped by the same customer_name, that is, the clients with  "customer_name_1" as customer_name are grouped.


    Figure 15: Data with the same customer_name clubbed into one message

Reference


JavaScript errors detected

Please note, these errors can depend on your browser setup.

If this problem persists, please contact our support.