Scripts at Runtime

When an application runs under BPM, it produces work items. Each instance of the process that you have designed in TIBCO Business Studio starts with the initial task described in your process and follows the flow of processing that you have defined. The first work item that the process instance presents to the user, therefore, may correspond to the first user task defined in your process. Subsequent forms may be presented to the same user or to someone else.

The work items are assigned to users as described in Managing Work Using Organization Models. Each work item appears in the work list of the user to whom it is assigned. When the user opens that work item, they are presented with a form, or with the first of a series of forms, that enables them to process that user item.

Except in the very simplest of processes, the sequence of forms that the user is presented with, and the outcome of the work item, will depend on the conditional processing written into the application. That conditionality is governed by scripts. For example, a script could take information from fields completed in one work item and pass it to another, depending on the value of those fields.

In addition, scripts can include operations to create, update or delete data objects. Examples would include creating or updating a customer record, or a new insurance claim.

There are two categories of action scripts, one that has access to Work Manager data, and the other that has access to the Process Manager scripting object (see Scripts on Other Tasks). Action scripts can act directly on work items at run time and can use attributes of those work items as parameters.

The following types of action script are supported:

Types of Action Script Description
Open Work Item When a user opens a work item in a work list, any Open script defined for the event will run. If necessary this script can force a cancellation of the work item open and keep the work item in the work list.
Close Work Item When a user closes a work item in a work list (i.e. saves the state of the work item rather than completing it), any Close script defined for the event will run.
Submit Work Item When the work item is submitted, after all standard validations have run but before the task completion message is returned, any Submit script defined for the event will run. If necessary this script can force a cancellation of the work item submit and keep the work item open and with the end user.
Schedule Work Item When the work item is scheduled from an initiated activity, after all standard validations have run but before the task completion message is returned, any Schedule script defined for the event will run. If necessary this script can force a cancellation of the work item schedule and keep the work item open and with the end user.
Initiate Activity Initiates the user activity within the process that generated the work item.
Complete Activity Completes the user activity within the process that generated the work item.
Timeout Activity Executes when the user activity within the process that generated the work item times out.
Cancel Activity Executes when the user activity within the process that generated the work item is cancelled.