Predefined Variables

Provides a listing and description of Predefined Variables.

Predefined variables are global to all parts of the process and, just as their name implies, they 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.

Predefined Variable Reference

The following table lists the 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 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.

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 Action Variable.

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. The following table lists the valid values for the Action Variable:
action = Description Result
OK

NONE

Indicates that BP-Method execution was successful. This is the default value. BP-Method changes to "completed" status. If the activity is marked auto-complete on its Activity Properties dialog box, the instance flows to the next activity according to transition rules. Otherwise, the instance waits in WorkSpace for further processing in the activity or for the user to click the Send icon.
FAIL Indicates that the BP-Method has failed its execution. The BP-Method must be executed again, if it is so required. The error is logged in the Process Administrator log (in the Enterprise Edition) or it can be visualized at the bottom of Studio, in the Log tab. If a rollback BP-Method is included, it is executed. If the rollback BP-Method fails, the Engine will retry the original BP-Method until it succeeds or invokes the maximum number of retry times and is routed to an exception activity. The maximum number of retry times is set in the Process Administrator or in the Engine Properties in Studio. See Engine Properties.
Note: A component exception is treated like Action=FAIL by the Engine.
CANCEL BP-Method execution is aborted. The instance is rolled back to the point before BP-Method execution. No trace of the BP-Method failure or execution appears in the Audit Trail.

Can be used in activities of Interactive, Grab or Global Creation type.

If the activity type is any other (i.e., Automatic, etc.), this value is ignored, as if it had never been set.

If the activity type is Join, the original instance will be released and all the active copies will be aborted.

REPEAT Indicates that the BP-Method execution is ignored. The instance is committed. However, the task's status remains in a pending state. BP-Method should be executed again.

If the activity type is Interactive or Grab REPEAT indicates that, although the task was successfully executed, it will remain pending. Therefore, the participant will be able to execute it again. Note that if the task is Mandatory, the participant will have to execute it repeatedly until the task appears as completed.

If the activity type is any other (i.e., Global, Automatic, etc.), this value is ignored, as if it had never been set.

RELEASE Ends the BP-Method execution. The instance is released to the next activity without processing any of the BP-Methods in the current activity, even if they are marked mandatory.

If the activity type is Interactive, Grab or Automatic the instance is released to the next activity without processing any of the BP-Methods in the current activity, even if they are marked Mandatory.

If the activity type is any other (i.e., Global, etc.), this value is ignored, as if it had never been set.

ABORT Ends BP-Method execution and aborts the entire instance. The instance is not processed and is sent directly to the End activity.Warning:Instances that are aborted cannot be recovered.

Used in activities of Interactive, Grab or Automatic type.

Used in activities of Join type. The original instance will be aborted and therefore, all copies will be aborted.

Aborts the instance. The instance is sent to the End activity and marked as aborted.

BACK Ends BP-Method execution and sends the instance back to the activity where the exception occurred. Used in an exception handling activity to send an instance back to the activity where the exception occurred. If the exception can be corrected, fix it in the exception handling activity before sending it back.

Used in activities of Interactive, Automatic and Grab type, when they are in an exception handling flow.

If the activity type is any other (i.e., Global, etc.) or the activity is not an exceptions handler, this value is ignored, as if it had never been set.

Within procedures or atomic groups, the instance goes back to the Begin activity of the procedure or the group.

Note: The transaction is committed. Therefore, any change performed in the BP-method is persisted.
SKIP Ends BP-Method execution and sends the instance back to the activity where the exception occurred and skips it. Used in an exception handling activity to send an instance back to an activity in the process. The instance goes to the point of BP-Method failure and is released to the next activity without re-performing the BP-Method that caused the failure, even if the BP-Method task is marked mandatory on the Implementation dialog box.

Used in activities of Interactive or Automatic type, when they are exceptions handlers.

If the activity type is any other (i.e., Grab, Global, etc.) or the activity was not an exceptions handler, this value will be ignored as if it had never been set.

Within procedures and atomic groups, the instance goes to the next activity that follows within the procedure or group.

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

Action Variable Example

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
	

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.

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.

Suspend Action Example

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.