Examples of ActionSetField


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

        //Examine RuleModel actions
        ActionExecuteWorkItem aw = (ActionExecuteWorkItem) rm.rhs[0];
        assertNotNull( aw );

        ActionSetField asf = (ActionSetField) rm.rhs[1];
        assertNotNull( asf );

        //Check ActionExecuteWorkItem
        PortableWorkDefinition mpwd = aw.getWorkDefinition();
        assertNotNull( mpwd );
View Full Code Here

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

                               position );
    }

    private void addActionSetField(String itemText,
                                     int position) {
        this.model.addRhsItem( new ActionSetField( itemText ),
                               position );
    }
View Full Code Here

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

            } else if ( col instanceof BRLActionColumn ) {
                BRLActionColumn brl = (BRLActionColumn) col;
                for ( IAction a : brl.getDefinition() ) {
                    if ( a instanceof ActionSetField ) {
                        final ActionSetField action = (ActionSetField) a;
                        if ( action.variable.equals( binding ) ) {
                            return true;
                        }
                    } else if ( a instanceof ActionRetractFact ) {
                        final ActionRetractFact action = (ActionRetractFact) a;
View Full Code Here

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

                                                     sf.getBoundName() );
            if ( a == null ) {
                a = new LabelledAction();
                a.boundName = sf.getBoundName();
                if ( !sf.isUpdate() ) {
                    a.action = new ActionSetField( sf.getBoundName() );
                } else {
                    a.action = new ActionUpdateField( sf.getBoundName() );
                }
                actions.add( a );
            } else if ( sf.isUpdate() && !(a.action instanceof ActionUpdateField) ) {
                // lets swap it out for an update as the user has asked for it.
                ActionSetField old = (ActionSetField) a.action;
                ActionUpdateField update = new ActionUpdateField( sf.getBoundName() );
                update.fieldValues = old.fieldValues;
                a.action = update;
            }
            ActionSetField asf = (ActionSetField) a.action;
            ActionWorkItemFieldValue val = new ActionWorkItemFieldValue( sf.getFactField(),
                                                                         sf.getType(),
                                                                         sf.getWorkItemName(),
                                                                         sf.getWorkItemResultParameterName(),
                                                                         sf.getParameterClassName() );
            asf.addFieldValue( val );
        }
    }
View Full Code Here

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

                                                 sf.getBoundName() );
        if ( a == null ) {
            a = new LabelledAction();
            a.boundName = sf.getBoundName();
            if ( !sf.isUpdate() ) {
                a.action = new ActionSetField( sf.getBoundName() );
            } else {
                a.action = new ActionUpdateField( sf.getBoundName() );
            }
            actions.add( a );
        } else if ( sf.isUpdate() && !(a.action instanceof ActionUpdateField) ) {
            // lets swap it out for an update as the user has asked for it.
            ActionSetField old = (ActionSetField) a.action;
            ActionUpdateField update = new ActionUpdateField( sf.getBoundName() );
            update.fieldValues = old.fieldValues;
            a.action = update;
        }
        ActionSetField asf = (ActionSetField) a.action;
        ActionFieldValue val = new ActionFieldValue( sf.getFactField(),
                                                     cell,
                                                     sf.getType() );
        asf.addFieldValue( val );
    }
View Full Code Here

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

                                         public void handleEvent(Event event) {
                                             if ( globalVarsCombo.getSelectionIndex() == 0 ) {
                                                 return;
                                             }

                                             modeller.getModel().addRhsItem( new ActionSetField( globalVarsCombo.getText() ) );
                                             modeller.setDirty( true );
                                             modeller.reloadRhs();
                                             close();
                                         }
                                     } );
View Full Code Here

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

        }
        return clone;
    }

    private ActionSetField visitActionFieldList(ActionSetField afl) {
        ActionSetField clone = new ActionSetField();
        clone.variable = afl.variable;
        for ( ActionFieldValue afv : afl.fieldValues ) {
            ActionFieldValue afvClone = new ActionFieldValue();
            afvClone.setField( afv.getField() );
            afvClone.setNature( afv.getNature() );
            afvClone.setType( afv.getType() );
            afvClone.setValue( afv.getValue() );
            clone.addFieldValue( afvClone );
        }
        return clone;
    }
View Full Code Here

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

        p.addConstraint( con );

        m.addLhsItem( p );

        ActionSetField set = new ActionSetField( "p" );
        ActionFieldValue f = new ActionFieldValue( "name",
                                                   "42-ngoo",
                                                   SuggestionCompletionEngine.TYPE_STRING );
        set.addFieldValue( f );

        m.addRhsItem( set );

        repositoryAssetService.checkinVersion( rule );
View Full Code Here

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

        con.setConstraintValueType( BaseSingleFieldConstraint.TYPE_PREDICATE );
        con.setValue( "name soundslike 'foobar'" );
        pattern.addConstraint( con );

        pattern.setBoundName( "p" );
        ActionSetField action = new ActionSetField( "p" );
        ActionFieldValue value = new ActionFieldValue( "age",
                                                       "42",
                                                       SuggestionCompletionEngine.TYPE_NUMERIC );
        action.addFieldValue( value );

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

        rule2.updateContent( BRXMLPersistence.getInstance().marshal( model ) );
View Full Code Here

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

                               position );
    }

    private void addActionSetField( String itemText,
                                    int position ) {
        this.model.addRhsItem( new ActionSetField( itemText ),
                               position );
    }
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.