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

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


        con.setValue( "true" );
        con.setFieldType( DataType.TYPE_BOOLEAN );
        con.setConstraintValueType( BaseSingleFieldConstraint.TYPE_ENUM );
        pat.addConstraint( con );

        m.addRhsItem( new ActionInsertFact( "Report" ) );
        m.name = "my rule";

        checkMarshallUnmarshall( expected, m );
    }
View Full Code Here


        con.setValue( "31-Jan-2010" );
        con.setFieldType( DataType.TYPE_DATE );
        con.setConstraintValueType( BaseSingleFieldConstraint.TYPE_ENUM );
        pat.addConstraint( con );

        m.addRhsItem( new ActionInsertFact( "Report" ) );
        m.name = "my rule";

        checkMarshallUnmarshall( expected, m );
    }
View Full Code Here

        con.setValue( "Cheese.CHEDDAR" );
        con.setFieldType( DataType.TYPE_COMPARABLE );
        con.setConstraintValueType( BaseSingleFieldConstraint.TYPE_ENUM );
        pat.addConstraint( con );

        m.addRhsItem( new ActionInsertFact( "Report" ) );
        m.name = "my rule";

        checkMarshallUnmarshall( expected, m );
    }
View Full Code Here

        Z.setValue( "foo" );
        Z.setOperator( "==" );

        p.addConstraint( Z );

        ActionInsertFact ass = new ActionInsertFact( "Whee" );
        m.addRhsItem( ass );

        String actual = BRDRLPersistence.getInstance().marshal( m );
        String expected = "rule \"with composite\"\n" +
                "\tdialect \"mvel\"\n" +
View Full Code Here

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

        m.addLhsItem( p );

        ActionInsertFact ai = new ActionInsertFact( "Person" );
        ai.addFieldValue( new ActionFieldValue( "field1",
                                                "55",
                                                DataType.TYPE_NUMERIC_BIGDECIMAL ) );
        m.addRhsItem( ai );

        String expected = "rule \"test literal bigdecimal\" \n"
View Full Code Here

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

        m.addLhsItem( p );

        ActionInsertFact ai = new ActionInsertFact( "Person" );
        ai.addFieldValue( new ActionFieldValue( "field1",
                                                "55",
                                                DataType.TYPE_NUMERIC_BIGINTEGER ) );
        m.addRhsItem( ai );

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

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

        m.addLhsItem( p );

        ActionInsertFact ai = new ActionInsertFact( "Person" );
        ai.addFieldValue( new ActionFieldValue( "field1",
                                                "55",
                                                DataType.TYPE_NUMERIC_BIGDECIMAL ) );
        m.addRhsItem( ai );

        String expected = "rule \"test literal bigdecimal\" \n"
View Full Code Here

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

        m.addLhsItem( p );

        ActionInsertFact ai = new ActionInsertFact( "Person" );
        ai.addFieldValue( new ActionFieldValue( "field1",
                                                "55",
                                                DataType.TYPE_NUMERIC_BIGINTEGER ) );
        m.addRhsItem( ai );

        String expected = "rule \"test literal biginteger\" \n"
View Full Code Here

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

            m.addLhsItem( p );

            ActionInsertFact ai = new ActionInsertFact( "Birthday" );
            ai.addFieldValue( new ActionFieldValue( "dob",
                                                    "31-Jan-2000",
                                                    DataType.TYPE_DATE ) );
            m.addRhsItem( ai );

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

        p4.setName( "StringResult" );
        pwd.addResult( p4 );

        m.addRhsItem( awi );

        ActionInsertFact aif = new ActionInsertFact();
        aif.setBoundName( "$r" );
        aif.setFactType( "Results" );
        ActionWorkItemFieldValue fv1 = new ActionWorkItemFieldValue( "ResultsBooleanResult",
                                                                     DataType.TYPE_BOOLEAN,
                                                                     "WorkItem",
                                                                     "BooleanResult",
                                                                     Boolean.class.getName() );
        aif.addFieldValue( fv1 );
        ActionWorkItemFieldValue fv2 = new ActionWorkItemFieldValue( "ResultsFloatResult",
                                                                     DataType.TYPE_NUMERIC_FLOAT,
                                                                     "WorkItem",
                                                                     "FloatResult",
                                                                     Float.class.getName() );
        aif.addFieldValue( fv2 );
        ActionWorkItemFieldValue fv3 = new ActionWorkItemFieldValue( "ResultsIntegerResult",
                                                                     DataType.TYPE_NUMERIC_INTEGER,
                                                                     "WorkItem",
                                                                     "IntegerResult",
                                                                     Integer.class.getName() );
        aif.addFieldValue( fv3 );
        ActionWorkItemFieldValue fv4 = new ActionWorkItemFieldValue( "ResultsStringResult",
                                                                     DataType.TYPE_STRING,
                                                                     "WorkItem",
                                                                     "StringResult",
                                                                     String.class.getName() );
        aif.addFieldValue( fv4 );

        m.addRhsItem( aif );

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

TOP

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

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.