Execution modes

The script declaration defines the execution mode for all instances of the script package as one of these choices:


Concurrent

In concurrent execution mode, the entry points for the same or different script instances of the script may be called concurrently. In other words, two or more script instances of the same type may run in parallel and even two or more entry points for a particular script instance may run in parallel (for example, the jobArrived and timerFired entry points).

For example, a flow containing a single flow element with a concurrent script (in addition to input/output folders) will pick up and process multiple input jobs at the same time – within the overall processing limits configured through user preferences.

Script implementations with concurrent execution mode must take care to synchronize access to resources that are shared between script instances or between different entry points. For example, access to a text file that is updated from both the jobArrived and timerFired entry points should be synchronized using the Environment.lock/unlockGlobalData() functions.

Serialized

In serialized execution mode, entry points for script instances in the same execution group are never called concurrently. In other words, script instances in the same execution group are executed one after another. Still, the entry points in script instances outside of the execution group may be executing in parallel with those in the group.

Script implementations that need to be serialized between each other (perhaps because they use a common external resource) should refer to the same execution group. Usually however a script implementation needs serialization only with itself. In that case, the execution group name should be unique to the script implementation.

Persistent

In persistent execution mode: