Package org.kie.runtime

Examples of org.kie.runtime.KieSession


    public void setName(String name) {
        this.name = name;
    }

    public Void execute(Context context) {
        KieSession ksession = ((KnowledgeCommandContext) context).getKieSession();
        ksession.getAgenda().getAgendaGroup( this.name ).clear();
        return null;
    }
View Full Code Here


    public void setCorrelationKey(CorrelationKey correlationKey) {
        this.correlationKey = correlationKey;
    }

    public ProcessInstance execute(Context context) {
        KieSession ksession = ((KnowledgeCommandContext) context).getKieSession();

        if (data != null) {
            for (Object o: data) {
                ksession.insert(o);
            }
        }
        ProcessInstance processInstance = ((CorrelationAwareProcessRuntime)ksession).startProcess(processId, correlationKey, parameters);
        if ( this.outIdentifier != null ) {
            ((ExecutionResultImpl) ((KnowledgeCommandContext) context).getExecutionResults()).getResults().put(this.outIdentifier,
View Full Code Here

    public String getFactHandleFromString() {
        return factHandle.toExternalForm();
    }

    public Object execute(Context context) {
        KieSession ksession = ((KnowledgeCommandContext) context).getKieSession();
       
        Object object = ksession.getObject( factHandle );
       
        if (this.outIdentifier != null) {
            ((StatefulKnowledgeSessionImpl)ksession).session.getExecutionResult()
                .getResults().put( this.outIdentifier, object );
        }
View Full Code Here

    public void setCorrelationKey(CorrelationKey correlationKey) {
        this.correlationKey = correlationKey;
    }

    public ProcessInstance execute(Context context) {
        KieSession ksession = ((KnowledgeCommandContext) context).getKieSession();
        if (correlationKey == null) {
            return null;
        }
        return ((CorrelationAwareProcessRuntime)ksession).getProcessInstance(correlationKey);
    }
View Full Code Here

        this.filter = filter;
        this.outIdentifier = outIdentifier;
    }

    public Collection execute(Context context) {
        KieSession ksession = ((KnowledgeCommandContext) context).getKieSession();
       
        Collection col = null;
       
        if ( filter != null ) {
           
            col =  ksession.getObjects( this.filter );
        } else {
            col =  ksession.getObjects( );
        }
       
        if ( this.outIdentifier != null ) {
            List objects = new ArrayList( col );
           
View Full Code Here

    public void setProcessInstanceId(Long processInstanceId) {
        this.processInstanceId = processInstanceId;
    }

    public ProcessInstance execute(Context context) {
        KieSession ksession = ((KnowledgeCommandContext) context).getKieSession();
        ProcessInstance processInstance = (ProcessInstance) ksession.startProcessInstance(processInstanceId);
        return processInstance;
    }
View Full Code Here

    public void setName(String name) {
        this.name = name;
    }

    public Void execute(Context context) {
        KieSession ksession = ((KnowledgeCommandContext) context).getKieSession();
        ksession.getAgenda().getActivationGroup( this.name ).clear();
        return null;
    }
View Full Code Here

public class GetProcessEventListenersCommand
    implements
    GenericCommand<Collection<ProcessEventListener> > {

    public Collection<ProcessEventListener> execute(Context context) {
        KieSession ksession = ((KnowledgeCommandContext) context).getKieSession();
        return ksession.getProcessEventListeners();
    }
View Full Code Here

    public DeleteCommand(FactHandle handle) {
        this.handle = DisconnectedFactHandle.newFrom( handle );
    }

    public Object execute(Context context) {
        KieSession ksession = ((KnowledgeCommandContext) context).getKieSession();
        ksession.getEntryPoint( handle.getEntryPointId() ).retract( handle );
        return null;
    }
View Full Code Here

public class GetAgendaEventListenersCommand
    implements
    GenericCommand<Collection<AgendaEventListener>> {

    public Collection<AgendaEventListener> execute(Context context) {
        KieSession ksession = ((KnowledgeCommandContext) context).getKieSession();
        return ksession.getAgendaEventListeners();
    }
View Full Code Here

TOP

Related Classes of org.kie.runtime.KieSession

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.