Operations and access to process data

Operations and access to process data


API

interface ProcessApi {
  correlateMessage(messageName: string, processVariables?: { [key: string]: string }) 
  // Sends messages to the process, optionally process variables can be provided

  setAccessGroups(groupNames: string[]) 
  // Sets the list of groups that have access to the process instance on the case list
}

Operational context

The API is available from the object api.process.v1 and operates in the context of the current process. Process identifier:

  • For forms started by the platform within a process — filled in automatically.

  • For resumed processes (e.g. via the #/process) endpoint — you must pass the variable router_process_id (must be mapped by injectable fields).

  • For script tasks — unconditionally required.


Reference to another process

It is possible to refer to another process, however caution must be exercised — this operation is error-prone.

Each time you must ensure that the process identifier comes from a trusted source.

The API for such a case is available at:

where processInstanceId is the identifier of the process instance you want to refer to.

Availability: The API is available only in:

  • scripts,

  • script validators,

  • script tasks.


Usage examples

1. correlateMessage()

Sending a message named MESSAGE_NAME

Sending a message with setting a process variable

Sending a message to a specific process

Sending a message to a specific process with multiple variables


2. setAccessGroups()

Description of operation

The method grants additional access to view the case (process instance) on the case list.

  • The group must have been previously granted the permission feature_process_list.

  • The method overwrites all previously assigned groups.

Usage example

To reset access groups, you must overwrite the current values with an empty list.


More:

You can find more details in the Case list configuration section of the platform documentation.

Last updated

Was this helpful?