}
ExecutionManager executionManager = commandContext.getExecutionManager();
TaskManager taskManager = commandContext.getTaskManager();
SuspensionState suspensionState = getNewSuspensionState();
if (processInstanceId != null) {
executionManager.updateExecutionSuspensionStateByProcessInstanceId(processInstanceId, suspensionState);
taskManager.updateTaskSuspensionStateByProcessInstanceId(processInstanceId, suspensionState);
} else
if (processDefinitionId != null) {
executionManager.updateExecutionSuspensionStateByProcessDefinitionId(processDefinitionId, suspensionState);
taskManager.updateTaskSuspensionStateByProcessDefinitionId(processDefinitionId, suspensionState);
} else
if (processDefinitionKey != null) {
executionManager.updateExecutionSuspensionStateByProcessDefinitionKey(processDefinitionKey, suspensionState);
taskManager.updateTaskSuspensionStateByProcessDefinitionKey(processDefinitionKey, suspensionState);
}
getSetJobStateCmd().execute(commandContext);
PropertyChange propertyChange = new PropertyChange(SUSPENSION_STATE_PROPERTY, null, suspensionState.getName());
commandContext.getOperationLogManager()
.logProcessInstanceOperation(getLogEntryOperation(), processInstanceId, processDefinitionId,
processDefinitionKey, propertyChange);
return null;