Copyright © Cloud Software Group, Inc. All Rights Reserved
Copyright © Cloud Software Group, Inc. All Rights Reserved


Chapter 8 Mapping and Transforming Data : Overview of Mapping and Transformation

Overview of Mapping and Transformation
The Input tab of an activity allows you to supply the data that an activity expects as input. On the Input tab, you can see the available process data and the activity’s expected input. The process data and activity input are represented as schema trees. Figure 25 illustrates an activity’s Input tab.
Figure 25 An activity’s input tab
Process Data Panel
The process data is the list of available data in the process definition at the point where the activity is located. An activity has access to all output data from any activity that has been previously executed in the process definition. All activities also have access to global variables, process variables, and information about the current process context. You cannot modify the process data on an activity’s input tab, but you can use the data to supply input to the activity.
Activity Input Panel
The activity’s input is an Extensible Stylesheet Language Transformation (XSLT) template that specifies how process data should be transformed to provide the expected input. Normally, you do not need detailed knowledge of XSLT to specify an activity’s input. However, if you are familiar with XSLT and you wish to see the actual code, you can right-click on any item in the input schema and choose Copy from the popup menu. Then open a blank text document and choose Paste. The XSLT is displayed in your text document.
You can also use your own XSLT templates to perform transformations instead of using the techniques described in this chapter. You can paste XSLT into your activity input or use the XSLT File shared configuration resource and the Transform XML activity. See TIBCO ActiveMatrix BusinessWorks Palette Reference for more information and examples of using XSLT to perform mapping.
Mapping and Transforming Process Data to Activity Input
When an activity is first dragged from a palette to the design panel, the activity’s input elements are displayed as hints. These hints show you the data the activity expects as input. Each element can be required or optional. Required elements must have a mapping or formula specified. Once a mapping or formula is specified, a hint becomes an XSLT statement. See Statements, Hints, and Errors for more information about hints and statements.
You map data by selecting an item in the Process Data panel, then drag and drop that item into the desired schema element you wish to map in the Activity Input panel. When you perform mapping, simple mappings appear in the formula area next to the input element after you release the mouse button. For more complex mappings, the Mapping Wizard dialog allows you to select which kind of mapping you wish to perform.
Most options in the Mapping Wizard dialog are straightforward. However, there are some complex scenarios that require multiple steps. Many of these situations are described in the section Examples of Mappings. You may also wish to refer to XSLT Statements for a reference of XSLT statements when deciding which XSLT statement can be used to achieve the result you desire.
You can specify XPath formulas to transform an element if you need to perform more complex processing. The XPath Formula Builder allows you to easily create XPath formulas. For more advanced use of XPath, see Chapter 9, XPath. There are also a variety of third-party books and resources about XSLT and XPath.
Statements, Hints, and Errors
When you display the Input tab for an activity, the existing statements are examined, and any input elements that do not have a statement are displayed as hints. Hints are reminders that you can specify a statement for the input element, but they are not stored as part of the XSLT template for the activity’s input. Hints are displayed in italics with a light blue background. Once you specify a mapping or a formula for a hint, the input element becomes a statement. You can also drag the hint to the left past the dividing line between the panels and the hint becomes a blank statement.
Once you specify a statement in the Activity Input panel and apply the change to the activity, it becomes part of the XSLT template used to create the activity’s input data. These statements are saved as part of the activity in the repository. Statements are only deleted if you manually delete them using the delete button, or if you use the Mapper Check and Repair button to automatically fix errors. Therefore, if the input schema for the activity changes, your statements may no longer be valid. See Repairing Incorrect Mappings for more information about using the Mapper Check and Repair button to fix statements in the activity’s input.
Any statement or hint that has an error is displayed in red. A hint is only displayed in red if it is a required input element. All required input elements must have statements specified. If a statement is red, you must fix the error before executing this process definition. The Mapper Check and Repair button can help you automatically fix some errors. See Repairing Incorrect Mappings for more information about fixing errors.

Copyright © Cloud Software Group, Inc. All Rights Reserved
Copyright © Cloud Software Group, Inc. All Rights Reserved