Please ensure Javascript is enabled for purposes of website accessibility
Powered by Zoomin Software. For more details please contactZoomin

AVEVA™ Work Tasks

How to Pass the Object as Parameter to the Constructor?

How to Pass the Object as Parameter to the Constructor?

  • Last UpdatedJun 10, 2024
  • 2 minute read

This example shows how to use the object as parameter to the constructor parameter.

For example, consider 'Employee' and 'Salary' to be two classes of an assembly. Employee object can be created by passing the employee information as parameter to the constructor. If 'Salary' object takes 'Employee' object as parameter, then it can be created by making use of the previously created instance 'Employee'.

Step1: Create an instance of a class by using SOA Property Editor.

Step 2: All saved instances will be listed in Object Browser/Workflow Instances/SOA Objects.

Step 3: Click and drop as a parameter of the constructor of another instance which takes the object as parameter.



Note: There is no need to type cast the parameter value as specific object when we use the object instance as parameter. This is because the compiler takes care of type casting to specific type of object.

 

Related Links
TitleResults for “How to create a CRG?”Also Available in