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

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


                               position );
    }

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


                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.setFieldValues( old.getFieldValues() );
                a.action = update;
            }
            ActionSetField asf = (ActionSetField) a.action;
            ActionWorkItemFieldValue val = new ActionWorkItemFieldValue( sf.getFactField(),
                                                                         sf.getType(),
View Full Code Here

            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.setFieldValues( old.getFieldValues() );
            a.action = update;
        }
        ActionSetField asf = (ActionSetField) a.action;
        ActionFieldValue val = new ActionFieldValue( sf.getFactField(),
                                                     cell,
View Full Code Here

                        addSettersToAction( setStatements, fact, action, isJavaDialect );
                    }
                }
            } else if ( line.startsWith( "update" ) ) {
                String variable = unwrapParenthesis( line );
                ActionUpdateField action = new ActionUpdateField();
                action.setVariable( variable );
                m.addRhsItem( action );
                addSettersToAction( setStatements, variable, action, isJavaDialect );
            } else if ( line.startsWith( "retract" ) ) {
                String variable = unwrapParenthesis( line );
                m.addRhsItem( new ActionRetractFact( variable ) );
View Full Code Here

        final CompositeFactPattern comp = new CompositeFactPattern( "not" );
        comp.addFactPattern( new FactPattern( "Cancel" ) );
        m.addLhsItem( comp );

        final ActionUpdateField set = new ActionUpdateField();
        set.setVariable( "p1" );
        set.addFieldValue( new ActionFieldValue( "status",
                                                 "rejected",
                                                 DataType.TYPE_STRING ) );
        m.addRhsItem( set );

        final ActionRetractFact ret = new ActionRetractFact( "p1" );
View Full Code Here

            con.setConstraintValueType( SingleFieldConstraint.TYPE_LITERAL );
            p.addConstraint( con );

            m.addLhsItem( p );

            ActionUpdateField am = new ActionUpdateField( "$p" );
            am.addFieldValue( new ActionFieldValue( "dob",
                                                    "31-Jan-2000",
                                                    DataType.TYPE_DATE ) );
            m.addRhsItem( am );

            String result = BRDRLPersistence.getInstance().marshal( m );
View Full Code Here

        final CompositeFactPattern comp = new CompositeFactPattern( "not" );
        comp.addFactPattern( new FactPattern( "Cancel" ) );
        m.addLhsItem( comp );

        final ActionUpdateField set = new ActionUpdateField();
        set.setVariable( "p1" );
        set.addFieldValue( new ActionFieldValue( "status",
                                                 "rejected",
                                                 DataType.TYPE_STRING ) );
        m.addRhsItem( set );

        final ActionRetractFact ret = new ActionRetractFact( "p1" );
View Full Code Here

            con.setConstraintValueType( SingleFieldConstraint.TYPE_LITERAL );
            p.addConstraint( con );

            m.addLhsItem( p );

            ActionUpdateField am = new ActionUpdateField( "$p" );
            am.addFieldValue( new ActionFieldValue( "dob",
                                                    "31-Jan-2000",
                                                    DataType.TYPE_DATE ) );
            m.addRhsItem( am );

            String result = BRDRLPersistence.getInstance().marshal( m );
View Full Code Here

                               position );
    }

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

        }
        return clone;
    }

    private ActionUpdateField visitActionFieldList( ActionUpdateField afl ) {
        ActionUpdateField clone = new ActionUpdateField();
        clone.setVariable( afl.getVariable() );
        for ( ActionFieldValue afv : afl.getFieldValues() ) {
            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

TOP

Related Classes of org.drools.workbench.models.commons.shared.rule.ActionUpdateField

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.