This operation builds a remove-process-variables command payload. Use it to remove one or more variables from a process instance.
The base command is:
processPayloadBuilder.removeVariables()
You can use the following options:
| Option | Description |
|---|---|
| withProcessInstance(processInstance: ProcessInstance) | Specifies the process instance from which to remove variables. |
| withProcessInstanceId(processInstanceId: string) | Specifies the ID of the process instance from which to remove variables. |
| withVariableNames(variableName: string) | Removes a single process variable. |
| withVariableNames(variableNames: string[]) | Removes multiple process variables. |
The following is the command example:
processPayloadBuilder
.removeVariables()
.withProcessInstanceId(variables.processInstanceId)
.withVariableNames('draft')
.build();
processPayloadBuilder.removeVariables() creates a remove-process-variables payload builder. withProcessInstanceId(variables.processInstanceId) specifies the target process instance using the value stored in the processInstanceId process variable. withVariableNames('draft') removes the draft process variable from the process instance. build() creates the final command payload.