Implementing Script Tasks

You can create a script task in a process using the Script Task icon on the TIBCO Business Studio palette.

See the TIBCO Business Studio Modeling User's Guide for information on how to create tasks.

When a business analyst creates a process, they may include in the script task a plain text description of the desired behavior of the script. It is then part of the solution designer’s task, with the Solution Design capability switched on, to enter JavaScript in order to implement the script task.

In the Properties view for a Script Task, you can select from the available script grammars, and enter a script that will be executed at runtime. Which script grammars are displayed depends on the Destination Environment and the Eclipse capability you have selected. For example, for the BPM Destination Environment with the Solution Design capability selected, you can enter JavaScript:

Note:
  • Clicking Hide Implementation Details switches off the Solution Design capability and displays the view which the business analyst would have.
  • On the General tab, there may already be a text description of the required script. This description will be preserved as it is (and will usually contain a number of error markers) if you select JavaScript from the Script Defined As list. If you select Unspecified from the Script Defined As list, the description is lost. You can however recover the description by pressing Ctrl + Z.

Enter the script itself in the Describe Task Script: area. This area supports text editing assistance, as described in Editing Scripts.

In addition to the main script for the task, which you enter in the Describe Task Script: area of the General tab as described above, you can create further scripts in the same way as described for other types of task in Scripts on Other Tasks. You enter these on the Scripts tab from the Process Manager Scripts selection. For a Script task, you can enter the following types of additional script:

  • Initiate
  • Complete
  • Timeout