The "Or" orchestration component waits for any of its inputs to complete before continuing the job. Once any of the inputs complete, the tasks defined after the "Or" component are added to the job. There may already be tasks in the queue however, so they may not necessarily be run next.
The input links do not have to be success links. For example, you may wish to take an action if any of a set of components fail, regardless of which particular one fails.
Only the Name property can be configured to provide a meaningful description of the component.
|Name||Text||The descriptive name for the component.|
In this example, if any of the loads fail we want to do some cleanup work to ensure when the job ends the database is left in a consistent state. (The details of the Cleanup job are not covered here).
The name can be set to a custom value.
In this example, we have a job that branches off to perform one of two possible loads, depending on how large the job is (indicated by a variable named 'branch'). An Or component is used simply to return the branched workflow into a single branch. The job is shown below.
In each load, we want to export the row count into a local variable ('partial_rows_loaded') to use later on. This presents an issue, since local variables are reset to their default value upon the workflow reaching an Or component.
To solve this, we include a Python Script component in each branch of the workflow. These Python Script components take the value in the local variable and assign it to a global variable, which will not be reset upon hitting the Or component.
Note that for this to happen, we must declare the global variable first using the manager (Project → Manage Environment Variables).
Now when run, the exported variables are moved to a global variable that survives passing through the Or component and can be printed.
This job can be downloaded below and imported into your own Matillion ETL instance.