Development tools : Transaction editor : Drawing flows in the flow editor : Setting data mappings to states or transitions : Defining data formatter
  
Defining data formatter
This section describes how to create a new data formatter and its data mappings.
One data formatter consists of at least one data mapping. Once the data formatter is created, it would be displayed in the Format editor (Format tab in the Transaction editor).
1 In the Enterprise Explorer pane, double-click the Transaction file that contains data formatter that you want to remove.
The Transaction file opens in the Transaction editor.
2 In the Transaction editor, click the Flow tab.
3 In the Flow tab, click the transition or state to which the data formatter that you want to operate with belongs.
Information on the transition or state displays in the Properties tab.
Note If the Properties tab is not open, click Window > Show View > Other > Properties to open the Properties tab.
4 In the Properties panel, choose the Mapping direction.
If you want to map output data, use Output Mapping.
If you want to map input data, use Input Mapping.
These two directions share the same process. The following steps take Input mapping as an example.
5 Select 'Simple Mapping' and click '+' button to open the Mapping editor.
This graphic is described in the surrounding text.
6 In the Mapping Source panel, use the drop-down list to specify which type the mapping source is and define the entire expression according to the selected type.
This graphic is described in the surrounding text.
There are six types, Constant, Expression, Context, Global Function, Common and Condition.
Condition: define the Condition of conditional mapping. Conditional mapping means applying specific data mappings under specific condition. See Defining Conditional mapping by data mapping for details.
Besides Condition, the following types are all used for defining Mapping source. Mapping source is divided into type data (Constant and Context) and expression (Expression, Global Function and Common). For type data mapping, there is a compatibility requirement: see Type data mapping compatibility.
Note The following steps are based on Expression editor to define Mapping expression. For more information of this editor, see Expression editor.
Constant: you could specify the Constant Type as String, Number, Boolean, Index, NLS Key or other customized types.
This graphic is described in the surrounding text.
Note Mapping editor supports not only mapping from any typed data to a constant of the same type, but also natural combinations (such as a Number Constant to any numeric typed data, such as Long, Short, and BigDecimal).
Expression: perform a arithmetical, logical or relational operation with arithmetic, comparison and boolean operands.
This graphic is described in the surrounding text.
Select one of the operators to define Expression type.
Define left and right input elements according to Expression type. Click the 'browse' button on the right. In the pop-up Expression editor, select one of the supported elements and assign the value.
Context: Select the data element from available contexts.
This graphic is described in the surrounding text.
In the Context list panel, use the drop-down list to select the corresponding context. For detailed information about listed items in the panel, see Mapping context list.
In the Context data panel, only the data elements that have the appropriate flag set (input/output/both) are shown. Specifically, when mapping to a context, only the elements with the input flag set appear; when mapping from a context, only the elements with the output flag set are shown. Therefore, only output data is displayed at the Mapping Source panel and only input data is displayed at the Mapping Target panel. For data attributes of input/output, see Data element external definitions.
Global function: common data manipulation, such as compare and concatenate provided by the toolkit.
This graphic is described in the surrounding text.
Steps
Expand the functions tree to select the Global function. You could use the search bar to find the Global function you want and use Description label to know better about the function. See Global functions for detailed information about the function.
Define each parameter. Click the 'browse' button on the right. In the pop-up Expression editor, select one of the supported elements and assign the value.
Common: common condition which has been defined by users in Condition Dictionary.
This graphic is described in the surrounding text.
Steps:
Select the Common from the List panel.
Define each parameter. Click the 'browse' button on the right. In the pop-up Expression editor, select one of the supported elements and assign the value.
In all cases, the final expression will be shown at the bottom of the Mapping Source panel, in the Expression field. You could use that to confirm your definition.
7 In the Mapping Target panel, specify mapping target from one of the available contexts. Mapping Target only supports contexts. Thus you would refer to Select context as mapping source.
8 Click Bind in the middle of the window to bind the source and target data.
This graphic is described in the surrounding text.
Then the data mapping just defined would be displayed in the mapping table. In the mapping table, different colors of mappings stand for different meanings.
Meanings for different colors
 
Color
Meaning
black
already existing mapping
red
invalid mapping
green
updated mapping
blue
new created mapping
1 Optional: Add comments to data mapping in order to clarify its purpose or function. Comment lists as third column of the table. Click the button in the cell and input your comments.
2 You can define as many mappings as you may require in two ways. You need to make sure data mappings at the same level have different Mapping targets.
Define new data mappings by restarting from Step 6 again. Before that, there are two ways to return to the initial status of the wizard.
Press Reset Selection button.
Click on the blank area inside the mapping table.
Reference defined data formatter. Click 'Add RefFmt' button in the Control area and select the data formatter from the popup dialog.
This graphic is described in the surrounding text.
3 Click OK.
Note As long as you have not clicked OK, you could use CTRL+ z/y to undo/redo the previous operation. Once clicked OK, the data formatter would be saved into the Transaction file and can be viewed in the Format tab of the Transaction editor.
Go up to
Setting data mappings to states or transitions