Package org.drools.brms.client.modeldriven.brl

Examples of org.drools.brms.client.modeldriven.brl.ActionFieldValue


    Map dataEnumLookupFields = loadDataEnumLookupFields();
    String typeField = (String) dataEnumLookupFields.get(type + "." + field );

    if (currentValues != null) {
      for (int i = 0; i < currentValues.length; i++) {
        ActionFieldValue val = currentValues[i];
        if (val.field.equals(typeField)) {
          String key = type + "." + field + "[" + typeField + "=" + val.value + "]";
          return (String[]) this.dataEnumLists.get(key);
        }
      }
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

        RuleModel m = new RuleModel();
        DSLSentence sen = new DSLSentence();
        sen.sentence = "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 );

        String result = BRDRLPersistence.getInstance().marshal( m );
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

        RuleModel m = new RuleModel();
        DSLSentence sen = new DSLSentence();
        sen.sentence = "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 );

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

public class ActionSetFieldTest extends TestCase {

    public void testRemove() {
        final ActionSetField set = new ActionSetField();
        set.fieldValues = new ActionFieldValue[2];
        final ActionFieldValue v0 = new ActionFieldValue( "x",
                                                          "42",
                                                          SuggestionCompletionEngine.TYPE_NUMERIC );
        final ActionFieldValue v1 = new ActionFieldValue( "y",
                                                          "43",
                                                          SuggestionCompletionEngine.TYPE_NUMERIC );
        set.fieldValues[0] = v0;
        set.fieldValues[1] = v1;
View Full Code Here

    }

    public void testAdd() {
        final ActionSetField set = new ActionSetField();
        set.fieldValues = new ActionFieldValue[2];
        final ActionFieldValue v0 = new ActionFieldValue( "x",
                                                          "42",
                                                          SuggestionCompletionEngine.TYPE_NUMERIC );
        final ActionFieldValue v1 = new ActionFieldValue( "y",
                                                          "43",
                                                          SuggestionCompletionEngine.TYPE_NUMERIC );
        set.fieldValues[0] = v0;
        set.fieldValues[1] = v1;

        final ActionFieldValue q = new ActionFieldValue( "q",
                                                         "q",
                                                         SuggestionCompletionEngine.TYPE_NUMERIC );
        set.addFieldValue( q );

        assertEquals( 3,
View Full Code Here

      assertEquals("sex", 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", vals, "value");
      assertNotNull(result);
      assertEquals(2, result.length);
      assertEquals("M", result[0]);
      assertEquals("F", result[1]);
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

import org.drools.brms.client.modeldriven.brl.ActionFieldValue;

public class ActionFieldValueTest extends TestCase {

    public void testFormula() {
        ActionFieldValue val = new ActionFieldValue( "x",
                                                     "y",
                                                     SuggestionCompletionEngine.TYPE_NUMERIC );
        assertFalse( val.isFormula() );
        val = new ActionFieldValue( "x",
                                    "=y * 20",
                                    SuggestionCompletionEngine.TYPE_NUMERIC );
        assertTrue( val.isFormula() );
    }
View Full Code Here

TOP

Related Classes of org.drools.brms.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.