Examples of ActionFieldValue


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

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

            ActionInsertFact ins = new ActionInsertFact(ac.factType);
            a.action = ins;
            actions.add(a);
          }
          ActionInsertFact ins = (ActionInsertFact) a.action;
          ActionFieldValue val = new ActionFieldValue(ac.factField, cell, ac.type);
          ins.addFieldValue(val);
        } else if (c instanceof ActionRetractFactCol) {
          ActionRetractFactCol rf = (ActionRetractFactCol)c;
          LabelledAction a = find(actions, rf.boundName);
          if (a == null) {
            a = new LabelledAction();
            a.action = new ActionRetractFact(rf.boundName);
            a.boundName = rf.boundName;
            actions.add(a);
          }
        } else if (c instanceof ActionSetFieldCol) {
          ActionSetFieldCol sf = (ActionSetFieldCol)c;
          LabelledAction a = find(actions, sf.boundName);
          if (a == null) {
            a = new LabelledAction();
            a.boundName = sf.boundName;
            a.action = new ActionSetField(sf.boundName);
            actions.add(a);
          }
          ActionSetField asf = (ActionSetField) a.action;
          ActionFieldValue val = new ActionFieldValue(sf.factField, cell, sf.type);
          asf.addFieldValue(val);
        }
      }
    }
View Full Code Here

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

                a.action = ins;
            }
            actions.add( a );
        }
        ActionInsertFact ins = (ActionInsertFact) a.action;
        ActionFieldValue val = new ActionFieldValue( ac.getFactField(),
                                                     cell,
                                                     ac.getType() );
        ins.addFieldValue( val );
    }
View Full Code Here

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

        dt.getActionCols().add( ins );

        BRLActionColumn brlAction = new BRLActionColumn();
        ActionInsertFact aif = new ActionInsertFact( "Person" );
        aif.setBoundName( "$aif" );
        aif.addFieldValue( new ActionFieldValue( "rating",
                                                 null,
                                                 SuggestionCompletionEngine.TYPE_STRING ) );
        aif.fieldValues[0].nature = BaseSingleFieldConstraint.TYPE_LITERAL;

        brlAction.getDefinition().add( aif );
View Full Code Here

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

        dt.getActionCols().add( ins2 );

        BRLActionColumn brlAction = new BRLActionColumn();
        ActionInsertFact aif = new ActionInsertFact( "Person" );
        aif.setBoundName( "$aif" );
        aif.addFieldValue( new ActionFieldValue( "rating",
                                                 null,
                                                 SuggestionCompletionEngine.TYPE_STRING ) );
        aif.fieldValues[0].nature = BaseSingleFieldConstraint.TYPE_LITERAL;

        brlAction.getDefinition().add( aif );
