Search in sources :

Example 6 with ObjectField

use of org.drools.verifier.core.index.model.ObjectField in project drools by kiegroup.

the class FieldInspectorRelationsTest method setUp.

@Before
public void setUp() throws Exception {
    configurationMock = new AnalyzerConfigurationMock();
    ObjectField objectField = mock(ObjectField.class);
    a = new FieldInspector(new Field(objectField, "org.Person", "String", "name", configurationMock), mock(RuleInspectorUpdater.class), mock(AnalyzerConfiguration.class));
    b = new FieldInspector(new Field(objectField, "org.Person", "String", "name", configurationMock), mock(RuleInspectorUpdater.class), mock(AnalyzerConfiguration.class));
}
Also used : Field(org.drools.verifier.core.index.model.Field) ObjectField(org.drools.verifier.core.index.model.ObjectField) AnalyzerConfigurationMock(org.drools.verifier.core.AnalyzerConfigurationMock) ObjectField(org.drools.verifier.core.index.model.ObjectField) Before(org.junit.Before)

Example 7 with ObjectField

use of org.drools.verifier.core.index.model.ObjectField in project drools-wb by kiegroup.

the class Utils method resolveObjectField.

public static ObjectField resolveObjectField(final ObjectType objectType, final String fieldType, final String factField, final AnalyzerConfiguration configuration) {
    final ObjectField first = objectType.getFields().where(Field.name().is(factField)).select().first();
    if (first == null) {
        final ObjectField objectField = new ObjectField(objectType.getType(), fieldType, factField, configuration);
        objectType.getFields().add(objectField);
        return objectField;
    } else {
        return first;
    }
}
Also used : ObjectField(org.drools.verifier.core.index.model.ObjectField)

Aggregations

ObjectField (org.drools.verifier.core.index.model.ObjectField)7 Field (org.drools.verifier.core.index.model.Field)4 AnalyzerConfigurationMock (org.drools.verifier.core.AnalyzerConfigurationMock)3 Before (org.junit.Before)3 ArrayList (java.util.ArrayList)2 HashMap (java.util.HashMap)2 List (java.util.List)2 Map (java.util.Map)2 Collectors.toList (java.util.stream.Collectors.toList)2 FieldCondition (org.drools.verifier.core.index.model.FieldCondition)2 Arrays (java.util.Arrays)1 Collection (java.util.Collection)1 Comparator (java.util.Comparator)1 Date (java.util.Date)1 HashSet (java.util.HashSet)1 Iterator (java.util.Iterator)1 Entry (java.util.Map.Entry)1 Objects (java.util.Objects)1 Set (java.util.Set)1 SortedSet (java.util.SortedSet)1