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

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


            p.addConstraint( con );

            m.addLhsItem( p );

            ActionSetField au = new ActionSetField( "$p" );
            au.addFieldValue( new ActionFieldValue( "dob",
                                                    "31-Jan-2000",
                                                    SuggestionCompletionEngine.TYPE_DATE ) );
            m.addRhsItem( au );

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


        RuleModel m = new RuleModel();
        DSLSentence sen = new DSLSentence();
        sen.setDefinition( "I CAN HAS DSL" );
        m.addRhsItem( sen );
        ActionInsertFact ins = new ActionInsertFact( "Shizzle" );
        ActionFieldValue val = new ActionFieldValue( "goo",
                                                     "42",
                                                     "Numeric" );
        ins.fieldValues = new ActionFieldValue[1];
        ins.fieldValues[0] = val;
        m.addRhsItem( ins );

        ActionInsertLogicalFact insL = new ActionInsertLogicalFact( "Shizzle" );
        ActionFieldValue valL = new ActionFieldValue( "goo",
                                                      "42",
                                                      "Numeric" );
        insL.fieldValues = new ActionFieldValue[1];
        insL.fieldValues[0] = valL;
        m.addRhsItem( insL );
View Full Code Here

        assertEquals( asf.variable,
                      "$r" );
        assertEquals( 4,
                      asf.fieldValues.length );

        ActionFieldValue fv1 = asf.fieldValues[0];
        assertNotNull( fv1 );
        assertTrue( fv1 instanceof ActionWorkItemFieldValue );
        ActionWorkItemFieldValue wifv1 = (ActionWorkItemFieldValue) fv1;
        assertEquals( "ResultBooleanField",
                      wifv1.field );
        assertEquals( SuggestionCompletionEngine.TYPE_BOOLEAN,
                      wifv1.type );
        assertEquals( "WorkItem",
                      wifv1.getWorkItemName() );
        assertEquals( "BooleanResult",
                      wifv1.getWorkItemParameterName() );
        assertEquals( Boolean.class.getName(),
                      wifv1.getWorkItemParameterClassName() );

        ActionFieldValue fv2 = asf.fieldValues[1];
        assertNotNull( fv2 );
        assertTrue( fv2 instanceof ActionWorkItemFieldValue );
        ActionWorkItemFieldValue wifv2 = (ActionWorkItemFieldValue) fv2;
        assertEquals( "ResultFloatField",
                      wifv2.field );
        assertEquals( SuggestionCompletionEngine.TYPE_NUMERIC,
                      wifv2.type );
        assertEquals( "WorkItem",
                      wifv2.getWorkItemName() );
        assertEquals( "FloatResult",
                      wifv2.getWorkItemParameterName() );
        assertEquals( Float.class.getName(),
                      wifv2.getWorkItemParameterClassName() );

        ActionFieldValue fv3 = asf.fieldValues[2];
        assertNotNull( fv3 );
        assertTrue( fv3 instanceof ActionWorkItemFieldValue );
        ActionWorkItemFieldValue wifv3 = (ActionWorkItemFieldValue) fv3;
        assertEquals( "ResultIntegerField",
                      wifv3.field );
        assertEquals( SuggestionCompletionEngine.TYPE_NUMERIC,
                      wifv3.type );
        assertEquals( "WorkItem",
                      wifv3.getWorkItemName() );
        assertEquals( "IntegerResult",
                      wifv3.getWorkItemParameterName() );
        assertEquals( Integer.class.getName(),
                      wifv3.getWorkItemParameterClassName() );

        ActionFieldValue fv4 = asf.fieldValues[3];
        assertNotNull( fv4 );
        assertTrue( fv4 instanceof ActionWorkItemFieldValue );
        ActionWorkItemFieldValue wifv4 = (ActionWorkItemFieldValue) fv4;
        assertEquals( "ResultStringField",
                      wifv4.field );
View Full Code Here

        assertEquals( asf.variable,
                      "$r" );
        assertEquals( 1,
                      asf.fieldValues.length );

        ActionFieldValue fv1 = asf.fieldValues[0];
        assertNotNull( fv1 );
        assertTrue( fv1 instanceof ActionWorkItemFieldValue );
        ActionWorkItemFieldValue wifv1 = (ActionWorkItemFieldValue) fv1;
        assertEquals( "ResultBooleanField",
                      wifv1.field );
