Both sides previous revisionPrevious revisionNext revision | Previous revision |
transformations:call [2021/05/22 23:24] – craigt | transformations:call [2021/07/18 00:54] (current) – [See also] craigt |
---|
{{ transformations:CallAction.png}} | {{ transformations:CallAction.png}} |
====== CALL ====== | ====== CALL ANOTHER MODULE/PROJECT ====== |
Category: Workflow / Internal \\ | Category: Workflow / Internal \\ |
| |
\\ | \\ |
=====Description===== | =====Description===== |
This action runs another project once. The input dataset of the //Call// action is passed into the called project. The called module or project should use [[transformations:input|Input]] action in order to receive the dataset. | This action runs another module or project once. The input dataset of the //Call// action can be passed into the called module (project). In this case, the called module or project should use [[transformations:input|Input]] action in order to receive the dataset. |
| |
Depending on action settings, a resulting table may or may not be returned to the calling project. | |
| |
| Depending on action settings, the result table of the called module (project) may or may not be returned to the calling project. |
| |
\\ | \\ |
* Run another project without iterating. | * Run another project without iterating. |
* Custom re-usable actions. | * Custom re-usable actions. |
| * Fail-resistant workflows. |
| |
\\ | \\ |
| |
\\ | \\ |
=====Remarks===== | =====Error recovery===== |
The called process - whether a module in the same project file, or a different project file - needs to start with an [[transformations:input|Input]] action to receive the dataset sent by the //Call// action.\\ | When the //Call// action works in the //Capture errors and continue// mode it can be used for error recovery. In this mode, if an error occurs in the called module (or project), workflow execution won't stop. Instead, the "Call" action will capture the error and return a dataset with two columns "Error description" and "Error source", and workflow execution will continue. By checking if the resultant dataset (with error descriptions) is empty or not, it's possible to identify if the called module failed or not and execute recovery actions if a failure occurred. |
- Set up an Input action in a new module (or project file). | |
- In the //calling// process, add and configure the Call action pointing to the new target module or project file. | |
- Back in the //called// process, select "Populate automatically" to connect to the data from the Call action (in called //modules// only). For called //project files//, you'll either need to "Paste data" (copied from the data source) or "Import dataset" (from a previous-saved .dset file), to populate the //Input// with sample data.\\ | |
| |
| \\ |
| =====Remarks===== |
The //Call// action's resultant dataset will either be the dataset returned from the called process (if "Return table" was selected), or the dataset passed to it in the current workflow (if "Do not return result table" was selected).\\ | The //Call// action's resultant dataset will either be the dataset returned from the called process (if "Return table" was selected), or the dataset passed to it in the current workflow (if "Do not return result table" was selected).\\ |
| |
| The //Call// action, and the //Call// action paired with the //Input// action, are powerful ways to make your workflows more flexible. Below are some situations for using Call and Input, along with parameters and returned tables:\\ |
| * Module A calls Module B (without passing a dataset or parameters). Module B, using its own independent data source, runs its actions and finishes. Module B could //also// Call a third module (creating a chain). |
| |
| * Module A calls Module B, passing along its dataset (to Module B's Input action). Module B transforms this copy of the dataset and outputs it. Again, Module B could also pass the dataset on to //another// module to further transform it. |
| |
| * Module A calls Module B, passing along its dataset and parameters (to Module B's Input action). Module B can use the passed parameters to manipulate the passed dataset (as settings in actions or values in calculations). Module B could also return the modified dataset back to the //calling// module, as well as pass it along to a third module, along with the parameter(s) (creating a chain). |
| |
| \\ |
| When using the [[transformations:input|Input]] action in the called module, you can use the "Populate automatically" button to import the current dataset from the calling module to use as test data to build the rest of the module with. |
| |
\\ | \\ |
=====Examples===== | =====Examples===== |
**Call a module in the same project (select module):** | Calling a module (or project) without passing along a dataset. Parameters are optional. A dataset is not being returned to the called module (or project). |
{{ transformations:call_module_pic.png?720 }} | {{ transformations:call_action_img1.png?450 }} |
\\ \\ \\ | \\ \\ \\ |
**Call a module in another project (browse to project file):** | Calling a module (or project) without passing along a dataset. Parameters are optional. A dataset is returned to the called module (or project). |
{{ transformations:call_project_pic.png?720 }} | {{ transformations:call_action_img2.png?550 }} |
| \\ \\ \\ |
| Calling a module (or project) with passing along a dataset via the [[transformations:input|Input]] action. Parameters are optional. A dataset is not being returned to the called module (or project). |
| {{ transformations:call_action_img3.png?450 }} |
| \\ \\ \\ |
| Calling a module (or project) with passing along a dataset via the [[transformations:input|Input]] action. Parameters are optional. A dataset is returned to the called module (or project). |
| {{ transformations:call_action_img4.png?550 }} |
| |
| \\ |
| ====Community examples==== |
| * [[https://community.easymorph.com/t//1279/4|Example: Constructing JSON]] ([[https://community.easymorph.com/uploads/short-url/m063pNiVTAgev8a7h7z93mlXbAU.morph|Project]]; Module: //Main//; Group: //Tab 1//; Table: //entity//; Action position: //7//) |
| * [[https://community.easymorph.com/t//1498/2|Stop task when table is empty, otherwise continue processing]] ([[https://community.easymorph.com/uploads/short-url/ey91tGwHwTuRKhT6oaGNCsXQbH6.morph|Project]]; Module: //Entry//; Group: //Tab 1//; Table: //Table 1//; Action position: //1//) |
| * [[https://community.easymorph.com/t//1837/4|Joining different pairs of value equivalences into “global equivalences”]] ([[https://community.easymorph.com/uploads/short-url/1TpBXIjf6r4auDHlOBejKh2rSTw.morph|Project]]; Module: //Main//; Group: //Tab 1//; Table: //Grouping//;\\ Action position: //2//) |
| * [[https://community.easymorph.com/t//2186/2|Excel IRR formula]] ([[https://community.easymorph.com/uploads/short-url/r3hO74ebEfwvCgq0YqkKt7bqGM2.morph|Project]]; Module: //TEST//; Group: //Group 1//; Table: //TEST//; Action position: //2//) |
| * [[https://community.easymorph.com/t//2667/1|Run a task only when free RAM is above threshold]] ([[https://community.easymorph.com/uploads/short-url/aU83eid5IQaSt2mJk8hybsitpw3.morph|Project]]; Module: //MemInfo//; Group: //Tab 1//; Table: //Table 1//; Action position: //6//) |
| |
\\ | \\ |
* [[transformations:input|Input]] | * [[transformations:input|Input]] |
* [[transformations:iterate|Iterate]] | * [[transformations:iterate|Iterate]] |
* [[transformations:iteratecolumns|Iterate columns]] | * [[transformations:iteratecolumn|Iterate column]] |
* [[transformations:iteratetable|Iterate table]] | * [[transformations:iteratetable|Iterate table]] |