use of org.camunda.bpm.engine.runtime.EventSubscription in project camunda-bpm-platform by camunda.
the class ConditionalStartEventTest method testStartInstanceWithBeanCondition.
@Test
public void testStartInstanceWithBeanCondition() {
List<EventSubscription> eventSubscriptions = runtimeService.createEventSubscriptionQuery().list();
assertEquals(1, eventSubscriptions.size());
assertEquals(EventType.CONDITONAL.name(), eventSubscriptions.get(0).getEventType());
List<ProcessInstance> instances = runtimeService.createConditionEvaluation().setVariable("foo", 1).evaluateStartConditions();
assertEquals(1, instances.size());
assertNotNull(runtimeService.createProcessInstanceQuery().processDefinitionKey("conditionalEventProcess").singleResult());
VariableInstance vars = runtimeService.createVariableInstanceQuery().singleResult();
assertEquals(vars.getProcessInstanceId(), instances.get(0).getId());
assertEquals(1, vars.getValue());
}
use of org.camunda.bpm.engine.runtime.EventSubscription in project camunda-bpm-platform by camunda.
the class MultiTenancyExecutionPropagationTest method testPropagateTenantIdToIntermediateSignalEventSubscription.
public void testPropagateTenantIdToIntermediateSignalEventSubscription() {
deploymentForTenant(TENANT_ID, Bpmn.createExecutableProcess(PROCESS_DEFINITION_KEY).startEvent().intermediateCatchEvent().signal("start").endEvent().done());
startProcessInstance(PROCESS_DEFINITION_KEY);
EventSubscription eventSubscription = runtimeService.createEventSubscriptionQuery().singleResult();
assertThat(eventSubscription, is(notNullValue()));
// inherit the tenant id from process instance
assertThat(eventSubscription.getTenantId(), is(TENANT_ID));
}
use of org.camunda.bpm.engine.runtime.EventSubscription in project camunda-bpm-platform by camunda.
the class MultiTenancyExecutionPropagationTest method testPropagateTenantIdToStartSignalEventSubscription.
public void testPropagateTenantIdToStartSignalEventSubscription() {
deploymentForTenant(TENANT_ID, Bpmn.createExecutableProcess(PROCESS_DEFINITION_KEY).startEvent().signal("start").endEvent().done());
// the event subscription of the signal start event is created on deployment
EventSubscription eventSubscription = runtimeService.createEventSubscriptionQuery().singleResult();
assertThat(eventSubscription, is(notNullValue()));
// inherit the tenant id from process definition
assertThat(eventSubscription.getTenantId(), is(TENANT_ID));
}
use of org.camunda.bpm.engine.runtime.EventSubscription in project camunda-bpm-platform by camunda.
the class MultiTenancyExecutionPropagationTest method testPropagateTenantIdToIntermediateMessageEventSubscription.
public void testPropagateTenantIdToIntermediateMessageEventSubscription() {
deploymentForTenant(TENANT_ID, Bpmn.createExecutableProcess(PROCESS_DEFINITION_KEY).startEvent().intermediateCatchEvent().message("start").endEvent().done());
startProcessInstance(PROCESS_DEFINITION_KEY);
EventSubscription eventSubscription = runtimeService.createEventSubscriptionQuery().singleResult();
assertThat(eventSubscription, is(notNullValue()));
// inherit the tenant id from process instance
assertThat(eventSubscription.getTenantId(), is(TENANT_ID));
}
use of org.camunda.bpm.engine.runtime.EventSubscription in project camunda-bpm-platform by camunda.
the class MultiTenancyExecutionPropagationTest method testPropagateTenantIdToCompensationEventSubscription.
public void testPropagateTenantIdToCompensationEventSubscription() {
deploymentForTenant(TENANT_ID, "org/camunda/bpm/engine/test/api/multitenancy/compensationBoundaryEvent.bpmn");
startProcessInstance(PROCESS_DEFINITION_KEY);
// the event subscription is created after execute the activity with the attached compensation boundary event
EventSubscription eventSubscription = runtimeService.createEventSubscriptionQuery().singleResult();
assertThat(eventSubscription, is(notNullValue()));
// inherit the tenant id from process instance
assertThat(eventSubscription.getTenantId(), is(TENANT_ID));
}
Aggregations