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

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


        FactPattern fp = new FactPattern( "Person" );
        fp.setBoundName( "$p" );
        m.addLhsItem( fp );

        ActionUpdateField auf1 = new ActionUpdateField( "$p" );
        ActionFieldValue afv0 = new ActionFieldValue();
        afv0.setNature( FieldNatureType.TYPE_TEMPLATE );
        afv0.setField( "field1" );
        afv0.setValue( "$f1" );
        auf1.addFieldValue( afv0 );
        ActionFieldValue afv1 = new ActionFieldValue();
        afv1.setNature( FieldNatureType.TYPE_LITERAL );
        afv1.setField( "field2" );
        afv1.setValue( "bar" );
        auf1.addFieldValue( afv1 );

        m.addRhsItem( auf1 );

        String expected = "rule \"r1_0\"\n" +
                "dialect \"mvel\"\n" +
View Full Code Here


        FactPattern fp = new FactPattern( "Person" );
        fp.setBoundName( "$p" );
        m.addLhsItem( fp );

        ActionUpdateField auf1 = new ActionUpdateField( "$p" );
        ActionFieldValue afv0 = new ActionFieldValue();
        afv0.setNature( FieldNatureType.TYPE_LITERAL );
        afv0.setField( "field1" );
        afv0.setValue( "foo" );
        auf1.addFieldValue( afv0 );
        ActionFieldValue afv1 = new ActionFieldValue();
        afv1.setNature( FieldNatureType.TYPE_TEMPLATE );
        afv1.setField( "field2" );
        afv1.setValue( "$f2" );
        auf1.addFieldValue( afv1 );

        m.addRhsItem( auf1 );

        String expected = "rule \"r1_0\"\n" +
                "dialect \"mvel\"\n" +
View Full Code Here

        FactPattern fp = new FactPattern( "Person" );
        fp.setBoundName( "$p" );
        m.addLhsItem( fp );

        ActionUpdateField auf1 = new ActionUpdateField( "$p" );
        ActionFieldValue afv0 = new ActionFieldValue();
        afv0.setNature( FieldNatureType.TYPE_LITERAL );
        afv0.setField( "field1" );
        afv0.setValue( "foo" );
        auf1.addFieldValue( afv0 );
        ActionFieldValue afv1 = new ActionFieldValue();
        afv1.setNature( FieldNatureType.TYPE_TEMPLATE );
        afv1.setField( "field2" );
        afv1.setValue( "$f2" );
        auf1.addFieldValue( afv1 );

        m.addRhsItem( auf1 );

        String expected = "rule \"r1_0\"\n" +
                "dialect \"mvel\"\n" +
View Full Code Here

        FactPattern fp = new FactPattern( "Person" );
        fp.setBoundName( "$p" );
        m.addLhsItem( fp );

        ActionUpdateField auf1 = new ActionUpdateField( "$p" );
        ActionFieldValue afv0 = new ActionFieldValue();
        afv0.setNature( FieldNatureType.TYPE_TEMPLATE );
        afv0.setField( "field1" );
        afv0.setValue( "$f1" );
        auf1.addFieldValue( afv0 );

        ActionFieldValue afv1 = new ActionFieldValue();
        afv1.setNature( FieldNatureType.TYPE_TEMPLATE );
        afv1.setField( "field2" );
        afv1.setValue( "$f2" );
        auf1.addFieldValue( afv1 );

        ActionFieldValue afv2 = new ActionFieldValue();
        afv2.setNature( FieldNatureType.TYPE_TEMPLATE );
        afv2.setField( "field3" );
        afv2.setValue( "$f3" );
        auf1.addFieldValue( afv2 );

        m.addRhsItem( auf1 );

        String expected = "rule \"r1_0\"\n" +
                "dialect \"mvel\"\n" +
View Full Code Here

        FactPattern fp = new FactPattern( "Person" );
        fp.setBoundName( "$p" );
        m.addLhsItem( fp );

        ActionUpdateField auf1 = new ActionUpdateField( "$p" );
        ActionFieldValue afv0 = new ActionFieldValue();
        afv0.setNature( FieldNatureType.TYPE_TEMPLATE );
        afv0.setField( "field1" );
        afv0.setValue( "$f1" );
        auf1.addFieldValue( afv0 );

        ActionFieldValue afv1 = new ActionFieldValue();
        afv1.setNature( FieldNatureType.TYPE_TEMPLATE );
        afv1.setField( "field2" );
        afv1.setValue( "$f2" );
        auf1.addFieldValue( afv1 );

        ActionFieldValue afv2 = new ActionFieldValue();
        afv2.setNature( FieldNatureType.TYPE_TEMPLATE );
        afv2.setField( "field3" );
        afv2.setValue( "$f3" );
        auf1.addFieldValue( afv2 );

        m.addRhsItem( auf1 );

        String expected = "rule \"r1_0\"\n" +
                "dialect \"mvel\"\n" +
