transformations:halt
Differences
This shows you the differences between two versions of the page.
Both sides previous revisionPrevious revisionNext revision | Previous revisionNext revisionBoth sides next revision | ||
transformations:halt [2020/02/14 03:48] – dmitry | transformations:halt [2021/05/23 00:48] – craigt | ||
---|---|---|---|
Line 1: | Line 1: | ||
- | ===== Halt on condition | + | {{ transformations: |
+ | ====== | ||
+ | Category: Workflow / Internal \\ | ||
- | This action aborts project execution if specified condition is not fulfilled. | + | \\ |
+ | =====Description===== | ||
+ | This action aborts project execution if the specified condition is not fulfilled.\\ | ||
+ | \\ | ||
+ | =====Use cases===== | ||
The purpose of this action is to monitor data quality and prevent projects from producing incorrect results or exporting incorrect data. | The purpose of this action is to monitor data quality and prevent projects from producing incorrect results or exporting incorrect data. | ||
- | **Example** | + | \\ |
+ | =====Action settings===== | ||
+ | ^Setting^Description^ | ||
+ | |Halt mode|Select the condition under which the project is halted. | ||
+ | |Error message|(Optional) Enter custom text that will appear in the error message if an error occurs.| | ||
+ | \\ | ||
+ | ====Halt mode options==== | ||
+ | ^Halt mode ^Description ^ | ||
+ | |Halt if table is empty|This option stops the action chain and displays an error if the dataset is empty at the point of the Halt action.\\ | ||
+ | |Halt if table is NOT empty|This option stops the action chain and displays an error if the dataset is NOT empty at the point of the Halt action. | ||
+ | |Halt if the condition is true for EVERY row|The option stops the action chain if the entered condition evaluates to TRUE for every row in the dataset at the time of the Halt action.| | ||
+ | |Halt if the condition is true for ANY row|The option stops the action chain if the entered condition evaluates to TRUE for any row in the dataset at the time of the Halt action.| | ||
- | Let's assume we expect amounts | + | For either of the " |
- | Before transformation: | + | |
+ | \\ | ||
+ | =====Remarks===== | ||
+ | The condition must return either TRUE or FALSE for each row. If, for some reason, it returns an error then the action will also fail.\\ | ||
+ | |||
+ | If the condition is global (i.e. doesn' | ||
+ | |||
+ | |||
+ | The error message can be customized to provide more insight into the cause of the interruption. | ||
+ | |||
+ | \\ | ||
+ | =====Examples===== | ||
+ | **Objective:** Let's assume we expect amounts to be numbers in all rows. If any values are NOT numeric, we want the action chain to stop. If the dataset is empty at this point, we want the action chain to continue - empty datasets will be handled downstream.\\ | ||
+ | |||
+ | **Source table:** | ||
^Province | ^Province | ||
- | | ON | 1000| | + | |ON | 1000| |
- | | BC | #N/A | 187.5| | + | |BC | #N/A | 187.5| |
- | | QC | 2000| 270| | + | |QC | 2000| |
+ | \\ | ||
+ | **Action parameters: | ||
+ | > Halt mode is "Halt if the condition is true for ANY row" | ||
+ | > The condition is "not isnumber([Amount])" | ||
+ | > Choose "Do NOT halt" if the dataset has no rows | ||
- | Defining a condition as follows | + | This will make the action stop project execution because one of the values in column |
- | | + | |
- | will make the action stop project execution, because one of the values in column Amount is not number. | + | |
- | ===Notes=== | ||
- | The condition must return either TRUE or FALSE for each row. If, for some reason, it returns an error then the action will also fail. | ||
- | If the condition is global (i.e. doesn' | + | \\ |
+ | =====See also===== | ||
+ | * [[transformations: | ||
+ | * [[transformations: | ||
- | **See also:** | ||
- | * [[syntax: |
transformations/halt.txt · Last modified: 2023/10/13 21:38 by craigt