Process
Overview
Module
- package:
org.eclipse.dirigible.sdk.bpm - source: bpm/Process.java
Start, inspect, and steer Flowable process instances from Java code. The static helpers cover the everyday surface — starting a process by definition key, reading and writing instance variables, correlating message events. Anything beyond that (sub-process trees, history queries, advanced delegate state) is one step away through the underlying Flowable BpmProviderFlowable returned by getEngine().
Variables are exchanged as native Java values — strings, numbers, booleans, and JSON-friendly Maps land in Flowable's variable store unchanged. Use this together with the .bpmn synchronizer for steady-state processes; the Deployer helper covers programmatic deployment when you need it.
Key Features:
- Static facade — all methods are
public static; no instance to create. - Native value passing — variables flow as plain Java types into Flowable.
- Escape hatch —
getEngine()exposes the rawBpmProviderFlowablefor advanced cases.
Example Usage:
import org.eclipse.dirigible.sdk.bpm.Process;
import java.util.Map;
String instanceId = Process.start(
"order-fulfilment",
"ORDER-42",
"{\"customer\":\"acme\",\"amount\":1299.00}");
Process.setVariable(instanceId, "approver", "alice");
Object current = Process.getVariable(instanceId, "approver");
Process.correlateMessageEvent(instanceId, "payment-received", Map.of("txId", "T-7"));Methods
getEngine()
Returns the underlying Flowable provider for advanced use cases not covered by this facade.
javapublic static BpmProviderFlowable getEngine();Returns
- Type:
BpmProviderFlowable- Description: The raw Flowable engine the facade delegates to.
start()
Starts a new process instance for the given process-definition key.
javapublic static String start(String key, String businessKey, String parametersJson);
Parameter Type Description keyStringProcess-definition key (BPMN id).businessKeyStringApplication-level correlation id, typically a primary key from another table. parametersJsonStringJSON document whose top-level fields become the initial process variables. Returns
- Type:
String- Description: The newly created process-instance id.
setProcessInstanceName()
Updates the human-readable name of a running process instance.
javapublic static void setProcessInstanceName(String processInstanceId, String name);
Parameter Type Description processInstanceIdStringThe instance id returned by start.nameStringNew display name.
updateBusinessKey()
Changes the application-level correlation key on a running instance.
javapublic static void updateBusinessKey(String processInstanceId, String businessKey);
Parameter Type Description processInstanceIdStringThe instance id. businessKeyStringNew business key.
updateBusinessStatus()
Updates the business-status string carried alongside the instance.
javapublic static void updateBusinessStatus(String processInstanceId, String businessStatus);
Parameter Type Description processInstanceIdStringThe instance id. businessStatusStringNew status label.
getVariable()
Reads a single process variable.
javapublic static Object getVariable(String processInstanceId, String variableName);
Parameter Type Description processInstanceIdStringThe instance id. variableNameStringVariable to fetch. Returns
- Type:
Object- Description: The variable value, or
nullif not set.
getVariables()
Reads all process variables of an instance as a Map.
javapublic static Map<String, Object> getVariables(String processInstanceId);
Parameter Type Description processInstanceIdStringThe instance id. Returns
- Type:
Map<String, Object>- Description: All variables currently set on the instance.
setVariable()
Sets a single process variable.
javapublic static void setVariable(String processInstanceId, String variableName, Object value);
Parameter Type Description processInstanceIdStringThe instance id. variableNameStringVariable name. valueObjectNew value.
removeVariable()
Removes a process variable.
javapublic static void removeVariable(String processInstanceId, String variableName);
Parameter Type Description processInstanceIdStringThe instance id. variableNameStringVariable to remove.
correlateMessageEvent()
Delivers a message event with payload variables to all process instances waiting on a matching intermediate-message catch event. The execution is resumed transactionally.
javapublic static void correlateMessageEvent(String processInstanceId, String messageName, Map<String, Object> variables);
Parameter Type Description processInstanceIdStringThe instance id (or nullto broadcast to any matching instance).messageNameStringThe BPMN message name. variablesMap<String, Object>Payload promoted into process scope.