Package org.drools.workbench.models.datamodel.rule

Examples of org.drools.workbench.models.datamodel.rule.ActionInsertFact


        /*
         * 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( GuidedRuleEditorResources.CONSTANTS.BoundVariable() + ":",
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

                             "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

                                                }
                                            } );
                this.variableClass = type;
                this.isBoundFact = true;
            } else {
                ActionInsertFact patternRhs = mod.getModel().getRHSBoundFact( set.getVariable() );
                if ( patternRhs != null ) {
                    oracle.getFieldCompletions( patternRhs.getFactType(),
                                                FieldAccessorsAndMutators.MUTATOR,
                                                new Callback<ModelField[]>() {
                                                    @Override
                                                    public void callback( final ModelField[] fields ) {
                                                        fieldCompletions = fields;
                                                    }
                                                }
                                              );
                    this.variableClass = patternRhs.getFactType();
                    this.isBoundFact = true;
                }
            }
        }
View Full Code Here

            return null;
        }
    }

    private String getFactTypeFromRHS() {
        ActionInsertFact rhsBoundFact = modeller.getModel().getRHSBoundFact( model.getVariable() );
        if ( rhsBoundFact != null ) {
            return rhsBoundFact.getFactType();
        }
        return null;
    }
View Full Code Here

        m.addLhsItem( new FactPattern( "Person" ) );
        m.addLhsItem( new FactPattern( "Accident" ) );
        m.addAttribute( new RuleAttribute( "no-loop",
                                           "true" ) );

        m.addRhsItem( new ActionInsertFact( "Report" ) );
        m.name = "my rule";

        checkMarshallUnmarshall( expected,
                                 m );
    }
View Full Code Here

        con.setOperator( "==" );
        con.setValue( "CheeseType.CHEDDAR" );
        con.setConstraintValueType( BaseSingleFieldConstraint.TYPE_ENUM );
        pat.addConstraint( con );

        m.addRhsItem( new ActionInsertFact( "Report" ) );
        m.name = "my rule";

        checkMarshallUnmarshall( expected,
                                 m );
    }
View Full Code Here

        con.setValue( "CHEDDAR" );
        con.setFieldType( DataType.TYPE_STRING );
        con.setConstraintValueType( BaseSingleFieldConstraint.TYPE_ENUM );
        pat.addConstraint( con );

        m.addRhsItem( new ActionInsertFact( "Report" ) );
        m.name = "my rule";

        checkMarshallUnmarshall( expected,
                                 m );
    }
View Full Code Here

        con.setValue( "100" );
        con.setFieldType( DataType.TYPE_NUMERIC_INTEGER );
        con.setConstraintValueType( BaseSingleFieldConstraint.TYPE_ENUM );
        pat.addConstraint( con );

        m.addRhsItem( new ActionInsertFact( "Report" ) );
        m.name = "my rule";

        checkMarshallUnmarshall( expected,
                                 m );
    }
View Full Code Here

TOP

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