Current and Default Instances

Object instance behavior under PBL

Default Instance

Oracle BPM has the concept of a default instance, which is an instance associated to a component.

Only components that have default constructors have default instances. Such instances are accessible within the method scope. That is, a default instance that has been created while running a specific method only exists through that method's execution.

For example:
show Menu
   using entries = ["Apples", "Oranges", "Chocolate"], 
	          title = "Which do you like best?"

In the example above, the reference to the component Menu is using its default instance, that is, an instance is automatically created the first time that a reference to Menu appears.

Current Instance

Typically, when you want to refer to your current instance, you use the keyword this (or Me, in Visual Basic style):
update this using date = 'now'

Suppose that the code above belongs to a component named MyComponent. In this case, you could also write it as follows:

update MyComponent using date = 'now'
Here, the default instance of MyComponent is the same as the this, so the current instance is used as the default instance.