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
transformations:halt [2015/10/01 22:18] dmitrytransformations:halt [2023/10/13 21:38] (current) – [Halt mode options] craigt
Line 1: Line 1:
-===== Halt on condition =====+{{ transformations:HaltAction.png}} 
 +====== HALT/WARN ON CONDITION ====== 
 +Category: Workflow / Internal \\
  
-This transformation 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 can either abort project execution or display a warning and continue if the specified condition is not fulfilled.\\
  
-The purpose of this transformation is to monitor data quality and prevent project from producing incorrect results or exporting incorrect data.+\\ 
 +=====Use cases===== 
 +  *Monitor data quality and prevent projects from producing incorrect results or exporting incorrect data
 +  *When working with Catalog items, Halt or Warn when data is outdated or possibly incomplete. 
 +  *In workflows, signal potential data quality issues and help to investigate errors.
  
-**Example**+\\  
 +=====Action settings===== 
 +^Setting^Description^ 
 +|Mode|Options: //Halt// or //Warn and continue// See the tables below for details. |
  
-Let's assume we expect amounts to be only numbers.+\\ 
 +====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.| 
 +|Error message<sup>*</sup>|(Optional) Enter custom text that will appear in the error message if an error occurs.|
  
-Before transformation:+<sup>*</sup> Setting can be specified using a [[:parameters|parameter]] or the first value of a column. 
 + 
 +\\ 
 +====Warn and continue mode options==== 
 +^Warn mode ^Description ^ 
 +|Warn if table is empty|This option displays a warning and continues if the dataset is empty at the point of the Warn action.\\  Used in cases where the dataset is expected to have data at the time of the Warn action.| 
 +|Warn if table is NOT empty|This option displays a warning and continues if the dataset is NOT empty at the point of the Warn action.  Used in cases where the dataset is expected to NOT have data at the time of the Warn action.| 
 +|Warn if the condition is true for EVERY row|The option displays a warning and continues if the entered condition evaluates to TRUE for every row in the dataset at the time of the Warn action.| 
 +|Warn if the condition is true for ANY row|The option displays a warning and continues if the entered condition evaluates to TRUE for any row in the dataset at the time of the Warn action.| 
 +|Warning message<sup>*</sup>|(Optional) Enter custom text that will appear in the warning message if an error occurs.| 
 + 
 +<sup>*</sup> Setting can be specified using a [[:parameters|parameter]] or the first value of a column. 
 + 
 + 
 +\\ 
 +For either of the "condition" options (true for ANY row, true for EVERY row), 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/Warn action.  Options (Halt mode): //Halt anyway// or //Do NOT halt// Options (Warn mode): //Warn anyway// or //Do NOT warn//.\\ 
 + 
 + 
 +\\  
 +=====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 to 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 message text is not supplied, generic error language will be used, relative to the Mode selected.\\ 
 + 
 +\\  
 +=====Examples===== 
 +**Example:**  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):** 
 +> 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 
 + 
 +This will make the action stop project execution because one of the values in column "Amount" is not a number.  If the entire dataset is empty, however, the project will continue.\\ 
 + 
 +\\  
 +**Action parameters (Warn and continue mode):** 
 +> Warn mode is "Warn if the condition is true for ANY row" 
 +> The condition is "not isnumber([Amount])" 
 +> Choose "Do NOT warn" if the dataset has no rows 
 + 
 +The action will display a warning and continue project execution because one of the values in column "Amount" is not a number.  If the entire dataset is empty, however, the project will continue without a warning.\\ 
  
-Defining condition as follows +\\  
-   isnumber([Amount]) +====Community examples==== 
-will make the transformation stop project execution, because one of the values in column Amount is not number.+  * [[https://community.easymorph.com/t//466/1|Sending an email notification when project fails]] ([[https://community.easymorph.com/uploads/short-url/8MVDPxoPY14RwNbwTFKOzYgrbCD.morph|Project]]; Module: //Submodule//; Group: //Tab 1//; Table: //Table 1//; Action position: //2//
 +  * [[https://community.easymorph.com/t//1398/1|How to obtain a list of all files recursively]] ([[https://community.easymorph.com/uploads/short-url/p5eGkU5ftaJpBXTfGbLxLte2VPX.morph|Project]]; Module: //Main//; Group: //Tab 1//; Table: //Table 1//; Action position: //2//) 
 +  * [[https://community.easymorph.com/t//1850/1|Process a group of files only when all of them are present]] ([[https://community.easymorph.com/uploads/short-url/zJqXVSbMintqzS3bYdfpLMj9c45.morph|Project]]; Module: //Main//; Group: //Tab 1//; Table: //Table 1//; Action position: //3//) 
 +  * [[https://community.easymorph.com/t//2616/2|How to verify uniqueness for a combination of fields]] ([[https://community.easymorph.com/uploads/short-url/cLNzPfyWH0UyLiDDFC4JnIkbzJN.morph|Project]]; Module: //Main//; Group: //Group 1//; Table: //Check//; Action position: //4//)
  
-Note that the condition should return either TRUE or FALSE for each row. If for some reason it returns error then the transformation will also fail.+\\  
 +=====See also===== 
 +  * [[transformations:breakpoint|Breakpoint]] 
 +  * [[transformations:haltontypemismatch|Halt on data type mismatch]] 
 +  * [[transformations:wait|Wait]]
  
-**See also:** 
-  * [[syntax:errorpropagation| Error propagation in expressions]] 
transformations/halt.1443752301.txt.gz · Last modified: 2015/10/01 22:18 by dmitry

Donate Powered by PHP Valid HTML5 Valid CSS Driven by DokuWiki