Versions Compared
compared with
Key
- This line was added.
- This line was removed.
- Formatting was changed.
Comment:
Published by Scroll Versions from space WDESIGNER and version 24.0
Class operations can be static or non-static (see Adding Operation Calls). If an operation is non-static, it can only be executed on a given instance of the related class: You need to provide an object of this class to the target pin of the operation.
Within this operation, the contents of the object are available via the self context.
Example
Assume you have the following Product class with
- a non-static updateStock operation that updates a given quantity of the current product to the stock
- and a static updateStorageSystem operation that updates the storage system with a given quantity
The self context provides the object content via the keyword self to the operation newHoldingCustomer updateStock().
Target | Syntax | Description | Customer Example |
---|---|---|---|
Property | self.propertyName <property name> | Use this notation to access Access to a property of the related class. | self.location.storageUnit.shelf |
Operation (non-static) | self .operationName<operation name>(parameters<parameters>) | Access Use the dot notation to call to a non-static operation of the related class. | self.updateStock(20.0) |
Operation (static) | self :staticOperation<operation name>(parameters<parameters>) | Access to Use the usage notation (colon) to call a static operation of the related class. | self:updateStorageSystem(self.id, 20.0) |
Panel | ||
---|---|---|
| ||
Overview
Content Tools