User Tools

Site Tools


transformations:halt

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revisionPrevious revision
Next revision
Previous revision
Next revisionBoth sides next revision
transformations:halt [2020/02/14 03:51] dmitrytransformations:halt [2021/05/23 00:48] craigt
Line 1: Line 1:
-===== Halt on condition =====+{{ transformations:HaltAction.png}} 
 +====== HALT ON CONDITION ====== 
 +Category: Workflow / Internal \\
  
-This action aborts project execution if specified condition is not fulfilled. Error message can be customized to provide more insight into the cause of interruption.+\\  
 +=====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.  See table below.  Options:  //Halt if table is empty//,\\ //Halt if table is NOT empty//, //Halt if the condition is true for EVERY row//, or //Halt if the condition is true for ANY row//.| 
 +|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.\\  Used in cases where the dataset is expected to have data at the time 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.  Used in cases where the dataset is expected to NOT have data at the time 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 to be numbers in all rows.+For either of the "condition" options, select how EasyMorph will react //if the condition refers to a field, but the table has no rows// (e.g. data) at the time of the Halt action.  Options:  //Halt anyway// or //Do NOT halt//.\\
  
-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't refer any field) then it's still evaluated even if the dataset is empty.\\ 
 + 
 + 
 +The error message can be customized to provide more insight into the cause of the interruption.  If custom error message text is not supplied, generic error language will be used, relative to the Halt mode selected.\\ 
 + 
 +\\  
 +=====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  ^Amount  ^Total Tax  ^ ^Province  ^Amount  ^Total Tax  ^
- ON  | 1000|   125| +|ON  | 1000|  125| 
- BC  | #N/A | 187.5| +|BC  | #N/A |  187.5| 
- QC  |     2000| 270|+|QC  | 2000|  270| 
 +\\  
 +**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 "Amountis not number.  If the entire dataset is empty, however, the project will continue.\\
-   not isnumber([Amount]) +
-will make the action stop project executionbecause 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't refer any field) then it's still evaluated even if the dataset is empty.+\\  
 +=====See also===== 
 +  * [[transformations:haltontypemismatch|Halt on data type mismatch]] 
 +  * [[transformations:wait|Wait]]
  
-**See also:** 
-  * [[syntax:errorpropagation| Error propagation in expressions]] 
transformations/halt.txt · Last modified: 2023/10/13 21:38 by craigt

Donate Powered by PHP Valid HTML5 Valid CSS Driven by DokuWiki