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 should 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.

Decorating a Message Transformation Application

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

  1. Create a model having a Transformation application
  2. Create primitive type data named firstName, lastName and response.
  3. Specify firstName and lastName as two input parameters and response as output parameter in the Message Transformation application.


    Figure: Application parameters

  4. In the target message of the application, add the following mapping to the response parameter:
    "Hello "+firstName+" "+lastName;

    MTA configuration
    Figure: Message Transformation Application Configuration

  5. Deploy the model.
  6. In another model, create a Decorator application to decorate the Message Transformation application.
  7. Open the Configuration tab in the Decorator application property panel. Select the previous model and the target Message Transformation application.
  8. 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

  9. 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

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


    Figure: Decorator Application - runtime data entry

  11. 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

Decorating an E-mail Application

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 should 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 should 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.

Decorating a Process Interface

The following example shows how to decorate a process interface. In this example, create a model which provides process interface and an application. In the second model, you should implement the process interface and in the third model, you need to create a decorator application which decorates the process interface. To start with:

  1. Create a model named MTAProvider
  2. Create primitive type data named firstname, lastname and response.
  3. Create Transformation application with following parameters.
  4. Specify firstname and lastname as two input parameters and response as output parameter in the Message Transformation application.


    Figure: Application parameters

  5. In the target message of the application, add the following mapping to the response parameter:
    "Hello "+firstName+" "+lastName;

    MTA configuration
    Figure: Message Transformation Application Configuration

  6. Create a process named MTA as shown in the following screenshot:

    MTA Process
    Figure: MTA Process

  7. Define a process interface of the MTA process as shown in the following screenshot:

    MTA Process
    Figure: Provides Process Interface

  8. Deploy the model.
  9. Create a second model named ImplementMTA
  10. Create a process named ImplementingProcess as shown in the following screenshot:


    Figure: Implementing Process

  11. In the Process Interface properties, select the Implement Process Interface and the MTA process as shown in the following screenshot:


    Figure: Implements Process Interface

  12. Deploy the model.
  13. Create a third model named DecoProcessInterface
  14. Create a decorator application
  15. In the Configuration tab, select ImplementMTA from the Model drop-down list.
  16. Select ImplementingProcess from the Application/Process Interface drop-down list.


    Figure: Decorator Application - Configuration tab

  17. In the Default Values tab, specify default value for the firstname mapping.


    Figure: Decorator Application - Default Value tab

  18. Create a process named DecoAppProcess. Since parameter firstname has a predefined value, we only need to pass parameter lastname. For example, via a data lastname, as displayed in the screenshot:


    Figure: DecoAppProcess

  19. Deploy the model.
  20. In the Workflow execution perspective, start the DecoAppProcess.
  21. Specify the Lastname as Parker.


    Figure: Last Name

  22. At runtime, the decorator process interface is invoked using the predefined value for parameter firstname (Peter) and the value entered for data lastname that is Parker.


    Figure: Decorator Application Output