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

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


        RuleModel model = new RuleModel();
        model.name = "rule2";
        FactPattern pattern = new FactPattern( "Person" );
        pattern.boundName = "p";
        ActionSetField action = new ActionSetField( "p" );
        ActionFieldValue value = new ActionFieldValue( "age",
                                                       "42",
                                                       SuggestionCompletionEngine.TYPE_NUMERIC );
        action.addFieldValue( value );

        model.addLhsItem( pattern );
        model.addRhsItem( action );

        DSLSentence dslCondition = new DSLSentence();
        dslCondition.sentence = "This is a sentence";

        model.addLhsItem( dslCondition );

        DSLSentence dslAction = new DSLSentence();
        dslAction.sentence = "say {42}";

        model.addRhsItem( dslAction );

        rule1.updateContent( BRXMLPersistence.getInstance().marshal( model ) );
        rule1.checkin( "" );
        repo.save();

        //now add a rule with no DSL
        model = new RuleModel();
        model.name = "ruleNODSL";
        pattern = new FactPattern( "Person" );
        pattern.boundName = "p";
        action = new ActionSetField( "p" );
        value = new ActionFieldValue( "age",
                                      "42",
                                      SuggestionCompletionEngine.TYPE_NUMERIC );
        action.addFieldValue( value );

        model.addLhsItem( pattern );
View Full Code Here


    ffl.text = "Cheese(type == @{type}, price < @{price})";
   
    m.lhs[1] = ffl;

    ActionInsertFact aif = new ActionInsertFact("Person");
    ActionFieldValue afv = new ActionFieldValue("age", "age", "");
    afv.nature = ActionFieldValue.TYPE_TEMPLATE;

    aif.addFieldValue(afv);
    m.rhs[0] = aif;
View Full Code Here

        fp.addConstraint(sfc);
       
        m.lhs[0] = fp;
       
        ActionInsertFact aif = new ActionInsertFact("Person");
        ActionFieldValue afv = new ActionFieldValue("age", "age", "");
        afv.nature = ActionFieldValue.TYPE_TEMPLATE;
       
        aif.addFieldValue(afv);
        m.rhs[0] = aif;
       
View Full Code Here

                    return;
                }

                String fieldType = modeller.getSuggestionCompletionEngine()
                        .getFieldType(fact.factType, factsCombo.getText());
                fact.addFieldValue(new ActionFieldValue(factsCombo.getText(),
                        "", fieldType));

                modeller.setDirty(true);
                modeller.reloadRhs();
                close();
View Full Code Here

                    return; // no need to change anything
                }

                String fieldType = modeller.getSuggestionCompletionEngine().getFieldType( variableClass,
                                                                                          fieldsCombo.getText() );
                field.addFieldValue( new ActionFieldValue( fieldsCombo.getText(),
                                                           "",
                                                           fieldType ) );

               
                getShell().getDisplay().asyncExec( new Runnable() {
View Full Code Here

        link.setToolTipText( "Add another field to this so you can set its value" );
    }

    private void createConstraintRows(Composite constraintComposite) {
        for ( int row = 0; row < fact.fieldValues.length; row++ ) {
            ActionFieldValue val = fact.fieldValues[row];
            toolkit.createLabel( constraintComposite,
                                 val.field );
            valueEditor( constraintComposite,
                         val );
            addRemoveFieldAction( constraintComposite,
View Full Code Here

        DirtyableFlexTable inner = new DirtyableFlexTable();
        int col = 0;

        for ( int i = 0; i < model.fieldValues.length; i++ ) {
            ActionFieldValue val = model.fieldValues[i];

            inner.setWidget( i,
                             0 + col,
                             fieldSelector( val ) );
            inner.setWidget( i,
View Full Code Here

        box.addChangeHandler( new ChangeHandler() {
            public void onChange(ChangeEvent event) {
                String fieldName = box.getItemText( box.getSelectedIndex() );
                String fieldType = completions.getFieldType( model.factType,
                                                             fieldName );
                model.addFieldValue( new ActionFieldValue( fieldName,
                                                           "",
                                                           fieldType ) );
                setModified( true );
                getModeller().refreshWidget();
                popup.hide();
View Full Code Here

    private void doLayout() {
        layout.clear();

        for ( int i = 0; i < model.fieldValues.length; i++ ) {
            ActionFieldValue val = model.fieldValues[i];

            layout.setWidget( i,
                              0,
                              getSetterLabel() );
            layout.setWidget( i,
View Full Code Here

            public void onChange(ChangeEvent event) {
                String fieldName = box.getItemText( box.getSelectedIndex() );

                String fieldType = completions.getFieldType( variableClass,
                                                             fieldName );
                model.addFieldValue( new ActionFieldValue( fieldName,
                                                           "",
                                                           fieldType ) );
                setModified( true );
                getModeller().refreshWidget();
                popup.hide();
View Full Code Here

TOP

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

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.