use of org.activiti.api.process.model.ProcessInstance in project Activiti by Activiti.
the class APIProcessInstanceConverterTest method should_convertFromInternalProcessInstance_when_appVersionIsNotSet.
@Test
public void should_convertFromInternalProcessInstance_when_appVersionIsNotSet() {
ExecutionEntity internalProcessInstance = anInternalProcessInstance(null);
ProcessInstance result = subject.from(internalProcessInstance);
assertValidProcessInstanceResult(result, null);
}
use of org.activiti.api.process.model.ProcessInstance in project Activiti by Activiti.
the class APIProcessInstanceConverterTest method should_convertFromInternalProcessInstance_when_withCompletedStatus.
@Test
public void should_convertFromInternalProcessInstance_when_withCompletedStatus() {
ExecutionEntity internalProcessInstance = anInternalProcessInstance(APP_VERSION);
internalProcessInstance.setEnded(true);
ProcessInstance result = subject.from(internalProcessInstance);
assertValidProcessInstanceResult(result);
assertThat(result.getStatus()).isEqualTo(ProcessInstanceStatus.COMPLETED);
}
use of org.activiti.api.process.model.ProcessInstance in project Activiti by Activiti.
the class APIProcessInstanceConverterTest method should_convertFromInternalProcessInstance_when_withSuspendedStatus.
@Test
public void should_convertFromInternalProcessInstance_when_withSuspendedStatus() {
ExecutionEntity internalProcessInstance = anInternalProcessInstance(APP_VERSION);
internalProcessInstance.setSuspensionState(SuspensionState.SUSPENDED.getStateCode());
ProcessInstance result = subject.from(internalProcessInstance);
assertValidProcessInstanceResult(result);
assertThat(result.getStatus()).isEqualTo(ProcessInstanceStatus.SUSPENDED);
}
use of org.activiti.api.process.model.ProcessInstance in project Activiti by Activiti.
the class ProcessRuntimeImpl method suspend.
@Override
public ProcessInstance suspend(SuspendProcessPayload suspendProcessPayload) {
ProcessInstance processInstance = processInstance(suspendProcessPayload.getProcessInstanceId());
checkUserCanWrite(processInstance.getProcessDefinitionKey());
runtimeService.suspendProcessInstanceById(suspendProcessPayload.getProcessInstanceId());
return processInstanceConverter.from(runtimeService.createProcessInstanceQuery().processInstanceId(suspendProcessPayload.getProcessInstanceId()).singleResult());
}
use of org.activiti.api.process.model.ProcessInstance in project Activiti by Activiti.
the class TaskRuntimeMultiInstanceIT method sequentialMultiInstance_should_collectOutputValues.
@Test
public void sequentialMultiInstance_should_collectOutputValues() {
ProcessInstance processInstance = processBaseRuntime.startProcessWithProcessDefinitionKey("miSequentialUserTasksOutputCollection");
List<Task> tasks = taskBaseRuntime.getTasks(processInstance);
assertThat(tasks).hasSize(1);
taskBaseRuntime.completeTask(tasks.get(0), singletonMap("meal", "pizza"));
tasks = taskBaseRuntime.getTasks(processInstance);
assertThat(tasks).hasSize(1);
taskBaseRuntime.completeTask(tasks.get(0), singletonMap("meal", "pasta"));
List<VariableInstance> variables = processBaseRuntime.getVariables(processInstance);
assertThat(variables).extracting(VariableInstance::getName, VariableInstance::getValue).contains(tuple("meals", asList("pizza", "pasta")));
}
Aggregations