View Full Code Here

        assertEquals( aif.getBoundName(),
                      "$r" );
        assertEquals( 4,
                      aif.fieldValues.length );

        ActionFieldValue fv1 = aif.fieldValues[0];
        assertNotNull( fv1 );
        assertTrue( fv1 instanceof ActionWorkItemFieldValue );
        ActionWorkItemFieldValue wifv1 = (ActionWorkItemFieldValue) fv1;
        assertEquals( "ResultBooleanField",
                      wifv1.field );
        assertEquals( SuggestionCompletionEngine.TYPE_BOOLEAN,
                      wifv1.type );
        assertEquals( "WorkItem",
                      wifv1.getWorkItemName() );
        assertEquals( "BooleanResult",
                      wifv1.getWorkItemParameterName() );
        assertEquals( Boolean.class.getName(),
                      wifv1.getWorkItemParameterClassName() );

        ActionFieldValue fv2 = aif.fieldValues[1];
        assertNotNull( fv2 );
        assertTrue( fv2 instanceof ActionWorkItemFieldValue );
        ActionWorkItemFieldValue wifv2 = (ActionWorkItemFieldValue) fv2;
        assertEquals( "ResultFloatField",
                      wifv2.field );
        assertEquals( SuggestionCompletionEngine.TYPE_NUMERIC,
                      wifv2.type );
        assertEquals( "WorkItem",
                      wifv2.getWorkItemName() );
        assertEquals( "FloatResult",
                      wifv2.getWorkItemParameterName() );
        assertEquals( Float.class.getName(),
                      wifv2.getWorkItemParameterClassName() );

        ActionFieldValue fv3 = aif.fieldValues[2];
        assertNotNull( fv3 );
        assertTrue( fv3 instanceof ActionWorkItemFieldValue );
        ActionWorkItemFieldValue wifv3 = (ActionWorkItemFieldValue) fv3;
        assertEquals( "ResultIntegerField",
                      wifv3.field );
        assertEquals( SuggestionCompletionEngine.TYPE_NUMERIC,
                      wifv3.type );
        assertEquals( "WorkItem",
                      wifv3.getWorkItemName() );
        assertEquals( "IntegerResult",
                      wifv3.getWorkItemParameterName() );
        assertEquals( Integer.class.getName(),
                      wifv3.getWorkItemParameterClassName() );

        ActionFieldValue fv4 = aif.fieldValues[3];
        assertNotNull( fv4 );
        assertTrue( fv4 instanceof ActionWorkItemFieldValue );
        ActionWorkItemFieldValue wifv4 = (ActionWorkItemFieldValue) fv4;
        assertEquals( "ResultStringField",
                      wifv4.field );
View Full Code Here

        assertEquals( aif.getBoundName(),
                      "$r" );
        assertEquals( 1,
                      aif.fieldValues.length );

        ActionFieldValue fv1 = aif.fieldValues[0];
        assertNotNull( fv1 );
        assertTrue( fv1 instanceof ActionWorkItemFieldValue );
        ActionWorkItemFieldValue wifv1 = (ActionWorkItemFieldValue) fv1;
        assertEquals( "ResultBooleanField",
                      wifv1.field );
View Full Code Here

                      result[0] );
        assertEquals( "colour",
                      result[1] );

        ActionFieldValue[] vals = new ActionFieldValue[2];
        vals[0] = new ActionFieldValue( "type",
                                        "sex",
                                        "blah" );
        vals[1] = new ActionFieldValue( "value",
                                        null,
                                        "blah" );
        result = sce.getEnums( "Fact",
                "value", vals
        ).fixedList;
View Full Code Here

        assertEquals( "f2=f2val",
                      dd.valuePairs[1] );

        //and now for the RHS
        ActionFieldValue[] vals = new ActionFieldValue[2];
        vals[0] = new ActionFieldValue( "f1",
                                        "f1val",
                                        "blah" );
        vals[1] = new ActionFieldValue( "f2",
                                        "f2val",
                                        "blah" );
        dd = sce.getEnums( "Fact",
                "value", vals
        );
View Full Code Here

        comp.addFactPattern( new FactPattern( "Cancel" ) );
        m.addLhsItem( comp );

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

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

        assertEquals( "f2=f2val",
                      dd.valuePairs[1] );

        //and now for the RHS
        ActionFieldValue[] vals = new ActionFieldValue[2];
        vals[0] = new ActionFieldValue( "f1",
                                        "f1val",
                                        "blah" );
        vals[1] = new ActionFieldValue( "f2",
                                        "f2val",
                                        "blah" );
        dd = sce.getEnums( "Fact",
                "value", vals
        );
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.