Add
The Add operation performs addition between two numbers of type (Integer / Double/ Float).
- [I] First number Integer / Double/ Float: This parameter represents the first addend.
- [I] Second number Integer / Double/ Float: This parameter represents the second addend.
- [I/O] Result Integer / Double/ Float: This parameter represents the result of the addition. It can be used as both an input and output variable. For example, if we want to increment, we could reuse the first number variable in the result field.
Drag a Join, a numerical Add, and a Decisional Action on the Canvas.
Declare 2 variables of type Integer (FirstNumber & SecondNumber) to be used in the Add Operation. Set the default value of the declared variables FirstNumber to 0 and the default value of the SecondNumber to 1.
Connect the Start to the Join Action and the Join Action to the Decisional
Connect the Decisional Action to the Add Action & configure the first case in the Decisional (Case I: FirstNumber <10)
Connect the Decisional Action to the Stop Action & configure the second case in the Decisional (Case II: FirstNumber >=10)
Save & Run the process and then Check the Instance to see the output.
As seen in the result of the process, the SecondNumber with value "1" was added to the FirstNumber 10 times (until the first condition in the Decisional was met).
The variables of the Add Actions are of type Object allowing additions to be performed for different number types (Integer / Double/ Float) depending on the use case needs.