Variable scope in Process Designer

In IBM® BPM, all variables declared for a business process definition (BPD) or service are local variables.

Local variables are accessible only to the currently executing process instance or service. Because variables are unique to an individual BPD or service, you can use a variable of the same name in a nested BPD or service and no conflicts occur at run time.

A variable contains a value or refers to an object. Multiple variables can refer to the same object. When a running process instance or service reaches an exit point, the variable value or references can be propagated to the calling process instance or service. When a running process instance or service encounters an activity, the variable values and references can be propagated to variables within that activity. A variable that is defined as a Shared Object can persist its values at these boundaries. For more information, see Declaring and passing variables for more details.

All Process Designer variables are JavaScript objects. Process Designer uses namespaces to organize these objects and their methods. The following table describes the namespaces that are most commonly used during process design and development:

Table 1. Available namespaces
Namespace Description
tw Top-level Process Designer namespace
tw.object Access Process Designer JavaScript objects and business objects (variable types)
tw.local Access and update BPD and service-level variables
tw.system Access system features and functionality
tw.system.org Access security functionality
tw.epv Access exposed process values (EPVs)
tw.env Access environment variables