Search in sources :

Example 1 with BPMNActivity

use of org.activiti.api.process.model.BPMNActivity in project Activiti by Activiti.

the class SignalThrowCatchTest method testProcessWithThrowSignal.

@Test
public void testProcessWithThrowSignal() {
    securityUtil.logInAs("user1");
    ProcessInstance processInstance = startThrowSignalProcess();
    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, BPMNActivityEvent.ActivityEvents.ACTIVITY_COMPLETED, BPMNSequenceFlowTakenEvent.SequenceFlowEvents.SEQUENCE_FLOW_TAKEN, BPMNActivityEvent.ActivityEvents.ACTIVITY_STARTED, BPMNActivityEvent.ActivityEvents.ACTIVITY_COMPLETED, ProcessRuntimeEvent.ProcessEvents.PROCESS_COMPLETED);
    assertThat(RuntimeTestConfiguration.collectedEvents).filteredOn(event -> event.getEventType().equals(BPMNActivityEvent.ActivityEvents.ACTIVITY_STARTED)).filteredOn(event -> ((BPMNActivity) event.getEntity()).getActivityType().equals("throwEvent")).extracting(event -> ((BPMNActivity) event.getEntity()).getActivityType(), event -> ((BPMNActivity) event.getEntity()).getProcessInstanceId()).contains(tuple("throwEvent", processInstance.getId()));
}
Also used : VariableEvent(org.activiti.api.model.shared.event.VariableEvent) BPMNSequenceFlowTakenEvent(org.activiti.api.process.model.events.BPMNSequenceFlowTakenEvent) BeforeEach(org.junit.jupiter.api.BeforeEach) Pageable(org.activiti.api.runtime.shared.query.Pageable) ProcessRuntimeEvent(org.activiti.api.process.model.events.ProcessRuntimeEvent) Assertions.assertThat(org.assertj.core.api.Assertions.assertThat) Autowired(org.springframework.beans.factory.annotation.Autowired) RuntimeTestConfiguration(org.activiti.spring.conformance.util.RuntimeTestConfiguration) ProcessPayloadBuilder(org.activiti.api.process.model.builders.ProcessPayloadBuilder) ProcessRuntime(org.activiti.api.process.runtime.ProcessRuntime) SignalPayload(org.activiti.api.process.model.payloads.SignalPayload) SecurityUtil(org.activiti.spring.conformance.util.security.SecurityUtil) TaskRuntimeEvent(org.activiti.api.task.model.events.TaskRuntimeEvent) ProcessInstance(org.activiti.api.process.model.ProcessInstance) Assertions.tuple(org.assertj.core.api.Assertions.tuple) RuntimeEvent(org.activiti.api.model.shared.event.RuntimeEvent) BPMNActivityEvent(org.activiti.api.process.model.events.BPMNActivityEvent) BPMNActivityImpl(org.activiti.api.runtime.model.impl.BPMNActivityImpl) Page(org.activiti.api.runtime.shared.query.Page) BPMNSignalReceivedEvent(org.activiti.api.process.model.events.BPMNSignalReceivedEvent) Test(org.junit.jupiter.api.Test) BPMNSignalEvent(org.activiti.api.process.model.events.BPMNSignalEvent) AfterEach(org.junit.jupiter.api.AfterEach) SpringBootTest(org.springframework.boot.test.context.SpringBootTest) BPMNActivity(org.activiti.api.process.model.BPMNActivity) ProcessAdminRuntime(org.activiti.api.process.runtime.ProcessAdminRuntime) BPMNActivity(org.activiti.api.process.model.BPMNActivity) ProcessInstance(org.activiti.api.process.model.ProcessInstance) Test(org.junit.jupiter.api.Test) SpringBootTest(org.springframework.boot.test.context.SpringBootTest)

Aggregations

RuntimeEvent (org.activiti.api.model.shared.event.RuntimeEvent)1 VariableEvent (org.activiti.api.model.shared.event.VariableEvent)1 BPMNActivity (org.activiti.api.process.model.BPMNActivity)1 ProcessInstance (org.activiti.api.process.model.ProcessInstance)1 ProcessPayloadBuilder (org.activiti.api.process.model.builders.ProcessPayloadBuilder)1 BPMNActivityEvent (org.activiti.api.process.model.events.BPMNActivityEvent)1 BPMNSequenceFlowTakenEvent (org.activiti.api.process.model.events.BPMNSequenceFlowTakenEvent)1 BPMNSignalEvent (org.activiti.api.process.model.events.BPMNSignalEvent)1 BPMNSignalReceivedEvent (org.activiti.api.process.model.events.BPMNSignalReceivedEvent)1 ProcessRuntimeEvent (org.activiti.api.process.model.events.ProcessRuntimeEvent)1 SignalPayload (org.activiti.api.process.model.payloads.SignalPayload)1 ProcessAdminRuntime (org.activiti.api.process.runtime.ProcessAdminRuntime)1 ProcessRuntime (org.activiti.api.process.runtime.ProcessRuntime)1 BPMNActivityImpl (org.activiti.api.runtime.model.impl.BPMNActivityImpl)1 Page (org.activiti.api.runtime.shared.query.Page)1 Pageable (org.activiti.api.runtime.shared.query.Pageable)1 TaskRuntimeEvent (org.activiti.api.task.model.events.TaskRuntimeEvent)1 RuntimeTestConfiguration (org.activiti.spring.conformance.util.RuntimeTestConfiguration)1 SecurityUtil (org.activiti.spring.conformance.util.security.SecurityUtil)1 Assertions.assertThat (org.assertj.core.api.Assertions.assertThat)1