Operations and access to process data
Process data operations and access
API
interface ProcessApi {
v1: {
// Sends messages to the process; process variables can optionally be passed
correlateMessage(messageName: string, processVariables?: { [key: string]: string });
// Sets the list of groups that have access to the process instance in the cases list
setAccessGroups(groupNames: string[]);
// Starts a new process based on the process definition key; business key and process variables can optionally be passed. Returns the process instance identifier.
startProcess(definitionKey: string, data?: StartProcessOptions): string;
// Allows you to reference another process based on its instance identifier. Enables operations on that process, such as sending messages or setting access groups.
byInstanceId(processInstanceId): ProcessApi.v1;
// Returns process information such as its key, name, instance identifier, business key
getProcessInfo(): ProcessInfo;
// Returns information about the current user task, such as its key, name, identifier
getUserTaskInfo(): UserTaskInfo;
}
}
interface StartProcessOptions {
// Optional business key for the new process instance
businessKey?: string;
// Optional process variables for the new process instance
variables?: { [key: string]: string };
}
interface ProcessInfo {
// Returns the process instance identifier
id(): string;
// Returns the process definition key
definitionKey(): string;
// Returns the process name, if set
name(): string | null;
// Returns the process business key, if set
businessKey(): string | null;
}
interface UserTaskInfo {
// Returns the user task identifier
id(): string;
// Returns the user task definition key
definitionKey(): string;
// Returns the user task name
name(): string;
}Execution context
Reference to another process
Usage examples
1. correlateMessage()
correlateMessage()2. setAccessGroups()
setAccessGroups()Starting a new process
Retrieving process information
Retrieving user task information
Additional information
Last updated
Was this helpful?
