@Test public void testWbFromDMNWhenGeneric() { final org.kie.dmn.model.api.Import dmn = new TImport(); dmn.setImportType("cheese"); final Definitions definitions = mock(Definitions.class); final PMMLDocumentMetadata pmmlDocument = mock(PMMLDocumentMetadata.class); final org.kie.workbench.common.dmn.api.definition.model.Import anImport = ImportConverter.wbFromDMN(dmn, definitions, pmmlDocument); assertNotNull(anImport); }
public static Import wbFromDMN(final org.kie.dmn.model.api.Import dmn, final Definitions definitions, final PMMLDocumentMetadata pmmlDocument) { final Import result = createWBImport(dmn, definitions, pmmlDocument); final Map<QName, String> additionalAttributes = new HashMap<>(); for (Map.Entry<javax.xml.namespace.QName, String> entry : dmn.getAdditionalAttributes().entrySet()) { additionalAttributes.put(QNamePropertyConverter.wbFromDMN(entry.getKey(), dmn), entry.getValue()); } result.setAdditionalAttributes(additionalAttributes); final String id = dmn.getId(); final String name = dmn.getName(); final String description = dmn.getDescription(); result.setId(new Id(id != null ? id : UUID.randomUUID().toString())); result.setName(new Name(name)); result.setDescription(DescriptionPropertyConverter.wbFromDMN(description)); dmn.getNsContext().forEach((key, value) -> result.getNsContext().put(key, value)); return result; }
ImportConverter { public static Import wbFromDMN(final org.kie.dmn.model.api.Import dmn, final Definitions definitions, final PMMLDocumentMetadata pmmlDocument) { final Import result = createWBImport(dmn, definitions, pmmlDocument); final Map<QName, String> additionalAttributes = new HashMap<>(); for (Map.Entry<javax.xml.namespace.QName, String> entry : dmn.getAdditionalAttributes().entrySet()) { additionalAttributes.put(QNamePropertyConverter.wbFromDMN(entry.getKey(), dmn), entry.getValue()); } result.setAdditionalAttributes(additionalAttributes); final String id = dmn.getId(); final String name = dmn.getName(); final String description = dmn.getDescription(); result.setId(new Id(id != null ? id : UUID.randomUUID().toString())); result.setName(new Name(name)); result.setDescription(DescriptionPropertyConverter.wbFromDMN(description)); dmn.getNsContext().forEach((key, value) -> result.getNsContext().put(key, value)); return result; } }
ImportConverter { public static Import wbFromDMN(final org.kie.dmn.model.api.Import dmn, final Definitions definitions, final PMMLDocumentMetadata pmmlDocument) { final Import result = createWBImport(dmn, definitions, pmmlDocument); final Map<QName, String> additionalAttributes = new HashMap<>(); for (Map.Entry<javax.xml.namespace.QName, String> entry : dmn.getAdditionalAttributes().entrySet()) { additionalAttributes.put(QNamePropertyConverter.wbFromDMN(entry.getKey(), dmn), entry.getValue()); } result.setAdditionalAttributes(additionalAttributes); final String id = dmn.getId(); final String name = dmn.getName(); final String description = dmn.getDescription(); result.setId(new Id(id != null ? id : UUID.randomUUID().toString())); result.setName(new Name(name)); result.setDescription(DescriptionPropertyConverter.wbFromDMN(description)); dmn.getNsContext().forEach((key, value) -> result.getNsContext().put(key, value)); return result; }  }
ImportConverter { public static Import wbFromDMN(final org.kie.dmn.model.api.Import dmn, final Definitions definitions, final PMMLDocumentMetadata pmmlDocument) { final Import result = createWBImport(dmn, definitions, pmmlDocument); final Map<QName, String> additionalAttributes = new HashMap<>(); for (Map.Entry<javax.xml.namespace.QName, String> entry : dmn.getAdditionalAttributes().entrySet()) { additionalAttributes.put(QNamePropertyConverter.wbFromDMN(entry.getKey(), dmn), entry.getValue()); } result.setAdditionalAttributes(additionalAttributes); final String id = dmn.getId(); final String name = dmn.getName(); final String description = dmn.getDescription(); result.setId(new Id(id != null ? id : UUID.randomUUID().toString())); result.setName(new Name(name)); result.setDescription(DescriptionPropertyConverter.wbFromDMN(description)); dmn.getNsContext().forEach((key, value) -> result.getNsContext().put(key, value)); return result; }  static Import wbFromDMN(final org.kie.dmn.model.api.Import dmn,
                                   final Definitions definitions,
                                   final PMMLDocumentMetadata pmmlDocument); static org.kie.dmn.model.api.Import dmnFromWb(final Import wb); }
ImportConverter { public static Import wbFromDMN(final org.kie.dmn.model.api.Import dmn, final Definitions definitions, final PMMLDocumentMetadata pmmlDocument) { final Import result = createWBImport(dmn, definitions, pmmlDocument); final Map<QName, String> additionalAttributes = new HashMap<>(); for (Map.Entry<javax.xml.namespace.QName, String> entry : dmn.getAdditionalAttributes().entrySet()) { additionalAttributes.put(QNamePropertyConverter.wbFromDMN(entry.getKey(), dmn), entry.getValue()); } result.setAdditionalAttributes(additionalAttributes); final String id = dmn.getId(); final String name = dmn.getName(); final String description = dmn.getDescription(); result.setId(new Id(id != null ? id : UUID.randomUUID().toString())); result.setName(new Name(name)); result.setDescription(DescriptionPropertyConverter.wbFromDMN(description)); dmn.getNsContext().forEach((key, value) -> result.getNsContext().put(key, value)); return result; }  static Import wbFromDMN(final org.kie.dmn.model.api.Import dmn,
                                   final Definitions definitions,
                                   final PMMLDocumentMetadata pmmlDocument); static org.kie.dmn.model.api.Import dmnFromWb(final Import wb);  }