Configuring Map Events
You can add, edit, and remove map events for a map. Map Events are used for pre and post processing, and error handling during data transformation. The events configured on the Configuration tab is for the complete map. After you select an event, you select actions to execute when that event occurs. You can add a condition statement if you want some actions to execute when the condition is true (the if actions) and some different actions to execute when the condition is false (the else actions). A no condition statement defaults to true and will execute only the if actions.
Adding Map Event
To add map events:
1. Open a map file and go to Configuration tab > Map Events section.
2. Click
.
The Add Map Event window is displayed based on the map artifact type (JSON or XML).
Adding Map Events in DataConnect v11
The Add Map Event window has the following sections:
• Events and Event Parameters
• True Actions and Action Parameters
• False Actions and Action Parameters
• Condition Expressions
To add map events:
1. In the
Add Map Event window >
Events section, click the arrow next to
icon and select the required event(s). The following events are available:
• ErrorFound- Triggered when an error occurs during map execution.
• TransformationAborted - Triggered when the transformation is aborted.
• TransformationEnded - Triggered at the end of the transformation.
• TransformationStarted - Triggered before the start of the transformation.
• UserDefinedEventDetected - Triggered when a user-defined event is fired.
2. Based on the selected event, the Event Parameters section displays the respective parameter and default values. Currently, the user-defined event name parameter is displayed only for UserDefinedEventDetected event. In the Value column, specify the value.
3. On the
True Actions tab, click
to add an action. The following actions are available:
• Abort
• Break
• Discard
• ExecuteCommand
• ExecuteExpression
• OutputRecordSet
• RaiseUserDefinedEvent
• Reject
• Table Operation
• Terminate
For information about each option, see step 4.
You can also do the following:
• To delete an action, click the action and then click
.
• To copy an action, click the action that you want to copy and then click
.
• To move the order of the actions:
– Click
to move the action up.
– Click
to move the action down.
4. Based on the selected action, the Action Parameters section displays the respective parameter and default values.
For each parameter, click the Value field and specify a value. The following table provides the actions, action parameters, and the values.
Note: After adding a parameter value, when you hover over the value, a tooltip displays the value. If a value is not specified, then the tooltip does not display any value.
5. In
Condition Expression section, click
and specify an EZscript expression. When a condition expression is added, the
False Actions tab is enabled. You can specify the actions and the action parameter values. For information about the actions, see the table in the previous step. You can delete and move the actions up and down using the icons.
6. Click Finish.
The events with the actions are displayed in the Map Events section on the Configuration tab.
Adding Map Events in XML-based Map
To add map events in XML-based map:
1. In the Add Map Event window, select the required event handlers or search for the event handler by typing the word in the Search field.
The following event handlers are available:
• BeforeTransformation - Triggered before the transformation starts.
• AfterTransformation - Triggered after the transformation ends.
• OnAbort - Triggered when the transformation aborts.
• OnAssertionError - Triggered when the assert action fails.
• OnError - Triggered for unhandled errors.
• OnRecordValidationError - Triggered when the content of a record fails validation.
2. Click Next.
A page is displayed where you have to select actions and specify the parameters for the selected event handlers.
3. In the Event Name section, click an event.
4. In the
Action section, click
to add an action. By default,
Abort action is added.
5. If you want to change the Abort action, click the name and from the drop-down list, select the required action.
You can also do the following:
• To delete an action, click the action and then click
.
• To copy an action, click the action that you want to copy and then click
.
• To move the order of the actions:
– Click
to move the action up.
– Click
to move the action down.
6. After adding the actions, click each action.
The Parameters section displays the relevant parameters for the selected action.
7. For each parameter, click the
Value field and specify a value. When you click within the
Value field,
... or a drop-down list is available. If you click
..., you can add an EZscript expression. If you select the drop-down list, you can either select a value or select
<Build Expression...> to add an EZscript expression. For information about adding EZscript expressions, see
Scripting.
Note: After adding a parameter value, when you hover over the value, a tooltip displays the value. If a value is not specified, then the tooltip does not display any value.
8. Click Finish.
The events with the actions are displayed in the Map Events section on the Configuration tab.
Modifying Map Event
To modify the map event:
1. In the map file, go to the Configuration tab > Map Events section.
2. Click the event that you want to modify and click
.
A window is displayed where you can modify the actions and parameters for the selected event.
3. In the Action section, you can do the following:
• To change an existing action, click the action name and from the drop-down list, select the required action.
• To add a new action, click
, click the action name and from the drop-down list, select the required action
• To delete an action, click the action and then click
.
• To copy an action, click the action that you want to copy and then click
.
• To move the order of the actions:
– Click
to move the action up.
– Click
to move the action down.
4. After adding the actions, click each action.
The Parameters section displays the relevant parameters for the selected action.
5. For each parameter, click the
Value field and specify a value. When you click within the
Value field,
... or a drop-down list is available. If you click
..., you can add an EZscript expression. If you select the drop-down list, you can either select a value or select
<Build Expression...> to add an EZscript expression. For information about adding EZscript expressions, see
Scripting.
6. Click Finish.
The events with the actions are displayed in the Map Events section on the Configuration tab.
Deleting Map Event
To delete a map event:
1. In the map file, go to the Configuration tab > Map Events section.
2. Click the event that you want to remove and click
.
A message asking for confirmation is displayed.
3. Click Yes.
The selected event is deleted from the Map Events section.