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

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


        BRLActionColumn brl1 = new BRLActionColumn();

        //BRL Column definition
        List<IAction> brl1Definition = new ArrayList<IAction>();
        ActionInsertFact brl1DefinitionAction1 = new ActionInsertFact( "Baddie" );
        ActionFieldValue brl1DefinitionAction1FieldValue1 = new ActionFieldValue( "name",
                                                                                  "Gargamel",
                                                                                  DataType.TYPE_STRING );
        brl1DefinitionAction1FieldValue1.setNature( BaseSingleFieldConstraint.TYPE_LITERAL );
        brl1DefinitionAction1.addFieldValue( brl1DefinitionAction1FieldValue1 );
        brl1Definition.add( brl1DefinitionAction1 );

        ActionInsertFact brl1DefinitionAction2 = new ActionInsertFact( "Smurf" );
        ActionFieldValue brl1DefinitionAction2FieldValue1 = new ActionFieldValue( "name",
                                                                                  "$name",
                                                                                  DataType.TYPE_STRING );
        brl1DefinitionAction2FieldValue1.setNature( BaseSingleFieldConstraint.TYPE_TEMPLATE );
        brl1DefinitionAction2.addFieldValue( brl1DefinitionAction2FieldValue1 );
        ActionFieldValue brl1DefinitionAction2FieldValue2 = new ActionFieldValue( "age",
                                                                                  "$age",
                                                                                  DataType.TYPE_NUMERIC_INTEGER );
        brl1DefinitionAction2FieldValue2.setNature( BaseSingleFieldConstraint.TYPE_TEMPLATE );
        brl1DefinitionAction2.addFieldValue( brl1DefinitionAction2FieldValue2 );
        brl1Definition.add( brl1DefinitionAction2 );

        brl1.setDefinition( brl1Definition );
View Full Code Here


        BRLActionColumn brl1 = new BRLActionColumn();

        //BRL Column definition
        List<IAction> brl1Definition = new ArrayList<IAction>();
        ActionInsertFact brl1DefinitionAction1 = new ActionInsertFact( "Baddie" );
        ActionFieldValue brl1DefinitionAction1FieldValue1 = new ActionFieldValue( "name",
                                                                                  "Gargamel",
                                                                                  DataType.TYPE_STRING );
        brl1DefinitionAction1FieldValue1.setNature( BaseSingleFieldConstraint.TYPE_LITERAL );
        brl1DefinitionAction1.addFieldValue( brl1DefinitionAction1FieldValue1 );
        brl1Definition.add( brl1DefinitionAction1 );

        brl1.setDefinition( brl1Definition );
View Full Code Here

        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

        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

        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

        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

        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

            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

            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

            p.addConstraint( con );

            m.addLhsItem( p );

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

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

TOP

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