use of org.activiti.api.runtime.model.impl.ProcessInstanceImpl in project Activiti by Activiti.
the class ProcessAdminRuntimeImpl method setVariables.
@Override
public void setVariables(SetProcessVariablesPayload setProcessVariablesPayload) {
ProcessInstanceImpl processInstance = (ProcessInstanceImpl) processInstance(setProcessVariablesPayload.getProcessInstanceId());
processVariablesValidator.checkPayloadVariables(setProcessVariablesPayload, processInstance.getProcessDefinitionId());
runtimeService.setVariables(setProcessVariablesPayload.getProcessInstanceId(), setProcessVariablesPayload.getVariables());
}
use of org.activiti.api.runtime.model.impl.ProcessInstanceImpl in project Activiti by Activiti.
the class APIProcessInstanceConverter method from.
@Override
public ProcessInstance from(org.activiti.engine.runtime.ProcessInstance internalProcessInstance) {
ProcessInstanceImpl processInstance = new ProcessInstanceImpl();
processInstance.setId(internalProcessInstance.getId());
processInstance.setParentId(internalProcessInstance.getParentProcessInstanceId());
processInstance.setName(internalProcessInstance.getName());
processInstance.setProcessDefinitionId(internalProcessInstance.getProcessDefinitionId());
processInstance.setProcessDefinitionKey(internalProcessInstance.getProcessDefinitionKey());
processInstance.setProcessDefinitionVersion(internalProcessInstance.getProcessDefinitionVersion());
processInstance.setInitiator(internalProcessInstance.getStartUserId());
processInstance.setStartDate(internalProcessInstance.getStartTime());
processInstance.setProcessDefinitionKey(internalProcessInstance.getProcessDefinitionKey());
processInstance.setBusinessKey(internalProcessInstance.getBusinessKey());
processInstance.setStatus(calculateStatus(internalProcessInstance));
processInstance.setProcessDefinitionVersion(internalProcessInstance.getProcessDefinitionVersion());
processInstance.setAppVersion(Objects.toString(internalProcessInstance.getAppVersion(), null));
return processInstance;
}
use of org.activiti.api.runtime.model.impl.ProcessInstanceImpl in project Activiti by Activiti.
the class ProcessRuntimeImpl method setVariables.
@Override
public void setVariables(SetProcessVariablesPayload setProcessVariablesPayload) {
ProcessInstanceImpl processInstance = (ProcessInstanceImpl) processInstance(setProcessVariablesPayload.getProcessInstanceId());
checkUserCanWrite(processInstance.getProcessDefinitionKey());
processVariablesValidator.checkPayloadVariables(setProcessVariablesPayload, processInstance.getProcessDefinitionId());
runtimeService.setVariables(setProcessVariablesPayload.getProcessInstanceId(), setProcessVariablesPayload.getVariables());
}
use of org.activiti.api.runtime.model.impl.ProcessInstanceImpl in project Activiti by Activiti.
the class ProcessAdminRuntimeImpl method delete.
@Override
public ProcessInstance delete(DeleteProcessPayload deleteProcessPayload) {
ProcessInstanceImpl processInstance = (ProcessInstanceImpl) processInstance(deleteProcessPayload.getProcessInstanceId());
runtimeService.deleteProcessInstance(deleteProcessPayload.getProcessInstanceId(), deleteProcessPayload.getReason());
if (processInstance != null) {
processInstance.setStatus(ProcessInstance.ProcessInstanceStatus.CANCELLED);
return processInstance;
}
return null;
}
use of org.activiti.api.runtime.model.impl.ProcessInstanceImpl in project Activiti by Activiti.
the class ProcessRuntimeImpl method delete.
@Override
public ProcessInstance delete(DeleteProcessPayload deleteProcessPayload) {
ProcessInstanceImpl processInstance = (ProcessInstanceImpl) processInstance(deleteProcessPayload.getProcessInstanceId());
checkUserCanWrite(processInstance.getProcessDefinitionKey());
runtimeService.deleteProcessInstance(deleteProcessPayload.getProcessInstanceId(), deleteProcessPayload.getReason());
processInstance.setStatus(ProcessInstance.ProcessInstanceStatus.CANCELLED);
return processInstance;
}
Aggregations