View Full Code Here

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

                      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

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

        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

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

        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

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

        RuleModel model = new RuleModel();

        model.rhs = new IAction[2];
        ActionInsertFact aif0 = new ActionInsertFact( "AIF0" );
        aif0.setBoundName( "$t0" );
        ActionFieldValue aif0f0 = new ActionFieldValue( "AIF0F0",
                                                        "AIF0F0Value",
                                                        SuggestionCompletionEngine.TYPE_STRING );
        aif0f0.setNature( BaseSingleFieldConstraint.TYPE_LITERAL );
        aif0.addFieldValue( aif0f0 );
        ActionFieldValue aif0f1 = new ActionFieldValue( "AIF0F1",
                                                        "AIF0F1Value",
                                                        SuggestionCompletionEngine.TYPE_STRING );
        aif0f0.setNature( BaseSingleFieldConstraint.TYPE_LITERAL );
        aif0.addFieldValue( aif0f1 );
        model.rhs[0] = aif0;

        ActionInsertFact aif1 = new ActionInsertFact( "AIF1" );
        aif1.setBoundName( "$t1" );
        ActionFieldValue aif1f0 = new ActionFieldValue( "AIF1F0",
                                                        "AIF1F0Value",
                                                        SuggestionCompletionEngine.TYPE_STRING );
        aif1f0.setNature( BaseSingleFieldConstraint.TYPE_LITERAL );
        aif1.addFieldValue( aif1f0 );
        ActionFieldValue aif1f1 = new ActionFieldValue( "AIF1F1",
                                                        "AIF1F1Value",
                                                        SuggestionCompletionEngine.TYPE_STRING );
        aif1f1.setNature( BaseSingleFieldConstraint.TYPE_LITERAL );
        aif1.addFieldValue( aif1f1 );
        model.rhs[1] = aif1;

        RuleModelCloneVisitor cloneVisitor = new RuleModelCloneVisitor();
        RuleModel clone = cloneVisitor.visitRuleModel( model );

        assertEquals( 2,
                      clone.rhs.length );

        assertNotSame( model.rhs[0],
                       clone.rhs[0] );
        assertNotNull( clone.rhs[0] );
        assertTrue( clone.rhs[0] instanceof ActionInsertFact );
        ActionInsertFact aif0Clone = (ActionInsertFact) clone.rhs[0];
        assertEquals( "AIF0",
                      aif0Clone.factType );
        assertEquals( "$t0",
                      aif0Clone.getBoundName() );
        assertEquals( 2,
                      aif0Clone.fieldValues.length );

        assertNotSame( aif0.fieldValues[0],
                       aif0Clone.fieldValues[0] );
        assertNotNull( aif0Clone.fieldValues[0] );
        assertTrue( aif0Clone.fieldValues[0] instanceof ActionFieldValue );
        ActionFieldValue aif0f0Clone = (ActionFieldValue) aif0Clone.fieldValues[0];
        assertEquals( aif0f0.field,
                      aif0f0Clone.field );
        assertEquals( aif0f0.nature,
                      aif0f0Clone.nature );
        assertEquals( aif0f0.type,
                      aif0f0Clone.type );
        assertEquals( aif0f0.value,
                      aif0f0Clone.value );

        assertNotSame( aif0.fieldValues[1],
                       aif0Clone.fieldValues[1] );
        assertNotNull( aif0Clone.fieldValues[1] );
        assertTrue( aif0Clone.fieldValues[1] instanceof ActionFieldValue );
        ActionFieldValue aif0f1Clone = (ActionFieldValue) aif0Clone.fieldValues[1];
        assertEquals( aif0f1.field,
                      aif0f1Clone.field );
        assertEquals( aif0f1.nature,
                      aif0f1Clone.nature );
        assertEquals( aif0f1.type,
                      aif0f1Clone.type );
        assertEquals( aif0f1.value,
                      aif0f1Clone.value );

        assertNotSame( model.rhs[1],
                       clone.rhs[1] );
        assertNotNull( clone.rhs[1] );
        assertTrue( clone.rhs[1] instanceof ActionInsertFact );
        ActionInsertFact aif1Clone = (ActionInsertFact) clone.rhs[1];
        assertEquals( "AIF1",
                      aif1Clone.factType );
        assertEquals( "$t1",
                      aif1Clone.getBoundName() );
        assertEquals( 2,
                      aif1Clone.fieldValues.length );

        assertNotSame( aif1.fieldValues[0],
                       aif1Clone.fieldValues[0] );
        assertNotNull( aif1Clone.fieldValues[0] );
        assertTrue( aif1Clone.fieldValues[0] instanceof ActionFieldValue );
        ActionFieldValue aif1f0Clone = (ActionFieldValue) aif1Clone.fieldValues[0];
        assertEquals( aif1f0.field,
                      aif1f0Clone.field );
        assertEquals( aif1f0.nature,
                      aif1f0Clone.nature );
        assertEquals( aif1f0.type,
                      aif1f0Clone.type );
        assertEquals( aif1f0.value,
                      aif1f0Clone.value );

        assertNotSame( aif1.fieldValues[1],
                       aif1Clone.fieldValues[1] );
        assertNotNull( aif1Clone.fieldValues[1] );
        assertTrue( aif1Clone.fieldValues[1] instanceof ActionFieldValue );
        ActionFieldValue aif1f1Clone = (ActionFieldValue) aif1Clone.fieldValues[1];
        assertEquals( aif1f1.field,
                      aif1f1Clone.field );
        assertEquals( aif1f1.nature,
                      aif1f1Clone.nature );
        assertEquals( aif1f1.type,
View Full Code Here

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

        RuleModel model = new RuleModel();

        model.rhs = new IAction[2];
        ActionSetField asf0 = new ActionSetField( "ASF0" );
        asf0.variable = "$t0";
        ActionFieldValue asf0f0 = new ActionFieldValue( "ASF0F0",
                                                        "ASF0F0Value",
                                                        SuggestionCompletionEngine.TYPE_STRING );
        asf0f0.setNature( BaseSingleFieldConstraint.TYPE_LITERAL );
        asf0.addFieldValue( asf0f0 );
        ActionFieldValue asf0f1 = new ActionFieldValue( "ASF0F1",
                                                        "ASF0F1Value",
                                                        SuggestionCompletionEngine.TYPE_STRING );
        asf0f0.setNature( BaseSingleFieldConstraint.TYPE_LITERAL );
        asf0.addFieldValue( asf0f1 );
        model.rhs[0] = asf0;

        ActionSetField asf1 = new ActionSetField( "ASF1" );
        asf1.variable = "$t1";
        ActionFieldValue asf1f0 = new ActionFieldValue( "ASF1F0",
                                                        "ASF1F0Value",
                                                        SuggestionCompletionEngine.TYPE_STRING );
        asf1f0.setNature( BaseSingleFieldConstraint.TYPE_LITERAL );
        asf1.addFieldValue( asf1f0 );
        ActionFieldValue asf1f1 = new ActionFieldValue( "ASF1F1",
                                                        "ASF1F1Value",
                                                        SuggestionCompletionEngine.TYPE_STRING );
        asf1f1.setNature( BaseSingleFieldConstraint.TYPE_LITERAL );
        asf1.addFieldValue( asf1f1 );
        model.rhs[1] = asf1;

        RuleModelCloneVisitor cloneVisitor = new RuleModelCloneVisitor();
        RuleModel clone = cloneVisitor.visitRuleModel( model );

        assertEquals( 2,
                      clone.rhs.length );

        assertNotSame( model.rhs[0],
                       clone.rhs[0] );
        assertNotNull( clone.rhs[0] );
        assertTrue( clone.rhs[0] instanceof ActionSetField );
        ActionSetField asf0Clone = (ActionSetField) clone.rhs[0];
        assertEquals( "$t0",
                      asf0Clone.variable );
        assertEquals( 2,
                      asf0Clone.fieldValues.length );

        assertNotSame( asf0.fieldValues[0],
                       asf0Clone.fieldValues[0] );
        assertNotNull( asf0Clone.fieldValues[0] );
        assertTrue( asf0Clone.fieldValues[0] instanceof ActionFieldValue );
        ActionFieldValue asf0f0Clone = (ActionFieldValue) asf0Clone.fieldValues[0];
        assertEquals( asf0f0.field,
                      asf0f0Clone.field );
        assertEquals( asf0f0.nature,
                      asf0f0Clone.nature );
        assertEquals( asf0f0.type,
                      asf0f0Clone.type );
        assertEquals( asf0f0.value,
                      asf0f0Clone.value );

        assertNotSame( asf0.fieldValues[1],
                       asf0Clone.fieldValues[1] );
        assertNotNull( asf0Clone.fieldValues[1] );
        assertTrue( asf0Clone.fieldValues[1] instanceof ActionFieldValue );
        ActionFieldValue asf0f1Clone = (ActionFieldValue) asf0Clone.fieldValues[1];
        assertEquals( asf0f1.field,
                      asf0f1Clone.field );
        assertEquals( asf0f1.nature,
                      asf0f1Clone.nature );
        assertEquals( asf0f1.type,
                      asf0f1Clone.type );
        assertEquals( asf0f1.value,
                      asf0f1Clone.value );

        assertNotSame( model.rhs[1],
                       clone.rhs[1] );
        assertNotNull( clone.rhs[1] );
        assertTrue( clone.rhs[1] instanceof ActionSetField );
        ActionSetField asf1Clone = (ActionSetField) clone.rhs[1];
        assertEquals( "$t1",
                      asf1Clone.variable );
        assertEquals( 2,
                      asf1Clone.fieldValues.length );

        assertNotSame( asf1.fieldValues[0],
                       asf1Clone.fieldValues[0] );
        assertNotNull( asf1Clone.fieldValues[0] );
        assertTrue( asf1Clone.fieldValues[0] instanceof ActionFieldValue );
        ActionFieldValue asf1f0Clone = (ActionFieldValue) asf1Clone.fieldValues[0];
        assertEquals( asf1f0.field,
                      asf1f0Clone.field );
        assertEquals( asf1f0.nature,
                      asf1f0Clone.nature );
        assertEquals( asf1f0.type,
                      asf1f0Clone.type );
        assertEquals( asf1f0.value,
                      asf1f0Clone.value );

        assertNotSame( asf1.fieldValues[1],
                       asf1Clone.fieldValues[1] );
        assertNotNull( asf1Clone.fieldValues[1] );
        assertTrue( asf1Clone.fieldValues[1] instanceof ActionFieldValue );
        ActionFieldValue asf1f1Clone = (ActionFieldValue) asf1Clone.fieldValues[1];
        assertEquals( asf1f1.field,
                      asf1f1Clone.field );
        assertEquals( asf1f1.nature,
                      asf1f1Clone.nature );
        assertEquals( asf1f1.type,
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.