Nesting workflows to control the execution order
In this recipe, we will see how workflow objects are executed in the nested structure.
Getting ready
We will not create dataflow objects in this recipe, so to prepare an environment, just create an empty job object.
How to do it
We will create a nested structure of a few workflow objects, each of which, when executed, will run the script. It will display the current workflow name and the full path to the root job context. Follow these steps:
- In the job workspace, create a new workflow object,
WF_root,
and open it. - In the Variables and Parameters window, when in the
WF_root
context, create one local variable$l_wf_name
and one input parameter$p_wf_parent_name
, both of thevarchar(255)
data type. - Also, inside
WF_root
, add the new script object namedScript
with the following code:$l_wf_name = workflow_name(); print('INFO: running {$l_wf_name} (parent={$p_wf_parent_name})'); $l_wf_name = $p_wf_parent_name || ' > ' || $l_wf_name...