use of org.drools.core.command.impl.RegistryContext in project drools by kiegroup.
the class ClearRuleFlowGroupCommand method execute.
public Void execute(Context context) {
KieSession ksession = ((RegistryContext) context).lookup(KieSession.class);
((StatefulKnowledgeSessionImpl) ksession).getAgenda().getRuleFlowGroup(this.name).clear();
return null;
}
use of org.drools.core.command.impl.RegistryContext in project drools by kiegroup.
the class GetEntryPointCommand method execute.
public EntryPoint execute(Context context) {
KieSession ksession = ((RegistryContext) context).lookup(KieSession.class);
EntryPoint ep = ksession.getEntryPoint(name);
if (ep == null) {
return null;
}
EntryPointCreator epCreator = (EntryPointCreator) context.get(EntryPointCreator.class.getName());
return epCreator != null ? epCreator.getEntryPoint(name) : ep;
}
use of org.drools.core.command.impl.RegistryContext in project drools by kiegroup.
the class GetFactHandleCommand method execute.
public FactHandle execute(Context context) {
KieSession ksession = ((RegistryContext) context).lookup(KieSession.class);
InternalFactHandle factHandle = (InternalFactHandle) ksession.getFactHandle(object);
if (factHandle != null) {
InternalFactHandle handle = factHandle.clone();
if (disconnected) {
handle.disconnect();
}
return handle;
}
return null;
}
use of org.drools.core.command.impl.RegistryContext in project drools by kiegroup.
the class StartCorrelatedProcessCommand method execute.
public ProcessInstance execute(Context context) {
KieSession ksession = ((RegistryContext) context).lookup(KieSession.class);
if (data != null) {
for (Object o : data) {
ksession.insert(o);
}
}
ProcessInstance processInstance = ((CorrelationAwareProcessRuntime) ksession).startProcess(processId, correlationKey, parameters);
if (this.outIdentifier != null) {
((RegistryContext) context).lookup(ExecutionResultImpl.class).setResult(this.outIdentifier, processInstance.getId());
}
return processInstance;
}
use of org.drools.core.command.impl.RegistryContext in project drools by kiegroup.
the class StartProcessInstanceCommand method execute.
public ProcessInstance execute(Context context) {
KieSession ksession = ((RegistryContext) context).lookup(KieSession.class);
ProcessInstance processInstance = (ProcessInstance) ksession.startProcessInstance(processInstanceId);
return processInstance;
}
Aggregations