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

AVEVA™ Work Tasks

SOA Object Instances in SOA Property

  • Last UpdatedJul 25, 2023
  • 3 minute read

The SOA Object Instances property is an important property for SOA. Without starting an instance of a class, you cannot use the methods available in a class that are not static. The static members of the class can be used without creating any instance.

You can create multiple instances of a class. Creating instances of classes sometimes requires parameters. You can use the object instance property editor to select objects, method, or functions for constructor parameters.

You can drag and drop the constructor (.cntr) into the editing area and update the constructor parameters, if any. You can select the parameters from workflow instance properties or from other registered SOA classes. If type casting or conversion are required, then you can opt for functions available under Date, Math, or String in the object browser.

The following image shows the SOA Object Instance property window:

The SOA Object Instance window contains the following fields:

Fields

Description

SOA Instances

Displays the already registered instances and also allows the user to edit or delete an instance.

SOA Objects

Displays the registered objects and allows the user to drag and drop or click and drop a constructor to instantiate a new class.

Object Browser

The Object Browser shows the available AVEVA Work Tasks Objects that can be used as parameters for instantiating a class by selecting them as parameters for the constructor. Users can edit or delete already created constructors from this option.

Reset

Clears the editor and constructor information from the Editor.

Name

A name for the instance.

Description

A descriptive name can be given for the instance of the class.

Expression

Expressions to be set.

SOA Instances

To instantiate an Assembly class in a workflow

  1. From SOA Objects, drag and drop or click and drop a constructor to create an instance.

  2. Using Object Browser, pass the parameters to the constructor.

  3. Click Save. You can view the saved instances in SOA Instances.

To edit an existing instance

  1. Click the SOA Instances tab on the left hand side of the SOA Property Editor.

  2. Right-click the saved instance which needs to be edited, and then click Edit from the context menu.

  3. Update and Delete buttons, which allow the user to update or delete the selected instance, will be visible.

    To delete an existing instance

    1. Select an instance in the SOA Instances tab.

    2. Click Delete to delete the instance. This will prompt for confirmation of deletion.

    3. Click OK.

      SOA Instance Members

      The SOA property window comes with a new node with the instance name as node text for an already created instance. It shows all the available methods or properties of that instance. Members of each instance can be used to build the expression in the SOA property page. For example, the ‘Employee’ instance has been created here. Members of this instance are displayed in the Object Browser.

      SOA Static Members

      To use static members, no need to create an instance of the class. After an assembly is registered in the SOA Assembly list, all the static members of the registered class get loaded in the SOA Property Editor/Expression editor and can make use the same for passing the parameter.

      For example, the ‘Employee’ class has the 'GetCompanyName()' static method. After the class is registered in the SOA Assembly list, 'GetCompanyName()' will be displayed in the Object Browser under SOAStaticObjects. The user can work with these static methods without creating an instance of Employee class.

      Note: Static properties in SOA: SOA, in the normal behavior of having an instance of class, does not support static properties. It works fine with SOA static objects. Example: The assembly ‘Employee.dll’ has a static property called ‘Company Name’ to get the name of the company. If an instance is created for the class ’Employee’ in SOA, the use of static property by utilizing a created instance throws a compilation error in the Expression Editor. Static property needs to be called by using the type name where as the static property in SOAStaticObjects will work normally.

      SOA Objects

      All saved instances will be listed in Object Browser/Workflow Instances/SOA Objects. The user can make use of these objects and build an expression in the SOA Property page or the Expression Editor.

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