use of org.kie.api.runtime.process.ProcessInstance in project drools by kiegroup.
the class CreateProcessInstanceCommand 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.createProcessInstance(processId, parameters);
if (this.outIdentifier != null) {
((RegistryContext) context).lookup(ExecutionResultImpl.class).setResult(this.outIdentifier, processInstance.getId());
}
return processInstance;
}
use of org.kie.api.runtime.process.ProcessInstance 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.kie.api.runtime.process.ProcessInstance 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.kie.api.runtime.process.ProcessInstance 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.kie.api.runtime.process.ProcessInstance 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