Was this helpful?
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 /download/attachments/24975464/Map_Source_Add_Icon.png?version=1&modificationDate=1487964370325&api=v2.
The Add Map Event window is displayed based on the map artifact type (JSON).
3. For JSON-based artifacts, see Adding Map Events in Actian DataConnect.
Adding Map Events in Actian DataConnect
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 /download/attachments/24975464/Map_Source_Add_Icon.png?version=1&modificationDate=1487964370325&api=v2 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 stopped.
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 /download/attachments/24975464/Map_Source_Add_Icon.png?version=1&modificationDate=1487964370325&api=v2 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 /download/attachments/24975464/Map_Source_Delete_Icon.png?version=1&modificationDate=1487964370309&api=v2.
To copy an action, click the action that you want to copy and then click /download/attachments/24975464/Map_Source_Copy_Icon.png?version=1&modificationDate=1487964370340&api=v2.
To move the order of the actions:
Click /download/attachments/24975464/Map_Source_UpArrow_Icon.png?version=1&modificationDate=1487964370340&api=v2 to move the action up.
Click /download/attachments/24975464/Map_Source_DownArrow_Icon.png?version=1&modificationDate=1487964370372&api=v2 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.
 
Action
Action Parameter
Description and Values
Stop
Reason code.
Flag indicating reason for stop.
Break
No parameters
Breaks the execution process. Execution resumes with the next source or target record reference link on the current source record.
Discard
No parameters
Current input record is discarded.
ExecuteCommand
target name
Name of the target to execute the command.
command
Command that must be executed.
command type
Indicates how the SQL string or command is processed before it is passed to the connector. Select any of the following command type processor:
plain_text: Uses the string as the SQL command and additional processing of the command is not required.
expression: Command is evaluated as an expression and the return value is passed to the connector as the SQL command.
preprocessor: Command is preprocessed using the SQL statement preprocessor (DJX/DJXBEGIN/DJXEND) and the result is passed to the connector.
ExecuteExpression
expression
Expression that must be executed. Click within the cell and then click ... to add an EZscript expression. For information about adding EZscript expressions, see Scripting.
OutputRecordSet
source name
Source that must be processed.
preserve
Select Yes to preserve values in row set. Else, select No.
max record count
Maximum record counts to output. Click within the cell and then click ... to add an EZscript expression. For information about adding EZscript expressions, see Scripting.
RaiseUserDefinedEvent
event name
Name for the event.
parameter string
Event parameter data to be passed
Reject
reason code
Signals to the transformation engine that the current input record should be rejected. This parameter allows you to associate the reject with an integer value that can be mapped to the reason for the reject.
TableOperation
operation type
Perform a table operation on a multimode output port. The table or entity name and the table definition are specified using the address of a record record_address from the schema for a multimode target port.
Allowed values for operation_type:
Create: Create a table using the record type information for record_address to define the column names and data types.
Drop: Drop the table associated with record_address if the table exists.
Truncate: Delete records from the table associated with record_address. This is usually done by performing a truncate operation on the backend system.
record address
Record in multimode target describing the table or entity.
Terminate
No parameter
Stops the execution process.
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.
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 /download/attachments/24975464/Map_Source_Edit_Icon.png?version=1&modificationDate=1487964370387&api=v2.
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 /download/attachments/24975464/Map_Source_Add_Icon.png?version=1&modificationDate=1487964370325&api=v2, click the action name and from the drop-down list, select the required action
To delete an action, click the action and then click /download/attachments/24975464/Map_Source_Delete_Icon.png?version=1&modificationDate=1487964370309&api=v2.
To copy an action, click the action that you want to copy and then click /download/attachments/24975464/Map_Source_Copy_Icon.png?version=1&modificationDate=1487964370340&api=v2.
To move the order of the actions:
Click /download/attachments/24975464/Map_Source_UpArrow_Icon.png?version=1&modificationDate=1487964370340&api=v2 to move the action up.
Click /download/attachments/24975464/Map_Source_DownArrow_Icon.png?version=1&modificationDate=1487964370372&api=v2 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 /download/attachments/24975464/Map_Source_Delete_Icon.png?version=1&modificationDate=1487964370309&api=v2.
A message asking for confirmation is displayed.
3. Click Yes.
The selected event is deleted from the Map Events section.
Last modified date: 02/01/2024