Skip to main content
Skip table of contents

this Context

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.

In JavaScript, the contents of the target object are available within that operation via the this context. Contents in this case means properties.

For static operations, the keyword this is undefined.

Example

Assume you have the following Product class with

  • the properties

    • id

    • name

    • location

  • 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 this context provides the object content via the keyword this to the operation updateStock().

Target

Syntax

Description

Customer Example

Property

this.<property name>

Use this notation to access to a property of the related class.

this.location.storageUnit.shelf

JavaScript errors detected

Please note, these errors can depend on your browser setup.

If this problem persists, please contact our support.