Script Tasks API

The platform provides the ability to create logic for script tasks (handlers) from within Eximee Designer. The process designer only needs to write the handler logic and attach it in the process.

Creating a script task

We can create and edit script tasks using the Eximee Designer application. To do this, in the Library module select the Script tasks:

Illustration 1. Script tasks tab window

A detailed description of creating scripts is available in: Script tasks.

handler API

Setting the list of groups that will have access to the process instance in the case list

Operations and access to process data

Example script tasks

The script retrieves the variable with the identifier "testVariable", multiplies it by itself, and assigns the result to a new variable "result":

Calling REST services in a script task

Call documentation: [Rest] Calling external REST services (ScriptCode)

Example of a script task that calls an external REST service:

Retrieving business application configuration

Call documentation: Scripts (scriptService)#Retrievingapplicationconfiguration

Example of a script task that retrieves configuration:

Calling Eximee Status in the ScriptCode Handler

Status API

Example ScriptCodeHandler calling eximee-status:

Retrieving Content contents

Functionality available from platform version: 3.332.0

From a script task you can retrieve the content of an artifact Content (textContent) created in Eximee Designerusing the function: api.repository.v1.textContent. This function returns an object that has contents for each defined translation. To get the content for a given translation we use the languagefunction. Example usage:

If we are not sure that the parameters we provided are correct, we can handle exceptions using try catch:

Data model

More information in Data model API

Saving data in the data model

In script tasks we can save data to the model using the 'complete' method; the first parameter saves data to the process, and the second parameter saves data to the model:

Last updated

Was this helpful?