Package org.drools.workbench.models.commons.shared.rule

Examples of org.drools.workbench.models.commons.shared.rule.ActionInsertFact


                    bindings.add( v );
                }
            }

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


                             "INS" + item );
            cmds.put( "INS" + item,
                      new Command() {

                          public void execute() {
                              model.addRhsItem( new ActionInsertFact( item ),
                                                Integer.parseInt( positionCbo.getValue( positionCbo.getSelectedIndex() ) ) );
                              hide();
                          }
                      } );
        }
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.getFactType().equals( this.methodParameter.getType() ) ) {
                // First selection is empty
                if ( listVariable.getItemCount() == 0 ) {
                    listVariable.addItem( "..." );
                }
                listVariable.addItem( v );
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.getFactType().equals( this.parameterType ) ) {
                    createButton = true;
                }
            }
            if ( createButton == true ) {
                form.addAttribute( Constants.INSTANCE.BoundVariable() + ":",
View Full Code Here

                this.fieldCompletions = completions.getFieldCompletions( FieldAccessorsAndMutators.MUTATOR,
                                                                         type );
                this.variableClass = type;
                this.isBoundFact = true;
            } else {
                ActionInsertFact patternRhs = mod.getModel().getRHSBoundFact( set.getVariable() );
                if ( patternRhs != null ) {
                    this.fieldCompletions = completions.getFieldCompletions( FieldAccessorsAndMutators.MUTATOR,
                                                                             patternRhs.getFactType() );
                    this.variableClass = patternRhs.getFactType();
                    this.isBoundFact = true;
                }
            }
        }
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.getVariable() );
                if ( patternRhs != null ) {
                    List<String> methodList = completions.getMethodNames( patternRhs.getFactType() );
                    fieldCompletionTexts = new String[ methodList.size() ];
                    fieldCompletionValues = new String[ methodList.size() ];
                    int i = 0;
                    for ( String methodName : methodList ) {
                        fieldCompletionTexts[ i ] = methodName;
                        fieldCompletionValues[ i ] = methodName;
                        i++;
                    }
                    this.variableClass = patternRhs.getFactType();
                    this.isBoundFact = true;
                } else {
                    readOnly = true;
                }
            }
View Full Code Here

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

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

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

    private void addAction( IAction action,
                            List<LabelledAction> actions ) {
        String binding = null;
        LabelledAction a = null;
        if ( action instanceof ActionInsertFact ) {
            final ActionInsertFact af = (ActionInsertFact) action;
            binding = af.getBoundName();
            a = findByLabelledAction( actions,
                                      binding );

        } else if ( action instanceof ActionSetField ) {
            final ActionSetField af = (ActionSetField) action;
            binding = af.getVariable();
            a = findByLabelledAction( actions,
                                      binding );
        }

        //Binding is used to group related field setters together. It is essential for
View Full Code Here

TOP

Related Classes of org.drools.workbench.models.commons.shared.rule.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.