Show TOC

Mapping a Service Operation's Input and OutputLocate this document in the navigation structure

Use

You can define how the data coming from one service operation as input in the service flow has to be mapped (that is, you define what will be its output) in the service flow. You can directly define how the data from one data structure is mapped to another data structure. To do that, you use the mapping's editor of the service operation. In the mapping's editor the source data (that is, the source context) is displayed in the left-hand side tree while the target data structure (that is, the target context) is displayed in the right-hand side tree. You have to drag and drop (that is, map) nodes from the source context to nodes from the target context. Each data mapping represents a specific data transformation.

If you call a composed service operation at runtime, it results in multiple data mapping transformations according to the defined incoming flow connections - one mapping per incoming flow connection. When mapping a service operations input and output, note the following:

  • Data mapping should be explicitly defined for each service operation.

  • Data mapping should be explicitly defined for the operation's output.

  • Each service operation or operation's output can have exactly one data mapping definition.

  • Parallel splits, parallel joins, flow connectors, and the operation's input do not have assigned data mappings.

  • You can directly define static values for a target data structure, if you need to.

  • You can use different functions to be executed during data transformation. You can define your own functions or use built-in functions.

Assigning Static Values to Target Data Elements

For more information about how to assign static data values to a target data element, see the section Assigning Static Values to Target Context Nodes in Data Mapping Rules .

Procedure

Orchestrating Data Mappings

  1. Select a service operation's diagram element - either a service operation or the operation's output for which you want to perform the data transformation.

  2. Open the Properties view.

    To do that, from the menu path choose Start of the navigation path Window Next navigation step Show View Next navigation step Other... End of the navigation path. Choose Start of the navigation path General Next navigation step Properties End of the navigation path and choose OK .

  3. Open the Mapping tab page.

  4. To create data mapping, drag and drop elements from the source tree to elements in the target tree.

  5. In the context menu of the mapping line, choose Assignment and then select one of the available assignment options depending on the mapping you want to define. For more information about the mapping assignment options, see Defining Data Mappings .

  6. (Optional) You can define the data transformation from a source context node to a target context node with an expression.

  7. Save the file.

    From the menu path, choose Start of the navigation path File Next navigation step Save End of the navigation path.

Using Expressions and Functions for the Data Transformations

You can create and apply different expressions and functions over the data context:

  • Expression functions

  • Mapping functions

  • EJB Functions

For more information about how to create, use and edit expressions and different types of functions, see:

Combining Multiple Source Values in a Single Target Data Element

You can perform complex data transformation procedures such as mapping multiple data sources into a single target element. For example, you can map two separate sources of data into a single input and apply an expression that handles the logic of the import.

Note

Note that if you want to map collections of complex elements, first you have to map their corresponding parent elements.

  1. From the menu path, choose Start of the navigation path Window Next navigation step Preferences End of the navigation path. In the dialog that appears, choose Service Composer .

  2. To be able to view the outputs of all services that are called before the service operation you want to modify, select the Display all predecessors in flow modeling checkbox.

    Apply the settings and close the dialog.

  3. In the mappings editor, map the desired service outputs to the single service input.

    Caution

    When composing a service, you cannot define mappings from identical services when they point to the same target. The reason is that the identical services have the same data structures, so you can map the output of only one of the services. To resolve this, make a wrapper service of one of the identical services - that is open the service for simplification without doing any simplifications and then save it.

  4. Open the expression editor and apply the expression that you want to use to represent the logic behind this mapping.

  5. Save the file.

    From the menu path, choose Start of the navigation path File Next navigation step Save End of the navigation path.

More Information

For more information, see Working with Data Mappings .