Decorator Application

The Decorator application type provides the ability to use the same process interface or application (e.g. a Message Transformation, Email or Script application) with different parameter presets.

For example it allows to create services only taking a Business Object and a Date as input parameters in the Model & Go! perspective.

To create a Decorator application you have to add the following settings:

The Decorator application takes the set of input parameters of the original application or process interface reduced by the predefined values as input parameters.

Configuring the Decorator Application

The Configuration tab allows to select an application or process interface from a target model.


Figure: Decorator Application Configuration

Setting Default Values for Input Mappings

The Default Values tab displays a list of primitive input parameters of the application or process interface, which was selected in the Configuration tab.

It allows to enter predefined values for the primitive input parameters. The parameters having predefined values will be excluded from the resulting application input parameters.


Figure: Decorator Application Default Values

Examples

The following examples demonstrate different use cases of the Decorator application.

Decorator Application Example

The following example shows how to decorate a Message Transformation application. These are the main steps to follow:

  1. Create a model having a Message Transformation application
  2. The application has two input parameters (firstName and lastName) and an output parameter (response). All are of type primitive.


    Figure: Application parameters

  3. The target message of the application adds the following mapping to the response parameter:
    "Hello "+firstName+" "+lastName;

    MTA configuration
    Figure: Message Transformation Application Configuration

  4. In another model create a Decorator application decorating the Message Transformation application.
  5. Open the Configuration tab in the Decorator application property panel. Select the previous model and the target Message Transformation application.
  6. Switch to the Default Values tab and define a default value for the firstName input parameter (i.e. John).

    Default Value
    Figure: Decorator Application - default value

  7. Since firstName already has a default value, we only pass the lastName parameter via a data LastName as shown in the screenshot below.

    Process with Decorator Application
    Figure: Process with Decorator Application

  8. At runtime, enter a value for data LastName (i.e. Major)


    Figure: Decorator Application - runtime data entry

  9. The decorator application will be invoked using the default value for firstName (John) and the entered lastName (Major). The output is as below:


    Figure: Decorator Application - runtime output

E-mail Application Example

The following example shows how to decorate an E-mail application. These are the main steps to follow:

  1. Create a model with an E-mail Send/Receive application
  2. The E-mail application has the following default input parameters:

    Default input parameters
    Figure: Default input parameters

  3. In another model create a Decorator application decorating the E-mail application.
  4. Open the Configuration tab in the Decorator application property panel. Select the model containing the E-mail application and the E-mail application accordingly.
  5. Switch to the Default Values tab and define default values for the input parameters from, cc and subject.

    Enter predefined values
    Figure: Enter predefined values

  6. Since sender and subject are defined as default values, we only have to pass the recipient parameter, e.g. via a data Recipient as shown in the screenshot below.

    Process with Decorator Application
    Figure: Process with Decorator Application

  7. At runtime we only have to enter a recipient for the E-mail application. The e-mail will then be sent to this recipient from the predefined sender with the predefined subject. A copy will be sent to the predefined carbon copy recipient.

Process Interface Decorator Example

The following example shows how to decorate a process interface. These are the main steps to follow:

  1. Create a Provider model having an interface with three primitive parameters.


    Figure: Process Interface

  2. Create a model with a process implementing the above process interface.


    Figure: Process Interface Implementation

  3. The process has a Message Transformation application with the following mapping to the response parameter:
    "Hello "+firstName+" "+lastName;


    Figure: Application Configuration

  4. Data FirstName and LastName are mapped to the input parameters and output parameter response maps to data Response.

    Implementing process
    Figure: Implementing Process

  5. Create another model, with a Decorator application templating the process interface.
  6. In the Decorator application, select the previous model and the target process interface.


    Figure: Process Interface decorator

  7. In the Default Values tab, enter a predefined value for the firstName input parameter (i.e. Peter)


    Figure: Interface Decorator Application Mapping

  8. Since parameter firstName has a predefined value, we only need to pass parameter lastName, e.g. via a data LastName, as displayed in the screenshot below.


    Figure: Model with Decorator Application

  9. At runtime, the decorator process interface will be invoked using the predefined value for parameter firstName (Peter) and the value entered for data LastName (i.e. Smith).

    Runtime output
    Figure: Runtime output for Decorator Application example