Examples of AbductiveQuery


Examples of org.drools.core.rule.AbductiveQuery

        if ( ruleDescr instanceof QueryDescr ) {
            AnnotationDescr abductive = ruleDescr.getAnnotation( Abductive.class.getSimpleName() );
            if ( abductive == null ) {
                this.rule = new Query( ruleDescr.getName() );
            } else {
                this.rule = new AbductiveQuery( ruleDescr.getName(), abductive.getValue( "mode" ) );
            }
        } else {
            this.rule = new Rule(ruleDescr.getName());
        }
        this.rule.setPackage(pkg.getName());
View Full Code Here

Examples of org.drools.core.rule.AbductiveQuery

            RightTuple rightTuple = createResultRightTuple(resultHandle, resultLeftTuple, dquery.isOpen());

            boolean pass = true;
            if ( query.isAbductive() ) {
                int numArgs = dquery.getElements().length;
                AbductiveQuery aq = (( AbductiveQuery) query );
                for ( int j = 0; j < numArgs; j++ ) {
                    if ( dquery.getElements()[ j ] != null ) {
                        objects[ j ] = dquery.getElements()[ j ];
                    }
                }
                Object abduced = aq.abduce( Arrays.copyOfRange( objects, 0, numArgs - 1 ) );
                if ( abduced != null ) {
                    EqualityKey key = ( (NamedEntryPoint) workingMemory.getEntryPoint( workingMemory.getEntryPointId() ) ).getTruthMaintenanceSystem().get( abduced );
                    InternalFactHandle handle;
                    if ( key != null ) {
                        handle = key.getFactHandle();
View Full Code Here

Examples of org.drools.core.rule.AbductiveQuery

        if ( ruleDescr instanceof QueryDescr ) {
            Abductive abductive = ruleDescr.getTypedAnnotation( Abductive.class );
            if ( abductive == null ) {
                this.rule = new QueryImpl( ruleDescr.getName() );
            } else {
                this.rule = new AbductiveQuery( ruleDescr.getName(), abductive.mode() );
            }
        } else {
            this.rule = new RuleImpl(ruleDescr.getName());
        }
        this.rule.setPackage(pkg.getName());
View Full Code Here

Examples of org.drools.core.rule.AbductiveQuery

            RightTuple rightTuple = createResultRightTuple(resultHandle, resultLeftTuple, dquery.isOpen());

            boolean pass = true;
            if ( query.isAbductive() ) {
                int numArgs = dquery.getElements().length;
                AbductiveQuery aq = (( AbductiveQuery) query );
                for ( int j = 0; j < numArgs; j++ ) {
                    if ( dquery.getElements()[ j ] != null ) {
                        objects[ j ] = dquery.getElements()[ j ];
                    }
                }
                Object abduced = aq.abduce( Arrays.copyOfRange( objects, 0, numArgs - 1 ) );
                if ( abduced != null ) {
                    EqualityKey key = ( (NamedEntryPoint) workingMemory.getEntryPoint( workingMemory.getEntryPointId() ) ).getTruthMaintenanceSystem().get( abduced );
                    InternalFactHandle handle = null;
                    if ( key != null ) {
                        handle = key.getFactHandle();
                        abduced = handle.getObject();
                    } else {
                        handle = (InternalFactHandle) ((InternalWorkingMemoryActions) workingMemory).insert( abduced,
                                                                                                             aq.getValue(),
                                                                                                             false,
                                                                                                             true,
                                                                                                             query,
                                                                                                             (RuleTerminalNodeLeftTuple) resultLeftTuple );
                    }
View Full Code Here

Examples of org.drools.core.rule.AbductiveQuery

            RightTuple rightTuple = createResultRightTuple(resultHandle, resultLeftTuple, dquery.isOpen());

            boolean pass = true;
            if ( query.isAbductive() ) {
                int numArgs = dquery.getElements().length;
                AbductiveQuery aq = (( AbductiveQuery) query );
                for ( int j = 0; j < numArgs; j++ ) {
                    if ( dquery.getElements()[ j ] != null ) {
                        objects[ j ] = dquery.getElements()[ j ];
                    }
                }
                Object abduced = aq.abduce( Arrays.copyOfRange( objects, 0, numArgs - 1 ) );
                if ( abduced != null ) {
                    EqualityKey key = ( (NamedEntryPoint) workingMemory.getEntryPoint( workingMemory.getEntryPointId() ) ).getTruthMaintenanceSystem().get( abduced );
                    InternalFactHandle handle = null;
                    if ( key != null ) {
                        handle = key.getFactHandle();
                        abduced = handle.getObject();
                    } else {
                        handle = (InternalFactHandle) ((InternalWorkingMemoryActions) workingMemory).insert( abduced,
                                                                                                             aq.getValue(),
                                                                                                             false,
                                                                                                             true,
                                                                                                             query,
                                                                                                             (RuleTerminalNodeLeftTuple) resultLeftTuple );
                    }
View Full Code Here

Examples of org.drools.core.rule.AbductiveQuery

        if ( ruleDescr instanceof QueryDescr ) {
            AnnotationDescr abductive = ruleDescr.getAnnotation( Abductive.class.getSimpleName() );
            if ( abductive == null ) {
                this.rule = new QueryImpl( ruleDescr.getName() );
            } else {
                this.rule = new AbductiveQuery( ruleDescr.getName(), abductive.getValue( "mode" ) );
            }
        } else {
            this.rule = new RuleImpl(ruleDescr.getName());
        }
        this.rule.setPackage(pkg.getName());
View Full Code Here

Examples of org.drools.core.rule.AbductiveQuery

            RightTuple rightTuple = createResultRightTuple(resultHandle, resultLeftTuple, dquery.isOpen());

            boolean pass = true;
            if ( query.isAbductive() ) {
                int numArgs = dquery.getElements().length;
                AbductiveQuery aq = (( AbductiveQuery) query );
                for ( int j = 0; j < numArgs; j++ ) {
                    if ( dquery.getElements()[ j ] != null ) {
                        objects[ j ] = dquery.getElements()[ j ];
                    }
                }
                Object abduced = aq.abduce( Arrays.copyOfRange( objects, 0, numArgs - 1 ) );
                if ( abduced != null ) {
                    EqualityKey key = ( (NamedEntryPoint) workingMemory.getEntryPoints().get( workingMemory.getEntryPointId() ) ).getTruthMaintenanceSystem().get( abduced );
                    InternalFactHandle handle = null;
                    if ( key != null ) {
                        handle = key.getFactHandle();
                        abduced = handle.getObject();
                    } else {
                        handle = (InternalFactHandle) ((InternalWorkingMemoryActions) workingMemory).insert( abduced,
                                                                                                             aq.getValue(),
                                                                                                             false,
                                                                                                             true,
                                                                                                             query,
                                                                                                             (RuleTerminalNodeLeftTuple) resultLeftTuple );
                    }
View Full Code Here

Examples of org.drools.core.rule.AbductiveQuery

            RightTuple rightTuple = createResultRightTuple(resultHandle, resultLeftTuple, dquery.isOpen());

            boolean pass = true;
            if ( query.isAbductive() ) {
                int numArgs = dquery.getElements().length;
                AbductiveQuery aq = (( AbductiveQuery) query );
                for ( int j = 0; j < numArgs; j++ ) {
                    if ( dquery.getElements()[ j ] != null ) {
                        objects[ j ] = dquery.getElements()[ j ];
                    }
                }
                Object abduced = aq.abduce( Arrays.copyOfRange( objects, 0, numArgs - 1 ) );
                if ( abduced != null ) {
                    EqualityKey key = ( (NamedEntryPoint) workingMemory.getEntryPoint( workingMemory.getEntryPointId() ) ).getTruthMaintenanceSystem().get( abduced );
                    InternalFactHandle handle;
                    if ( key != null ) {
                        handle = key.getFactHandle();
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.