Ab-initio provides three facilities developing graphs beyond simply inserting pre-built components into workplace and connecting them each other. These are
• Custom components
• Subgraphs
• Macros
When to use Custom component
If the solution to the task is a single executable, you need to use custom component.
Typically you have a program or script you have created in past to perform some type of data transformation, and you now want to use it in Ab-Initio graph. Alternatively, you can write a new program or script with a specific purpose in mind.
A custom component lets you integrate your program or script into an Ab-Initio graph. You can use a custom component in a same way that you would use an Ab-initio pre-built component
When to use a Sub-graph
If you can construct the solution to the task from Ab-Initio pre-built components and you can keep the number and arrangements static from one run of the graph to another you can use sub-graph. Of the three above mentioned facilities sub-graph is the easiest to use.
When you use a sub-graph you can define components parameters at runtime. You can change the value of parameter from one graph to another but the number of component remains static.
Conditional Components
The GDE supports Conditional Components where a shell expression determines, at runtime, whether or not to include certain components.
To turn on this feature click on
File -> Preferences -> “Parameters” section of dialog
Check “Conditional Components”
The “Condition” tab appears on all components
[for reference see the picture below ]
The condition can be provided as argument during run time. This arguments are accessed through the variables which are mentioned in graph/sub-graph parameter list.
The Condition expression is a shell expression that, if it evaluates to “0” or “false”, will cause the component to not exist. Any other value means the component will exist.
Make sure the shell expression returns the string “0” or “false”, not numerical 0.
Components which are conditioned out can be replaced by a flow or removed completely. When removing completely, make sure you don’t leave any required ports unconnected.
To apply the same condition to more than one component, make them a subgraph and condition the subgraph.