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 variablerouter_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.
Note: The function setAccessGroups() does not support calls from api.process.v1.byInstanceId.
Usage examples
1. correlateMessage()
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()
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.
If previously the group GROUP_TEST, and we execute the code below, access will be granted only to the groups specified in the method (GROUP_1 and GROUP_2).
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?
