Saturday, October 12, 2019

How to Pass the values with the use of Data Item stage in Business Object

Data Item is just like a variable in any programming laguage. In which we can assign or store the value.


I am createing the Business Object which can add two numbers. Usually we need two number for the addition of two numbers. we need two variables or  Data Item to assign the values which you want to add. and Another Variable or Data Item we will use to get the out put of two numbers.
Drag three Data Item stage into the Action 1 and provide the meaningful name to all these three items by selecting the properties of Data Item


Provide the meaningful name to the Data Item1. Data Properties window will open while double click on Data Item stage. And You can also define the Datatype of this DataItem(Refer below screenshot) and if you want to assign some value to this Data Item then you can assign it in "Initial value" field,



 In Above screen i have provided the Data Item name as "a".Similarly provide the name to other Data Item also.
I have assigned "2" as a value under the two data items.







Now Drag the Calculation stage to write the logic of Addition of two numbers. And open the Calculation stage properties by double click on Calculation stage.


Under Calculation Properties you can see all the Data Items under the Number data type.



 First Drag DataItem "a" into the Expression pane and then write "+" operator to perform the addition. Then Drag Dataitem "b" in to the expression pane. Drag "Output" Dataitem to the "Store Result In" Field.

If you want to check whether you expression is valid or not then click on the Validate Button. If Expression is valid message come then your logic is correct.

Connect all the stages and Run your Object.




 Thanks Everyone !

No comments:

Post a Comment