Package org.drools.runtime.pipeline

Examples of org.drools.runtime.pipeline.StatelessKnowledgeSessionPipelineContext


    implements
    KnowledgeRuntimeCommand {

    public void receive(Object object,
                        PipelineContext context) {
        StatelessKnowledgeSessionPipelineContext kContext = (StatelessKnowledgeSessionPipelineContext) context;

        StatelessKnowledgeSessionResults results = null;
        if ( kContext.getObject() != null ) {
            if ( kContext.getParameters() == null || ((ParametersImpl) kContext.getParameters()).isEmpty() ) {
                kContext.getStatelessKnowledgeSession().executeObject( kContext.getObject() );
            } else {
                results = kContext.getStatelessKnowledgeSession().executeObjectWithParameters( kContext.getObject(),
                                                                                               kContext.getParameters() );
            }
        } else if ( kContext.getIterable() != null ) {
            if ( kContext.getParameters() == null || ((ParametersImpl) kContext.getParameters()).isEmpty()  ) {
                kContext.getStatelessKnowledgeSession().executeIterable( kContext.getIterable() );
            } else {
                results = kContext.getStatelessKnowledgeSession().executeIterableWithParameters( kContext.getIterable(),
                                                                                                 kContext.getParameters() );
            }
        } else {
            if ( kContext.getParameters() == null || ((ParametersImpl) kContext.getParameters()).isEmpty() ) {
                kContext.getStatelessKnowledgeSession().executeObject( object );
            } else {
                results = kContext.getStatelessKnowledgeSession().executeObjectWithParameters( object,
                                                                                               kContext.getParameters() );
            }
        }
       
        context.setResult( results );
       
View Full Code Here

TOP

Related Classes of org.drools.runtime.pipeline.StatelessKnowledgeSessionPipelineContext

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.