Search in sources :

Example 1 with ProcessInstanceImpl

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());
}
Also used : ProcessInstanceImpl(org.activiti.api.runtime.model.impl.ProcessInstanceImpl)

Example 2 with ProcessInstanceImpl

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;
}
Also used : ProcessInstanceImpl(org.activiti.api.runtime.model.impl.ProcessInstanceImpl)

Example 3 with ProcessInstanceImpl

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());
}
Also used : ProcessInstanceImpl(org.activiti.api.runtime.model.impl.ProcessInstanceImpl)

Example 4 with ProcessInstanceImpl

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;
}
Also used : ProcessInstanceImpl(org.activiti.api.runtime.model.impl.ProcessInstanceImpl)

Example 5 with ProcessInstanceImpl

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;
}
Also used : ProcessInstanceImpl(org.activiti.api.runtime.model.impl.ProcessInstanceImpl)

Aggregations

ProcessInstanceImpl (org.activiti.api.runtime.model.impl.ProcessInstanceImpl)9 Test (org.junit.jupiter.api.Test)3 ProcessInstance (org.activiti.api.process.model.ProcessInstance)2 ProcessInstanceQuery (org.activiti.engine.runtime.ProcessInstanceQuery)2 CreateProcessInstancePayload (org.activiti.api.process.model.payloads.CreateProcessInstancePayload)1 StartProcessPayload (org.activiti.api.process.model.payloads.StartProcessPayload)1 UpdateProcessPayload (org.activiti.api.process.model.payloads.UpdateProcessPayload)1 ProcessDefinitionImpl (org.activiti.api.runtime.model.impl.ProcessDefinitionImpl)1 ExecutionEntityImpl (org.activiti.engine.impl.persistence.entity.ExecutionEntityImpl)1 ProcessInstanceBuilder (org.activiti.engine.runtime.ProcessInstanceBuilder)1