use of org.drools.core.command.impl.RegistryContext in project drools by kiegroup.
the class GetProcessInstancesCommand method execute.
public Collection<ProcessInstance> execute(Context context) {
KieSession ksession = ((RegistryContext) context).lookup(KieSession.class);
Collection<ProcessInstance> instances = ksession.getProcessInstances();
Collection<ProcessInstance> result = new ArrayList<ProcessInstance>();
for (ProcessInstance instance : instances) {
result.add(instance);
}
return result;
}
use of org.drools.core.command.impl.RegistryContext in project drools by kiegroup.
the class RegisterWorkItemHandlerCommand method execute.
public Void execute(Context context) {
KieSession ksession = ((RegistryContext) context).lookup(KieSession.class);
ksession.getWorkItemManager().registerWorkItemHandler(workItemName, handler);
return null;
}
use of org.drools.core.command.impl.RegistryContext in project drools by kiegroup.
the class StartProcessCommand 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 = (ProcessInstance) ksession.startProcess(processId, 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 AgendaGroupSetFocusCommand method execute.
public Void execute(Context context) {
KieSession ksession = ((RegistryContext) context).lookup(KieSession.class);
ksession.getAgenda().getAgendaGroup(this.name).setFocus();
return null;
}
use of org.drools.core.command.impl.RegistryContext in project drools by kiegroup.
the class ClearAgendaCommand method execute.
public Void execute(Context context) {
KieSession ksession = ((RegistryContext) context).lookup(KieSession.class);
ksession.getAgenda().clear();
return null;
}
Aggregations