@Test public void getDMNTypesMapWithItemDefinitions() { jstiItemDefinitions.add(jsitItemDefinitionMock); Map<String, ClientDMNType> dmnTypesMap = abstractKogitoDMNServiceSpy.getDMNDataTypesMap(jstiItemDefinitions, NAMESPACE); assertTrue(dmnTypesMap.size() == 15); for (BuiltInType builtInType : BuiltInType.values()) { Arrays.stream(builtInType.getNames()).forEach(name -> assertNotNull(dmnTypesMap.get(name))); } assertNotNull(dmnTypesMap.get(TYPE_NAME)); assertNull(dmnTypesMap.get(TYPE_NAME).getFeelType()); assertEquals(TYPE_NAME, dmnTypesMap.get(TYPE_NAME).getName()); assertEquals(NAMESPACE, dmnTypesMap.get(TYPE_NAME).getNamespace()); assertFalse(dmnTypesMap.get(TYPE_NAME).isCollection()); }
protected Map<String, ClientDMNType> getDMNDataTypesMap(final List<JSITItemDefinition> jsitItemDefinitions, final String nameSpace) { Map<String, ClientDMNType> dmnDataTypesMap = new HashMap<>(); for (BuiltInType type : BuiltInType.values()) { for (String name : type.getNames()) { ClientDMNType feelPrimitiveType; if (type == BuiltInType.CONTEXT) { feelPrimitiveType = new ClientDMNType(URI_FEEL, name, null, false, true, Collections.emptyMap(), type); } else { feelPrimitiveType = new ClientDMNType(URI_FEEL, name, null, false, type); } dmnDataTypesMap.put(name, feelPrimitiveType); } } final Map<String, JSITItemDefinition> itemDefinitionMap = indexDefinitionsByName(jsitItemDefinitions); for (int i = 0; i < jsitItemDefinitions.size(); i++) { final JSITItemDefinition jsitItemDefinition = Js.uncheckedCast(jsitItemDefinitions.get(i)); getOrCreateDMNType(itemDefinitionMap, jsitItemDefinition.getName(), nameSpace, dmnDataTypesMap); } return Collections.unmodifiableMap(dmnDataTypesMap); }
AbstractKogitoDMNService implements KogitoDMNService { protected Map<String, ClientDMNType> getDMNDataTypesMap(final List<JSITItemDefinition> jsitItemDefinitions, final String nameSpace) { Map<String, ClientDMNType> dmnDataTypesMap = new HashMap<>(); for (BuiltInType type : BuiltInType.values()) { for (String name : type.getNames()) { ClientDMNType feelPrimitiveType; if (type == BuiltInType.CONTEXT) { feelPrimitiveType = new ClientDMNType(URI_FEEL, name, null, false, true, Collections.emptyMap(), type); } else { feelPrimitiveType = new ClientDMNType(URI_FEEL, name, null, false, type); } dmnDataTypesMap.put(name, feelPrimitiveType); } } final Map<String, JSITItemDefinition> itemDefinitionMap = indexDefinitionsByName(jsitItemDefinitions); for (int i = 0; i < jsitItemDefinitions.size(); i++) { final JSITItemDefinition jsitItemDefinition = Js.uncheckedCast(jsitItemDefinitions.get(i)); getOrCreateDMNType(itemDefinitionMap, jsitItemDefinition.getName(), nameSpace, dmnDataTypesMap); } return Collections.unmodifiableMap(dmnDataTypesMap); } }
AbstractKogitoDMNService implements KogitoDMNService { protected Map<String, ClientDMNType> getDMNDataTypesMap(final List<JSITItemDefinition> jsitItemDefinitions, final String nameSpace) { Map<String, ClientDMNType> dmnDataTypesMap = new HashMap<>(); for (BuiltInType type : BuiltInType.values()) { for (String name : type.getNames()) { ClientDMNType feelPrimitiveType; if (type == BuiltInType.CONTEXT) { feelPrimitiveType = new ClientDMNType(URI_FEEL, name, null, false, true, Collections.emptyMap(), type); } else { feelPrimitiveType = new ClientDMNType(URI_FEEL, name, null, false, type); } dmnDataTypesMap.put(name, feelPrimitiveType); } } final Map<String, JSITItemDefinition> itemDefinitionMap = indexDefinitionsByName(jsitItemDefinitions); for (int i = 0; i < jsitItemDefinitions.size(); i++) { final JSITItemDefinition jsitItemDefinition = Js.uncheckedCast(jsitItemDefinitions.get(i)); getOrCreateDMNType(itemDefinitionMap, jsitItemDefinition.getName(), nameSpace, dmnDataTypesMap); } return Collections.unmodifiableMap(dmnDataTypesMap); }  }
AbstractKogitoDMNService implements KogitoDMNService { protected Map<String, ClientDMNType> getDMNDataTypesMap(final List<JSITItemDefinition> jsitItemDefinitions, final String nameSpace) { Map<String, ClientDMNType> dmnDataTypesMap = new HashMap<>(); for (BuiltInType type : BuiltInType.values()) { for (String name : type.getNames()) { ClientDMNType feelPrimitiveType; if (type == BuiltInType.CONTEXT) { feelPrimitiveType = new ClientDMNType(URI_FEEL, name, null, false, true, Collections.emptyMap(), type); } else { feelPrimitiveType = new ClientDMNType(URI_FEEL, name, null, false, type); } dmnDataTypesMap.put(name, feelPrimitiveType); } } final Map<String, JSITItemDefinition> itemDefinitionMap = indexDefinitionsByName(jsitItemDefinitions); for (int i = 0; i < jsitItemDefinitions.size(); i++) { final JSITItemDefinition jsitItemDefinition = Js.uncheckedCast(jsitItemDefinitions.get(i)); getOrCreateDMNType(itemDefinitionMap, jsitItemDefinition.getName(), nameSpace, dmnDataTypesMap); } return Collections.unmodifiableMap(dmnDataTypesMap); }  @Override FactModelTuple getFactModelTuple(final JSITDefinitions jsitDefinitions); boolean isJSITInputData(JSITDRGElement jsitdrgElement); boolean isJSITDecision(JSITDRGElement jsitdrgElement); Map<QName, String> getOtherAttributesMap(JSITDMNElement jsitInputDataVariable); }
AbstractKogitoDMNService implements KogitoDMNService { protected Map<String, ClientDMNType> getDMNDataTypesMap(final List<JSITItemDefinition> jsitItemDefinitions, final String nameSpace) { Map<String, ClientDMNType> dmnDataTypesMap = new HashMap<>(); for (BuiltInType type : BuiltInType.values()) { for (String name : type.getNames()) { ClientDMNType feelPrimitiveType; if (type == BuiltInType.CONTEXT) { feelPrimitiveType = new ClientDMNType(URI_FEEL, name, null, false, true, Collections.emptyMap(), type); } else { feelPrimitiveType = new ClientDMNType(URI_FEEL, name, null, false, type); } dmnDataTypesMap.put(name, feelPrimitiveType); } } final Map<String, JSITItemDefinition> itemDefinitionMap = indexDefinitionsByName(jsitItemDefinitions); for (int i = 0; i < jsitItemDefinitions.size(); i++) { final JSITItemDefinition jsitItemDefinition = Js.uncheckedCast(jsitItemDefinitions.get(i)); getOrCreateDMNType(itemDefinitionMap, jsitItemDefinition.getName(), nameSpace, dmnDataTypesMap); } return Collections.unmodifiableMap(dmnDataTypesMap); }  @Override FactModelTuple getFactModelTuple(final JSITDefinitions jsitDefinitions); boolean isJSITInputData(JSITDRGElement jsitdrgElement); boolean isJSITDecision(JSITDRGElement jsitdrgElement); Map<QName, String> getOtherAttributesMap(JSITDMNElement jsitInputDataVariable); static final String URI_FEEL; static final String WRONG_DMN_MESSAGE; }