@Test public void testGetWbImportedItemDefinitions() { final org.kie.dmn.model.api.ItemDefinition itemDefinition1 = makeItemDefinition("model1.tUUID"); final org.kie.dmn.model.api.ItemDefinition itemDefinition2 = makeItemDefinition("model1.tPerson"); final org.kie.dmn.model.api.ItemDefinition itemDefinition3 = makeItemDefinition("model2.tNum"); final Map<Import, org.kie.dmn.model.api.Definitions> importDefinitions = new HashMap<>(); when(dmnMarshallerImportsHelper.getImportedItemDefinitions(importDefinitions)).thenReturn(asList(itemDefinition1, itemDefinition2, itemDefinition3)); final List<ItemDefinition> actualItemDefinitions = getDMNMarshaller().getWbImportedItemDefinitions(importDefinitions); assertEquals(3, actualItemDefinitions.size()); assertEquals("model1.tUUID", actualItemDefinitions.get(0).getName().getValue()); assertEquals("model1.tPerson", actualItemDefinitions.get(1).getName().getValue()); assertEquals("model2.tNum", actualItemDefinitions.get(2).getName().getValue()); }
List<org.kie.workbench.common.dmn.api.definition.model.ItemDefinition> getWbImportedItemDefinitions(final Map<Import, org.kie.dmn.model.api.Definitions> importDefinitions) { return dmnMarshallerImportsHelper .getImportedItemDefinitions(importDefinitions) .stream() .map(ItemDefinitionPropertyConverter::wbFromDMN) .peek(itemDefinition -> itemDefinition.setAllowOnlyVisualChange(true)) .collect(Collectors.toList()); }
DMNMarshallerStandalone implements DiagramMarshaller<Graph, Metadata, Diagram<Graph, Metadata>> { List<org.kie.workbench.common.dmn.api.definition.model.ItemDefinition> getWbImportedItemDefinitions(final Map<Import, org.kie.dmn.model.api.Definitions> importDefinitions) { return dmnMarshallerImportsHelper .getImportedItemDefinitions(importDefinitions) .stream() .map(ItemDefinitionPropertyConverter::wbFromDMN) .peek(itemDefinition -> itemDefinition.setAllowOnlyVisualChange(true)) .collect(Collectors.toList()); } }
DMNMarshallerStandalone implements DiagramMarshaller<Graph, Metadata, Diagram<Graph, Metadata>> { List<org.kie.workbench.common.dmn.api.definition.model.ItemDefinition> getWbImportedItemDefinitions(final Map<Import, org.kie.dmn.model.api.Definitions> importDefinitions) { return dmnMarshallerImportsHelper .getImportedItemDefinitions(importDefinitions) .stream() .map(ItemDefinitionPropertyConverter::wbFromDMN) .peek(itemDefinition -> itemDefinition.setAllowOnlyVisualChange(true)) .collect(Collectors.toList()); } protected  DMNMarshallerStandalone(); @Inject  DMNMarshallerStandalone(final XMLEncoderDiagramMetadataMarshaller diagramMetadataMarshaller,
                                   final FactoryManager factoryManager,
                                   final DMNMarshallerImportsHelperStandalone dmnMarshallerImportsHelper,
                                   final DMNMarshaller marshaller); }
DMNMarshallerStandalone implements DiagramMarshaller<Graph, Metadata, Diagram<Graph, Metadata>> { List<org.kie.workbench.common.dmn.api.definition.model.ItemDefinition> getWbImportedItemDefinitions(final Map<Import, org.kie.dmn.model.api.Definitions> importDefinitions) { return dmnMarshallerImportsHelper .getImportedItemDefinitions(importDefinitions) .stream() .map(ItemDefinitionPropertyConverter::wbFromDMN) .peek(itemDefinition -> itemDefinition.setAllowOnlyVisualChange(true)) .collect(Collectors.toList()); } protected  DMNMarshallerStandalone(); @Inject  DMNMarshallerStandalone(final XMLEncoderDiagramMetadataMarshaller diagramMetadataMarshaller,
                                   final FactoryManager factoryManager,
                                   final DMNMarshallerImportsHelperStandalone dmnMarshallerImportsHelper,
                                   final DMNMarshaller marshaller); @Override @SuppressWarnings("unchecked") Graph unmarshall(final Metadata metadata,
                            final InputStream input); static Node<?, ?> findDMNDiagramRoot(final Graph<?, Node<View, ?>> graph); @SuppressWarnings({"rawtypes", "unchecked"}) static void connectRootWithChild(final Node dmnDiagramRoot,
                                            final Node child); @SuppressWarnings({"rawtypes", "unchecked"}) static void connectEdge(final Edge edge,
                                   final Node source,
                                   final Node target); @Override @SuppressWarnings("unchecked") String marshall(final Diagram<Graph, Metadata> diagram); @Override DiagramMetadataMarshaller<Metadata> getMetadataMarshaller(); }
DMNMarshallerStandalone implements DiagramMarshaller<Graph, Metadata, Diagram<Graph, Metadata>> { List<org.kie.workbench.common.dmn.api.definition.model.ItemDefinition> getWbImportedItemDefinitions(final Map<Import, org.kie.dmn.model.api.Definitions> importDefinitions) { return dmnMarshallerImportsHelper .getImportedItemDefinitions(importDefinitions) .stream() .map(ItemDefinitionPropertyConverter::wbFromDMN) .peek(itemDefinition -> itemDefinition.setAllowOnlyVisualChange(true)) .collect(Collectors.toList()); } protected  DMNMarshallerStandalone(); @Inject  DMNMarshallerStandalone(final XMLEncoderDiagramMetadataMarshaller diagramMetadataMarshaller,
                                   final FactoryManager factoryManager,
                                   final DMNMarshallerImportsHelperStandalone dmnMarshallerImportsHelper,
                                   final DMNMarshaller marshaller); @Override @SuppressWarnings("unchecked") Graph unmarshall(final Metadata metadata,
                            final InputStream input); static Node<?, ?> findDMNDiagramRoot(final Graph<?, Node<View, ?>> graph); @SuppressWarnings({"rawtypes", "unchecked"}) static void connectRootWithChild(final Node dmnDiagramRoot,
                                            final Node child); @SuppressWarnings({"rawtypes", "unchecked"}) static void connectEdge(final Edge edge,
                                   final Node source,
                                   final Node target); @Override @SuppressWarnings("unchecked") String marshall(final Diagram<Graph, Metadata> diagram); @Override DiagramMetadataMarshaller<Metadata> getMetadataMarshaller(); static final String INFO_REQ_ID; static final String KNOWLEDGE_REQ_ID; static final String AUTH_REQ_ID; static final String ASSOCIATION_ID; }