Predefined Variables

Predefined variables are global to all parts of the process and, just as their name implies, have already been defined. Most of the predefined variables deal with instances as they relate to activities and are used to keep track of an instance and its status as it flows through a process. Some predefined variables are modifiable and others are not. The following table lists the predefined variables included in Studio.

List of Studio Predefined Variables

Predefined Variable Permitted Values Type Description
action Modifiable : OK ; FAIL ; RELEASE ; CANCEL ; REPEAT ; ABORT ; BACK ; SKIP ; NONE Fuego.Lib.Action Marks the action to be performed on a process instance as a result of previous BP-Method statements. See below Using the action variable.
activity Read only Fuego.Lib.Activity Returns an object that is the current activity.
activity.deadline Read only Time Set automatically if there is a Due transition going from the current activity (receptionTime + the due transition time interval.)
activity.source Read only Fuego.Lib.Activity The activity from which the current instance came into the current activity. Null in the case of Global and Begin activities.
attachments Read only Fuego.Lib.Attachment[] Array of the instance attachments.
children Read only String[ordered Object] Array of the Ids of the instances that are children of this instance, ordered by the list of activities that created them.
creation. participant Read only. Participant Participant that created the process instance.
creation.time Read only Time Creation time of the instance.
currentException Read only String Name of the exception, if the instance is within an exception flow, which was given to it by the throw statement.
deadline Modifiable. Time The instance will expire if it is not completed before the specified time.
description Modifiable: Any string that does not contain special characters String Name of the instance that appears in WorkSpace. By default, it is ProcessName+ id.number.
id.id Read only String An instance's identifier, which uniquely identifies an instance. It includes the deployed process name, organization, organizational unit and the instance Id (including thread id).
id.number Read only Int A number that uniquely identifies an instance within an Engine.
id.copy Read Only . The current instance thread number.
notes Read only Int An array of all notes added to an instance.
organization Read Only String Name of organization where the process is running.
organiztionalUnit Read Only String Name of the process' organizational unit where the process is running, such as Marketing or Finance.
parent.id Read only String The Id of the parent instance of the current instance if there is one; NULL otherwise. In the case of a Procedure, it contains the id of the calling process
parent.copy Read only Int The parent instance thread number.
parent.number Read only Int A number that uniquely identifies the parent instance within an Engine.
participant Read Only. Any participant Fuego.Lib.Participant The human participant stored in directory services that is currently processing the instance.
participant.locale Read Only Fuego.Util.Locale The language, country and variant, if applicable, the participant has set.
participant.next Modifiable: Any participant Fuego.Lib.Participant The participant to which the instance will be sent next.
Note: If the instance is grabbed, the participant.next is cleared. If the instance is sent BACK or SKIP from an Exception flow or from an Interruption, the only way to reset the participant.next is using the Unselect method from the Participant component. See Participant component documentation for further information.
participant.sticky Modifiable: Bool Fuego.Lib.Participant If set to true, the participant.next is set as the preferred participant. Each time the instance moves to an activity and the participant.next is enabled to work with it (belongs to the role where the activity is), the instance is submitted to the participant.next work queue. In the Split and SplitN activities, all generated copies maintain the participant.sticky value from the original instance. In the SplitN method you can change its value.
Note: If the participant.next is changed during the process, be sure that participant.sticky is reset unless the new participant.next is considered the preferred participant.
priority Modifiable: 1 Lowest ; 2 Low ; 3 Normal ; 4 High ; 5 Highest Int Priority of the instance.
process Read Only. Any process Fuego.Lib.Process The process the instance belongs to.
process.id Read Only String The Identifier of the deployed process containing the deployed process' name, its organization and organizational unit.
process.idNumber Read Only Int A number that identifies the process inside an Engine
process.name Read only String The name of the process of the instance.
receptionTime Read only Time The time that the current instance was received at the current activity.
result Modifiable: Any string String It contains the result that you set in the BP-Method. For example, you can set a result and in the outgoing conditional transition of the activity ask for that value. See below for more information.
status Read Only. RUNNING, EXCEPTION, SUSPENDED, GRABBED, COMPLETED, ABORTED, ACTIVITY_ COMPLETED ProcessInstanceState Current status of the process instance.
timeout Modifiable: String indicating an interval, enclosed in single quotes: '5m' Interval The length of time that a BP-Method or an external component has to complete before the engine cancels its execution. By default this variable is set to 5 minutes.
totalCopies Read only Int Number of threads or copies of an instance.

Using the Action Variable

When a BP-Method is executed, multiple types of output can result from the execution. BP-Method execution status is indicated by the value of the predefined variable action.

Depending on the value of action, the engine responds accordingly and saves or undoes (commit or rollback) the changes invoked when the BP-Method is executed.

Valid values for the action variable

The valid values for the action variable are listed in the following sections.

Action.OK or Action.NONE


Action.FAIL


Note: A component exception is treated like action=FAIL by the engine. NO error is logged in the engine log. If you want to log a message, you will have to use the logMessage statement inside the Method before the failure.
Action.CANCEL

Action.RELEASE


Action.REPEAT


Action.ABORT


Note: Instances that are aborted cannot be recovered.
Note: The transaction is committed. Therefore, any change performed in the BP-method is persisted.

Action.BACK


Note: The transaction is committed. Therefore, any change performed in the BP-method is persisted.

Action.SKIP


Note: The transaction is committed. Therefore, any change performed in the BP-method is persisted.

Example: action variable

The following BP-Method example shows how you can manually set the action variable if a Boolean expression evaluates to true:
	if selectedButton == "Yes" then
	action = OK
	
	elseif selectedButton == "Abort" then
	action = ABORT
	
	else
	action = BACK
	

Using the result variable

The result variable contains the result that you set in the BP-Method. For example, you can set a result and in the outgoing conditional transition of the activity ask for that value. Further in the process this value will no longer be available. The result variable is persistent between calls to the BP-Methods and is reset when the instance has already flown through the corresponding transition to another activity.

As well if the action variable is not used in the BP-Method, the predefined variable result values are mapped to the variable action. For example, if the BP-Method has the line result = "fail", this is equivalent to action = Action.FAIL.

If the BP-Method uses the action variable, then the result can have any value, either predefined or not. For example:
	result = "release"; action = Action.FAIL'; 
	//in this case the BP-Method fails 
	result = "abort"; action = RELEASE'; 
	// in this case the BP-Method does not fail
	

The action variable is reset at every BP-Method invocation to the default value while the result variable is reset after the instance flows into the next activity.

Note: The predefined variable result is used to maintain compatibility to previous version.

Using the "timeout" variable

The timeout variable defines the time that a BP-Method has to complete its execution. If this time is exceeded, the Engine cancels the BP-Method execution and assumes that it has failed.

There is a maximum timeout defined for all BP-Methods of all processes within the engine. This value is defined in the Process Administrator or Studio Engine Preferences.

The timeout set within a BP-Method (timeout variable) cannot exceed the Maximum timeout set in the Process Administrator. If you set a greater value, a runtime exception is thrown and the BP-Method execution is aborted.

See Timeout for further information.

Examples

Case01: Suspend Action

Find the project ActionsCase01.fpr in the installation directory, in the studio/samples directory to study an example about handling the SUSPEND action and assigning the participant who suspended the instance.

To test this example, use the participant: test.