use of org.jbpm.process.instance.event.listeners.RuleAwareProcessEventLister in project jbpm by kiegroup.
the class IntermediateEventTest method testIntermediateCatchEventConditionRemovePIAfter.
@Test
public void testIntermediateCatchEventConditionRemovePIAfter() throws Exception {
KieBase kbase = createKnowledgeBase("BPMN2-IntermediateCatchEventCondition.bpmn2");
ksession = createKnowledgeSession(kbase);
ksession.addEventListener(new RuleAwareProcessEventLister());
ProcessInstance processInstance = ksession.startProcess("IntermediateCatchEvent");
assertProcessInstanceActive(processInstance);
ksession = restoreSession(ksession, true);
ksession.addEventListener(new RuleAwareProcessEventLister());
Collection<? extends Object> processInstances = ksession.getObjects(new ObjectFilter() {
@Override
public boolean accept(Object object) {
if (object instanceof ProcessInstance) {
return true;
}
return false;
}
});
assertThat(processInstances).isNotNull();
assertThat(processInstances.size()).isEqualTo(1);
// now activate condition
Person person = new Person();
person.setName("Jack");
ksession.insert(person);
assertProcessInstanceFinished(processInstance, ksession);
processInstances = ksession.getObjects(new ObjectFilter() {
@Override
public boolean accept(Object object) {
if (object instanceof ProcessInstance) {
return true;
}
return false;
}
});
assertThat(processInstances).isNotNull();
assertThat(processInstances.size()).isEqualTo(0);
}
use of org.jbpm.process.instance.event.listeners.RuleAwareProcessEventLister in project jbpm by kiegroup.
the class ActivityTest method testBusinessRuleTask.
@Test
@RequirePersistence(false)
public void testBusinessRuleTask() throws Exception {
KieBase kbase = createKnowledgeBaseWithoutDumper("BPMN2-BusinessRuleTask.bpmn2", "BPMN2-BusinessRuleTask.drl");
ksession = createKnowledgeSession(kbase);
ksession.addEventListener(new RuleAwareProcessEventLister());
ProcessInstance processInstance = ksession.startProcess("BPMN2-BusinessRuleTask");
assertProcessInstanceFinished(processInstance, ksession);
}
use of org.jbpm.process.instance.event.listeners.RuleAwareProcessEventLister in project jbpm by kiegroup.
the class ActivityTest method testBusinessRuleTaskWithPersistence.
@Test
@RequirePersistence(true)
public void testBusinessRuleTaskWithPersistence() throws Exception {
KieBase kbase = createKnowledgeBaseWithoutDumper("BPMN2-BusinessRuleTask.bpmn2", "BPMN2-BusinessRuleTask.drl");
ksession = createKnowledgeSession(kbase);
ksession.addEventListener(new RuleAwareProcessEventLister());
ProcessInstance processInstance = ksession.startProcess("BPMN2-BusinessRuleTask");
ksession = restoreSession(ksession, true);
ksession.addEventListener(new RuleAwareProcessEventLister());
assertProcessInstanceFinished(processInstance, ksession);
}
Aggregations