use of org.drools.core.command.impl.RegistryContext in project drools by kiegroup.
the class RegisterChannelCommand method execute.
public Void execute(Context context) {
KieSession ksession = ((RegistryContext) context).lookup(KieSession.class);
ksession.registerChannel(name, channel);
return null;
}
use of org.drools.core.command.impl.RegistryContext in project drools by kiegroup.
the class CreateCorrelatedProcessInstanceCommand 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).createProcessInstance(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 GetWorkItemIdsCommand method execute.
public List<Long> execute(Context context) {
KieSession ksession = ((RegistryContext) context).lookup(KieSession.class);
Set<WorkItem> workItems = ((WorkItemManager) ksession.getWorkItemManager()).getWorkItems();
List<Long> workItemIds = new ArrayList<Long>(workItems.size());
for (WorkItem workItem : workItems) {
workItemIds.add(workItem.getId());
}
return workItemIds;
}
Aggregations