This article explains how to use Statistics delivered by the execution of a mapping in the process that contains this mapping.
Process overview :
The Load Address mapping loads data from a table to another one.
In the process, Action 1 will be executed if rows have been inserted into the target table in the previous Load Address mapping and Action 2 will be executed if no row has been inserted into the target table in the previous Load Address mapping.
Solution :
To know if rows have been inserted into the target table or not, we can consult the Statistics variables, updated when executing a mapping and especially, SQL_STAT_INSERT.
They can be consulted from the Statistic view :
We can recover these variables in the process and use it to create a condition of a link.
The syntax to access the value of a statistic variable is the following :
__ctx__.sumVariable("Variable name","Mapping name")
In our example, we test if the SQL_STAT_INSERT variable, returned by the Load Address mapping is greated than 0.