View Full Code Here

        FactPattern fp = new FactPattern( "Person" );
        fp.setBoundName( "$p" );
        m.addLhsItem( fp );

        ActionUpdateField auf1 = new ActionUpdateField( "$p" );
        ActionFieldValue afv0 = new ActionFieldValue();
        afv0.setNature( FieldNatureType.TYPE_TEMPLATE );
        afv0.setField( "field1" );
        afv0.setValue( "$f1" );
        auf1.addFieldValue( afv0 );

        ActionFieldValue afv1 = new ActionFieldValue();
        afv1.setNature( FieldNatureType.TYPE_TEMPLATE );
        afv1.setField( "field2" );
        afv1.setValue( "$f2" );
        auf1.addFieldValue( afv1 );

        ActionFieldValue afv2 = new ActionFieldValue();
        afv2.setNature( FieldNatureType.TYPE_TEMPLATE );
        afv2.setField( "field3" );
        afv2.setValue( "$f3" );
        auf1.addFieldValue( afv2 );

        m.addRhsItem( auf1 );

        String expected = "rule \"r1_0\"\n" +
                "dialect \"mvel\"\n" +
View Full Code Here

        FactPattern fp = new FactPattern( "Person" );
        fp.setBoundName( "$p" );
        m.addLhsItem( fp );

        ActionUpdateField auf1 = new ActionUpdateField( "$p" );
        ActionFieldValue afv0 = new ActionFieldValue();
        afv0.setNature( FieldNatureType.TYPE_TEMPLATE );
        afv0.setField( "field1" );
        afv0.setValue( "$f1" );
        auf1.addFieldValue( afv0 );

        ActionFieldValue afv1 = new ActionFieldValue();
        afv1.setNature( FieldNatureType.TYPE_TEMPLATE );
        afv1.setField( "field2" );
        afv1.setValue( "$f2" );
        auf1.addFieldValue( afv1 );

        ActionFieldValue afv2 = new ActionFieldValue();
        afv2.setNature( FieldNatureType.TYPE_TEMPLATE );
        afv2.setField( "field3" );
        afv2.setValue( "$f3" );
        auf1.addFieldValue( afv2 );

        m.addRhsItem( auf1 );

        String expected = "rule \"r1_0\"\n" +
                "dialect \"mvel\"\n" +
View Full Code Here

    @Test
    public void testRHSNonEmptyStringValues() {
        FactPattern fp = new FactPattern( "Smurf" );
        fp.setBoundName( "p1" );

        ActionUpdateField auf1 = new ActionUpdateField( "p1" );
        auf1.addFieldValue( new ActionFieldValue( "name",
                                                  "$name",
                                                  DataType.TYPE_STRING ) );
        auf1.getFieldValues()[ 0 ].setNature( BaseSingleFieldConstraint.TYPE_TEMPLATE );

        ActionUpdateField auf2 = new ActionUpdateField( "p1" );
        auf2.addFieldValue( new ActionFieldValue( "age",
                                                  "$age",
                                                  DataType.TYPE_NUMERIC_INTEGER ) );
        auf2.getFieldValues()[ 0 ].setNature( BaseSingleFieldConstraint.TYPE_TEMPLATE );

        //Test 1
        TemplateModel m1 = new TemplateModel();
        m1.addLhsItem( fp );
        m1.addRhsItem( auf1 );
View Full Code Here

    @Test
    public void testRHSDelimitedNonEmptyStringValues() {
        FactPattern fp = new FactPattern( "Smurf" );
        fp.setBoundName( "p1" );

        ActionUpdateField auf1 = new ActionUpdateField( "p1" );
        auf1.addFieldValue( new ActionFieldValue( "name",
                                                  "$name",
                                                  DataType.TYPE_STRING ) );
        auf1.getFieldValues()[ 0 ].setNature( BaseSingleFieldConstraint.TYPE_TEMPLATE );

        ActionUpdateField auf2 = new ActionUpdateField( "p1" );
        auf2.addFieldValue( new ActionFieldValue( "age",
                                                  "$age",
                                                  DataType.TYPE_NUMERIC_INTEGER ) );
        auf2.getFieldValues()[ 0 ].setNature( BaseSingleFieldConstraint.TYPE_TEMPLATE );

        //Test 1
        TemplateModel m1 = new TemplateModel();
        m1.addLhsItem( fp );
        m1.addRhsItem( auf1 );
View Full Code Here

        asf.setVariable( "$a" );
        asf.addFieldValue( new ActionFieldValue( "age",
                                                 "33",
                                                 DataType.TYPE_NUMERIC_INTEGER ) );

        final ActionUpdateField auf = new ActionUpdateField();
        asf.setVariable( "$m" );
        asf.addFieldValue( new ActionFieldValue( "amount",
                                                 "10000",
                                                 DataType.TYPE_NUMERIC_INTEGER ) );
View Full Code Here

TOP

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