An instance of the Activity component represents an activity in a process. Use the Activity component to get an activity's properties, such as role participants, runtime properties, process details, and so on.
The most common use of this component is as the variable activity, which is predefined in every process. The value of this predefined variable represents the activity in the process for which the current code is being executed.
The following example obtains general information about the current activity that is being executed. The predefined instance variable activity is used:
loc = Fuego.Locale.locale
logMessage "Name: " + activity.name +
"\nLabel: " + activity.label +
"\nDescription: " + activity.description +
"\nLabel in english: " + getLabel(activity, locale : loc) +
"\nDocumentation" + activity.documentation
The following example obtains properties of the current activity.
When your code is in a Global or in a BPM Object method (and not in the regular Process method), you do not have access to the activity predefined variable. When this is the case, it is still possible to get a reference to the current activity by using the default instance of the Activity component, which you access with Activity (uppercase 'A'):
logMessage "ACTIVITY: " + Activity.name +
"\nAutocomplete: " + Activity.autoComplete +
"\nAutomatic: " + Activity.automatic +
"\nLevel: " + Activity.level +
"\nSuspendable: " + Activity.suspendable +
"\nDoes User select transition: " + Activity.userSelectsTransition
The following example obtains design properties of the current activity:
logMessage "ACTIVITY: " + Activity.name +
"\nDoes the activity have multiple transitions?: " + Activity.hasMultipleTransitions +
"\nProcess: " + Activity.process.name +
"\nRole: " + Activity.role.name
The following example obtains runtime properties of the current activity:
logMessage "ACTIVITY: " + Activity.name +
"\nDeadline: " + Activity.deadline +
"\nDoes this activity have instances: " + Activity.hasItems +
"\nPrevious Activity: " + Activity.source
The following example obtains the participants who are assigned to the current activity's role:
logMessage "Activity: "+activity.name+" in role "+Activity.role.name
for each p in Activity.role.participants
do
logMessage "Participant "+p.id+"("+p.name+")"
end
The following example obtains the label and other properties of a different activity in the current process:
myActivityId = "exampleId" myActivity = Activity(myActivityId) logMessage "Activity: " + myActivity.label logMessage "Is this activity automatic?: " + myActivity.automatic