Package org.kie.runtime

Examples of org.kie.runtime.StatefulKnowledgeSession


    public void setIdentifier(String identifier) {
        this.identifier = identifier;
    }

    public Object execute(Context context) {
        StatefulKnowledgeSession ksession = ((KnowledgeCommandContext) context).getStatefulKnowledgesession();

        Object object = ksession.getGlobal( identifier );
        ExecutionResultImpl results = ((StatefulKnowledgeSessionImpl) ksession).session.getExecutionResult();
        if ( results != null ) {
            results.getResults().put( (this.outIdentifier != null) ? this.outIdentifier : this.identifier,
                                      object );
        }
View Full Code Here


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

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

public class GetEnvironmentCommand
    implements
    GenericCommand<Environment> {

    public Environment execute(Context context) {
        StatefulKnowledgeSession ksession = ((KnowledgeCommandContext) context).getStatefulKnowledgesession();
        return ksession.getEnvironment();
    }
View Full Code Here

public class DisposeCommand
    implements
    GenericCommand<Void> {

    public Void execute(Context context) {
        StatefulKnowledgeSession ksession = ((KnowledgeCommandContext) context).getStatefulKnowledgesession();
        ksession.dispose();
        return null;
    }
View Full Code Here

    public RemoveEventListenerCommand(ProcessEventListener listener) {
        this.processEventListener = listener;
    }

    public Object execute(Context context) {
        StatefulKnowledgeSession ksession = ((KnowledgeCommandContext) context).getStatefulKnowledgesession();
        if ( workingMemoryEventListener != null ) {
            ksession.removeEventListener( workingMemoryEventListener );
        } else if ( agendaEventListener != null ) {
            ksession.removeEventListener( agendaEventListener );
        } else {
            ksession.removeEventListener( processEventListener );
        }
        return null;
    }
View Full Code Here

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

    public Collection execute(Context context) {
        StatefulKnowledgeSession ksession = ((KnowledgeCommandContext) context).getStatefulKnowledgesession();
       
        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 setName(String name) {
        this.name = name;
    }

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

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

    public Object execute(Context context) {
        StatefulKnowledgeSession ksession = ((KnowledgeCommandContext) context).getStatefulKnowledgesession();
        ksession.getWorkingMemoryEntryPoint( handle.getEntryPointId() ).retract( handle );
        return null;
    }
View Full Code Here

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

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

import org.kie.runtime.StatefulKnowledgeSession;

public class ClearAgendaCommand implements GenericCommand<Object> {

    public Void execute(Context context) {
        StatefulKnowledgeSession ksession = ((KnowledgeCommandContext) context).getStatefulKnowledgesession();
        ksession.getAgenda().clear();
        return null;
    }
View Full Code Here

TOP

Related Classes of org.kie.runtime.StatefulKnowledgeSession

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.