There are times when a target Event Port needs information that was produced by a service instance that occurred earlier in the workflow. Consider an event process representing a ten-step business process. In these ten steps, each step is implemented using a service instance. By using application context, a service instance representing the tenth step in the process can use the information generated by the service instance in the second step.

The Application Context is set as a JMS Message Property on the message and is available throughout the function, which can be used anywhere in the event process using an Xslt component or using Route Transformation.

Defining Application Context

To define Application Context for an application, perform the steps below:

  1. In the Event Process project, click in the Orchestration Editor and open the Properties view.
  2. Click the Application Context tab in the Properties view and enable the Application Context option.
  3. Enable Application Context checkbox and select the DTD or XSD option to choose the schema type.
    1. XSD schema type: Click the Edit Schema button, provide the schema content in the editor that is displayed and click the Ellipsis button to select the root from the list of Root elements.

      Icon

      Click Load to import a schema that is already saved at a location.


      Figure 1: Application Context properties with XSD selected

    2. DTD schema type: Click the Edit Schema button, provide the schema content in the editor that is displayed and Click OK.
      Select the root from the Root attribute in the Application Context properties.


      Figure 2: Application Context properties with DTD selected

    This defines application context schema for the Event Process.

  4. Provide a name in the Value property to save the Application Context instance defined.

    Icon

    If the value is not provided, it can be defined in the context menu of the Output port of a component or using an Xslt component.


    Icon

    After a value is provided, an empty XML will be present throughout the application unless it is configured at any of the out ports. Once Application Context is configured at an out port, the value is propagated into the message flow.

Setting Route Transformation to map Application Context

After creating the Application Context, configure it to the desired output port from where the value needs to be propagated. To achieve this, set the Route Transformation from the output port.

To configure Route Transformation, perform the actions below:

  1. Right-click the desired output port, go to the Configure Application Context option and select the Mapper Project option to open the Mapper editor.


    Figure 3: Opening Mapper editor

  2. The Mapper editor opens up where the mapping for the Application Context can be defined. Connect the routes as required (from OUT_PORT element to Application-Context element) and save the mappings. The port figure will be shown in bold font to give a visual representation.


    Figure 4: Mapper editor

Once the Application Context is configured at one of the output ports as shown above, the value is propagated in the message flow.

Icon

The application context can be used anywhere in the event process using an Xslt component or using Route Transformation.

Icon

For a better understanding of the Application Context, please refer to the Application Context example.

Adaptavist ThemeBuilder EngineAtlassian Confluence