Package org.drools.ide.common.client.modeldriven.brl

Examples of org.drools.ide.common.client.modeldriven.brl.ActionInsertFact


                FactPattern factPattern = model.getModel().getLHSBoundFact( v );
                if ( factPattern.getFactType().equals( this.parameterType ) ) {
                    createButton = true;
                }
            } else {
                ActionInsertFact factPattern = model.getModel().getRHSBoundFact( v );
                if ( factPattern.factType.equals( this.parameterType ) ) {
                    createButton = true;
                }
            }
            if ( createButton == true ) {
View Full Code Here


        //Setup RHS
        model.rhs = new IAction[2];

        //Both fields are Template Keys
        ActionInsertFact aif0 = new ActionInsertFact( "AIF0" );
        ActionFieldValue aif0f0 = new ActionFieldValue( "AIF0F0",
                                                        "AIF0F0Value",
                                                        SuggestionCompletionEngine.TYPE_STRING );
        aif0f0.setNature( BaseSingleFieldConstraint.TYPE_TEMPLATE );
        aif0.addFieldValue( aif0f0 );
        ActionFieldValue aif0f1 = new ActionFieldValue( "AIF0F1",
                                                        "AIF0F1Value",
                                                        SuggestionCompletionEngine.TYPE_STRING );
        aif0f1.setNature( BaseSingleFieldConstraint.TYPE_TEMPLATE );
        aif0.addFieldValue( aif0f1 );
        model.rhs[0] = aif0;

        //Dependent enumerations
        ActionInsertFact aif1 = new ActionInsertFact( "Fact" );
        ActionFieldValue aif1f0 = new ActionFieldValue( "field1",
                                                        "AIF1F0Value",
                                                        SuggestionCompletionEngine.TYPE_STRING );
        aif1f0.setNature( BaseSingleFieldConstraint.TYPE_TEMPLATE );
        aif1.addFieldValue( aif1f0 );
        ActionFieldValue aif1f1 = new ActionFieldValue( "field2",
                                                        "AIF1F1Value",
                                                        SuggestionCompletionEngine.TYPE_STRING );
        aif1f1.setNature( BaseSingleFieldConstraint.TYPE_TEMPLATE );
        aif1.addFieldValue( aif1f1 );
        ActionFieldValue aif1f2 = new ActionFieldValue( "field3",
                                                        "AIF1F2Value",
                                                        SuggestionCompletionEngine.TYPE_STRING );
        aif1f2.setNature( BaseSingleFieldConstraint.TYPE_TEMPLATE );
        aif1.addFieldValue( aif1f2 );
        model.rhs[1] = aif1;

        //---Setup data---
        data = new DynamicData();
        data.addRow();
View Full Code Here

                                                             ac.getBoundName() );
                    if ( a == null ) {
                        a = new LabelledAction();
                        a.boundName = ac.getBoundName();
                        if ( !ac.isInsertLogical() ) {
                            ActionInsertFact ins = new ActionInsertFact( ac.getFactType() );
                            ins.setBoundName( ac.getBoundName() );
                            a.action = ins;
                        } else {
                            ActionInsertLogicalFact ins = new ActionInsertLogicalFact( ac.getFactType() );
                            ins.setBoundName( ac.getBoundName() );
                            a.action = ins;
                        }
                        actions.add( a );
                    }
                    ActionInsertFact ins = (ActionInsertFact) a.action;
                    ActionFieldValue val = new ActionFieldValue( ac.getFactField(),
                                                                 cell,
                                                                 ac.getType() );
                    ins.addFieldValue( val );
                } else if ( c instanceof ActionRetractFactCol52 ) {
                    ActionRetractFactCol52 rf = (ActionRetractFactCol52) c;
                    LabelledAction a = findByLabelledAction( actions,
                                                             rf.getBoundName() );
                    if ( a == null ) {
View Full Code Here

                this.fieldCompletions = completions.getFieldCompletions( FieldAccessorsAndMutators.MUTATOR,
                                                                         type );
                this.variableClass = type;
                this.isBoundFact = true;
            } else {
                ActionInsertFact patternRhs = mod.getModel().getRHSBoundFact( set.variable );
                if ( patternRhs != null ) {
                    this.fieldCompletions = completions.getFieldCompletions( FieldAccessorsAndMutators.MUTATOR,
                                                                             patternRhs.factType );
                    this.variableClass = patternRhs.factType;
                    this.isBoundFact = true;
View Full Code Here

        /*
         * add the bound variable of the rhs
         */
        List<String> vars2 = model.getModel().getRHSBoundFacts();
        for ( String v : vars2 ) {
            ActionInsertFact factPattern = model.getModel().getRHSBoundFact( v );
            if ( factPattern.factType.equals( this.methodParameter.type ) ) {
                // First selection is empty
                if ( listVariable.getItemCount() == 0 ) {
                    listVariable.addItem( "..." );
                }
View Full Code Here

                FactPattern factPattern = model.getModel().getLHSBoundFact( v );
                if ( factPattern.getFactType().equals( this.parameterType ) ) {
                    createButton = true;
                }
            } else {
                ActionInsertFact factPattern = model.getModel().getRHSBoundFact( v );
                if ( factPattern.factType.equals( this.parameterType ) ) {
                    createButton = true;
                }
            }
            if ( createButton == true ) {
View Full Code Here

                    bindings.add( v );
                }
            }

            //RHS ActionInsertFact
            ActionInsertFact aif = modeller.getModel().getRHSBoundFact( v );
            if ( aif != null ) {
                if ( isRHSFieldTypeEquivalent( v ) ) {
                    bindings.add( v );
                }
            }
View Full Code Here

            } else {
                /*
                 * if the call method is applied on a bound variable created in
                 * the rhs
                 */
                ActionInsertFact patternRhs = mod.getModel().getRHSBoundFact( set.variable );
                if ( patternRhs != null ) {
                    List<String> methodList = completions.getMethodNames( patternRhs.factType );
                    fieldCompletionTexts = new String[methodList.size()];
                    fieldCompletionValues = new String[methodList.size()];
                    int i = 0;
View Full Code Here

                    bindings.add( v );
                }
            }

            //RHS ActionInsertFact
            ActionInsertFact aif = model.getModel().getRHSBoundFact( v );
            if ( aif != null ) {
                if ( isRHSFieldTypeEquivalent( v ) ) {
                    bindings.add( v );
                }
            }
View Full Code Here

            } else if ( col instanceof BRLActionColumn ) {
                BRLActionColumn brl = (BRLActionColumn) col;
                for ( IAction a : brl.getDefinition() ) {
                    if ( a instanceof ActionInsertFact ) {
                        ActionInsertFact action = (ActionInsertFact) a;
                        if ( action.isBound() ) {
                            variables.add( action.getBoundName() );
                        }
                    }
                }
            }
        }
View Full Code Here

TOP

Related Classes of org.drools.ide.common.client.modeldriven.brl.ActionInsertFact

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.