use of org.activiti.api.process.model.ProcessInstance in project Activiti by Activiti.
the class ProcessVariablesTest method cleanup.
@AfterEach
public void cleanup() {
securityUtil.logInAs("admin");
Page<ProcessInstance> processInstancePage = processAdminRuntime.processInstances(Pageable.of(0, 50));
for (ProcessInstance pi : processInstancePage.getContent()) {
processAdminRuntime.delete(ProcessPayloadBuilder.delete(pi.getId()));
}
clearEvents();
}
use of org.activiti.api.process.model.ProcessInstance in project Activiti by Activiti.
the class TaskVariablesTest method cleanup.
@AfterEach
public void cleanup() {
securityUtil.logInAs("admin");
Page<ProcessInstance> processInstancePage = processAdminRuntime.processInstances(Pageable.of(0, 50));
for (ProcessInstance pi : processInstancePage.getContent()) {
processAdminRuntime.delete(ProcessPayloadBuilder.delete(pi.getId()));
}
clearEvents();
}
use of org.activiti.api.process.model.ProcessInstance in project Activiti by Activiti.
the class BasicExclusiveGatewayTest method cleanup.
@AfterEach
public void cleanup() {
securityUtil.logInAs("admin");
Page<ProcessInstance> processInstancePage = processAdminRuntime.processInstances(Pageable.of(0, 50));
for (ProcessInstance pi : processInstancePage.getContent()) {
processAdminRuntime.delete(ProcessPayloadBuilder.delete(pi.getId()));
}
}
use of org.activiti.api.process.model.ProcessInstance in project Activiti by Activiti.
the class BasicCallActivityAndServiceTaskTest method shouldCheckCallActivityWaitingOnUserTask.
@Test
public void shouldCheckCallActivityWaitingOnUserTask() {
securityUtil.logInAs("user1");
ProcessInstance processInstance = processRuntime.start(ProcessPayloadBuilder.start().withProcessDefinitionKey(processKey).withBusinessKey("my-business-key").withName("my-process-instance-name").build());
// then
assertThat(processInstance).isNotNull();
assertThat(processInstance.getStatus()).isEqualTo(ProcessInstance.ProcessInstanceStatus.COMPLETED);
assertThat(processInstance.getBusinessKey()).isEqualTo("my-business-key");
assertThat(processInstance.getName()).isEqualTo("my-process-instance-name");
assertThat(RuntimeTestConfiguration.collectedEvents).extracting(RuntimeEvent::getEventType).containsExactly(ProcessRuntimeEvent.ProcessEvents.PROCESS_CREATED, ProcessRuntimeEvent.ProcessEvents.PROCESS_STARTED, BPMNActivityEvent.ActivityEvents.ACTIVITY_STARTED, BPMNActivityEvent.ActivityEvents.ACTIVITY_COMPLETED, BPMNSequenceFlowTakenEvent.SequenceFlowEvents.SEQUENCE_FLOW_TAKEN, BPMNActivityEvent.ActivityEvents.ACTIVITY_STARTED, ProcessRuntimeEvent.ProcessEvents.PROCESS_CREATED, ProcessRuntimeEvent.ProcessEvents.PROCESS_STARTED, BPMNActivityEvent.ActivityEvents.ACTIVITY_STARTED, BPMNActivityEvent.ActivityEvents.ACTIVITY_COMPLETED, BPMNSequenceFlowTakenEvent.SequenceFlowEvents.SEQUENCE_FLOW_TAKEN, BPMNActivityEvent.ActivityEvents.ACTIVITY_STARTED, BPMNActivityEvent.ActivityEvents.ACTIVITY_COMPLETED, BPMNSequenceFlowTakenEvent.SequenceFlowEvents.SEQUENCE_FLOW_TAKEN, BPMNActivityEvent.ActivityEvents.ACTIVITY_STARTED, BPMNActivityEvent.ActivityEvents.ACTIVITY_COMPLETED, ProcessRuntimeEvent.ProcessEvents.PROCESS_COMPLETED, BPMNActivityEvent.ActivityEvents.ACTIVITY_COMPLETED, BPMNSequenceFlowTakenEvent.SequenceFlowEvents.SEQUENCE_FLOW_TAKEN, BPMNActivityEvent.ActivityEvents.ACTIVITY_STARTED, BPMNActivityEvent.ActivityEvents.ACTIVITY_COMPLETED, ProcessRuntimeEvent.ProcessEvents.PROCESS_COMPLETED);
clearEvents();
}
use of org.activiti.api.process.model.ProcessInstance in project Activiti by Activiti.
the class ProcessRuntimeImpl method resume.
@Override
public ProcessInstance resume(ResumeProcessPayload resumeProcessPayload) {
ProcessInstance processInstance = processInstance(resumeProcessPayload.getProcessInstanceId());
checkUserCanWrite(processInstance.getProcessDefinitionKey());
runtimeService.activateProcessInstanceById(resumeProcessPayload.getProcessInstanceId());
return processInstanceConverter.from(runtimeService.createProcessInstanceQuery().processInstanceId(resumeProcessPayload.getProcessInstanceId()).singleResult());
}
Aggregations