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

AVEVA™ Work Tasks

How to Create a Variable?

  • Last UpdatedJun 10, 2024
  • 2 minute read

The below example shows how the user can create a Variable.

To create a Variable

  1. Create a variable of type 'Object' in the Start Activity, for e.g. 'ProductObject'. This variable will hold the 'Product' object in the process. This variable is also used for object mapping. Mapping of an object to a variable will store the object state in the variable. This will enhance the capability of persisting the real time entities in the long running workflow.

    The following steps will explain how to create an instance of object (Approach (a)), and how to map an object to a variable (Approach (b)).

    'Product' object with all the available constructors will be displayed in the 'SOA Objects'. Objects that can be serialized will have the option 'Map to Variable'.

    Note: 'Mapped variable' feature gets enabled only for objects that are marked as 'Serializable'.

  2. Create a 'Product' object instance by selecting a constructor and pass the appropriate parameters to it.

  3. Click 'Set' to set the expression to the constructor.

  4. Pass the valid parameters to the constructor. E.g.:  "Rad01","Radiator","Spare Part Automobile", 20000

    Map the variable to the object. The Mapped variable will get automatically filled with the real time entity whenever the object gets instantiated. This happens for the first time, and further invoking the object will get the object state stored in the variable.

  5. Click 'Map to Variable' to map a variable to the instance. Only object type variables can be mapped to SOA Objects. A pop-up with 'Map to Variable' will get displayed.

  6. Select the variable to be mapped and click 'Map'. This will map the variable to the SOA Object. It is possible to create a variable of type object by clicking 'New' and mapping the variables.

  7. The Mapped variable will get displayed in the 'Mapped Variable' field.

  8. After the variable is mapped, click 'Save' to save the instance.

  9. Create an instance of 'OrderLineCalculator' class. This object will be used for calculating the total amount.

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