use of org.drools.core.runtime.rule.impl.LiveQueryImpl in project drools by kiegroup.
the class StatefulKnowledgeSessionImpl method openLiveQuery.
public LiveQuery openLiveQuery(final String query, final Object[] arguments, final ViewChangedEventListener listener) {
try {
startOperation();
this.lock.lock();
this.kBase.executeQueuedActions();
agenda.executeFlush();
DroolsQuery queryObject = new DroolsQuery(query, arguments, new OpenQueryViewChangedEventListenerAdapter(listener), true, null, null, null, null, null);
InternalFactHandle handle = this.handleFactory.newFactHandle(queryObject, null, this, this);
final PropagationContext pCtx = pctxFactory.createPropagationContext(getNextPropagationIdCounter(), PropagationContext.Type.INSERTION, null, null, handle, getEntryPoint());
evalQuery(queryObject.getName(), queryObject, handle, pCtx, false);
return new LiveQueryImpl(this, handle);
} finally {
this.lock.unlock();
endOperation();
}
}
Aggregations