Java源码示例:org.kie.api.event.rule.ObjectDeletedEvent
示例1
@Test
public void testEventModel() throws Exception {
final KieBase kbase = SerializationHelper.serializeObject(loadKnowledgeBase("test_EventModel.drl"));
final KieSession wm = createKnowledgeSession(kbase);
final RuleRuntimeEventListener wmel = mock(RuleRuntimeEventListener.class);
wm.addEventListener(wmel);
final Cheese stilton = new Cheese("stilton", 15);
final FactHandle stiltonHandle = wm.insert(stilton);
final ArgumentCaptor<ObjectInsertedEvent> oic = ArgumentCaptor.forClass(org.kie.api.event.rule.ObjectInsertedEvent.class);
verify(wmel).objectInserted(oic.capture());
assertSame(stiltonHandle, oic.getValue().getFactHandle());
wm.update(stiltonHandle, stilton);
final ArgumentCaptor<org.kie.api.event.rule.ObjectUpdatedEvent> ouc = ArgumentCaptor.forClass(org.kie.api.event.rule.ObjectUpdatedEvent.class);
verify(wmel).objectUpdated(ouc.capture());
assertSame(stiltonHandle, ouc.getValue().getFactHandle());
wm.delete(stiltonHandle);
final ArgumentCaptor<ObjectDeletedEvent> orc = ArgumentCaptor.forClass(ObjectDeletedEvent.class);
verify(wmel).objectDeleted(orc.capture());
assertSame(stiltonHandle, orc.getValue().getFactHandle());
}
示例2
@Override
public void objectDeleted(final ObjectDeletedEvent event) {
if ((handleFilter == null && classFilter == null)
|| event.getFactHandle() == handleFilter
|| event.getOldObject().getClass().equals(classFilter)) {
log.trace("Retraction: " + DroolsUtil.objectDetails(event.getOldObject()));
}
}
示例3
@Override
public void objectDeleted(final ObjectDeletedEvent event) {
if ((handleFilter == null && classFilter == null)
|| event.getFactHandle() == handleFilter
|| event.getOldObject().getClass().equals(classFilter)) {
deletions.add(event);
allEvents.add(event);
log.trace("Retraction: " + DroolsUtil.objectDetails(event.getOldObject()));
}
}
示例4
@Override
public void objectDeleted(ObjectDeletedEvent event) {
retractEvents.add(event);
}
示例5
/**
* @see org.kie.api.event.rule.RuleRuntimeEventListener
*/
public void objectDeleted(final ObjectDeletedEvent event) {
filterLogEvent( new ObjectLogEvent( LogEvent.RETRACTED,
((InternalFactHandle) event.getFactHandle()).getId(),
event.getOldObject().toString() ) );
}
示例6
@Override
public void objectDeleted(ObjectDeletedEvent event) {
this.data.objectsDeleted.incrementAndGet();
}
示例7
public void objectDeleted(final ObjectDeletedEvent event) {
// intentionally left blank
}
示例8
public void objectDeleted(ObjectDeletedEvent event) {
logger.info( event.toString() );
}
示例9
public void objectDeleted(final ObjectDeletedEvent event) {
this.deleted++;
}
示例10
@Override
public void objectDeleted(ObjectDeletedEvent event) {
log.debug(event);
}
示例11
public List<ObjectDeletedEvent> getRetractions() {
return deletions;
}
示例12
/**
* @see RuleRuntimeEventListener#objectDeleted(org.kie.api.event.rule.ObjectDeletedEvent)
*/
@Override
public void objectDeleted(ObjectDeletedEvent event) {
log.info("objectDeleted {}", event);
}
示例13
/**
* @see RuleRuntimeEventListener#objectDeleted(org.kie.api.event.rule.ObjectDeletedEvent)
*/
@Override
public void objectDeleted(ObjectDeletedEvent event) {
log.info("objectDeleted {}", event);
}
示例14
/**
* @see RuleRuntimeEventListener#objectDeleted(org.kie.api.event.rule.ObjectDeletedEvent)
*/
@Override
public void objectDeleted(ObjectDeletedEvent event) {
log.info("objectDeleted {}", event);
}