Map Exit Block

The Map Exit Block causes the Solution to exit the current Map immediately and either continue to the next Map or exit the Solution with a fatal error. You can use the Map Exit Block with an If/Else Block to trap an error condition in your data.

Note: If Batch Processing is enabled for any Block in the Map and the condition that triggers the Map Exit is reached, any records that are being cached to send as a batch are not processed. For example, if you have an Update Block with Batch Processing enabled and set to 200 records and you have Map Exit set to exit the Map after 275 records, the following occurs:

Map Exit Example

The Map Exit Block can be useful for testing a Map by stopping the Map after a specified number of records. This can be faster than using the Debug option and can help you run through a subset of records to find subtle data or logic errors. This method is helpful for getting performance metrics. The following example exits the Map after a specified number of records have been processed by using the RECNUM() function, an If/Else Block, and a Map Exit Block.

Create a Map with a Query Block and a For Each Result Block and then add the following: 

  1. Add a Group Comment Block and label it Stop after # records.
  2. Add an If/Else Block inside the Group Block with a condition on the If.
    • Left Value: RECNUM()
    • Operand: is greater than
    • Right Value: [numeric value]
  3. Add a Map Exit Block inside the If section of the If/Else Block. If the Condition is met, the Map Exit Block exits the Map.

    Note: Placing the If/Else and Map Exit Blocks at the beginning of the Map ensures that the If/Else is always executed. If the If/Else Block is at the end of the Map, it does not take into account failed records and may process more records than you intended.

  4. Make sure Batch Processing is disabled on any Blocks where Batch Processing is an option. Incomplete batches are flushed if the Map Exit Block executes.

Note: When you are done testing and you are ready to being using the Map with the full set of data, remove the Group Comment Block and its contents from the Map. This should include the If/Else and Map Exit Blocks. You can now enable Batch Processing if you choose to use that option.

Block Properties — General Tab

From the General tab, you can change the Block Label and add a description.

Block Properties — Exit Handling Tab

Use the Exit Handling tab to determine Solution behavior after exiting the Map.

Block Properties — Errors And Warnings Tab

If there are any errors or warnings for this Block, the Errors and Warnings tab displays the number of errors or warnings in the tab name. See Block And Map Errors And Warnings.

Once you have corrected the errors, select the Validate button to update the Errors and Warnings tab.

Related Topics

Control Blocks

If/Else Block