Using Scripts

This section describes how to use scripts.

Note: The JavaScript and Data Mapper script grammars are only available when both the Solution Design capability is selected and the BPM destination environment is specified for the current project.

You can specify scripts in TIBCO Business Studio for use with BPM projects in several ways:

Another form of scripting is the use of expressions to define a participant in a task. See Using a Participant Expression to Define a Participant for details of participant expressions.

Scripts may be entered in TIBCO Business Studio as:

  • Plain text. When a business analyst creates a process, they may include a plain text description of the desired behavior of any scripts that form part of the process. These plain text entries are not intended to be executable.
  • JavaScript. Executable scripts are written in JavaScript. If an analyst has entered a plain text description, it is then part of the solution designer’s role, with the Solution Design capability switched on, to enter JavaScript in order to implement the script.

    TIBCO Business Studio supports a subset of standard JavaScript:

    • Those standard JavaScript facilities that are not supported in TIBCO Business Studio scripts are described in JavaScript Exclusions.
    • Some additional facilities are available. These are described in Editing Scripts and ’Script Functions’ in the Business Data Services Guide.
  • Data Mapper. For simple transfer of data between different process data, it may be easier to create scripts with Data Mapper instead of writing them in JavaScript. With Data Mapper, you can graphically map data across datafields and parameters to create complex BOM objects from a combination of process data fields and parameters. This script grammar is available for Script Tasks, Task scripts, Web Services, Call Sub-Processes, and Catch error events. For more information, see Data Mapping and Mapping Contents in Data Mapper.

Different script types can be used as shown in the table below. For each activity type, there are script types that are:

  • Supported.
  • Available in the user interface but not supported.
Action scripts supported by different activity types
Activity Type Script Types
User Task Supported: Open, Close, Submit, Schedule, Reschedule, Initiate, Complete, Timeout, Cancel
Manual Task

Service Task

Send Task

Receive Task

Reference Task

Call Sub-process Activity

Embedded Sub-process Activity

Supported: Initiate, Complete, Timeout, Cancel
Script Task Supported: Initiate, Complete, Timeout

In user interface but not supported: Cancel

Pageflow User Task Supported: Initiate, Complete

In user interface but not supported: Open, Close, Submit, Schedule

Multi-instance Task - Multi-instance Loop Supported: Loop Expression, Complex Exit Expression, Additional Instances Expression
Multi-instance Task - Standard Loop Supported: Loop Condition
Start Event Supported: Complete
End Event Supported: Initiate
Intermediate Event Supported: Initiate, Complete, Cancel