use of org.kie.workbench.common.dmn.webapp.kogito.marshaller.js.model.dmndi12.JSIDMNDiagram in project kie-wb-common by kiegroup.
the class DRGDiagramUtils method newJSIDRGInstance.
public static JSIDMNDiagram newJSIDRGInstance() {
final JSIDMNDiagram diagram = new JSIDMNDiagram();
diagram.setId(new Id().getValue());
diagram.setName(DRG);
return diagram;
}
use of org.kie.workbench.common.dmn.webapp.kogito.marshaller.js.model.dmndi12.JSIDMNDiagram in project kie-wb-common by kiegroup.
the class DMNUnmarshaller method findComponentsWidthsExtensions.
private List<JSITComponentsWidthsExtension> findComponentsWidthsExtensions(final List<JSIDMNDiagram> dmnDDDiagrams) {
final List<JSITComponentsWidthsExtension> componentsWidthsExtensions = new ArrayList<>();
for (int index = 0, dmnDiagram1Size = dmnDDDiagrams.size(); index < dmnDiagram1Size; index++) {
final JSIDMNDiagram jsiDiagram = Js.uncheckedCast(dmnDDDiagrams.get(index));
final JSIDiagramElement.JSIExtension dmnDDExtensions = Js.uncheckedCast(jsiDiagram.getExtension());
if (Objects.isNull(dmnDDExtensions)) {
break;
}
if (Objects.isNull(dmnDDExtensions.getAny())) {
break;
}
final List<Object> extensions = dmnDDExtensions.getAny();
if (!Objects.isNull(extensions)) {
for (int i = 0; i < extensions.size(); i++) {
final Object wrapped = extensions.get(i);
final Object extension = JsUtils.getUnwrappedElement(wrapped);
if (JSITComponentsWidthsExtension.instanceOf(extension)) {
final JSITComponentsWidthsExtension jsiExtension = Js.uncheckedCast(extension);
componentsWidthsExtensions.add(jsiExtension);
}
}
}
}
return componentsWidthsExtensions;
}
use of org.kie.workbench.common.dmn.webapp.kogito.marshaller.js.model.dmndi12.JSIDMNDiagram in project kie-wb-common by kiegroup.
the class IdUtilsTest method testGetShapeIdWhenDiagramNameIsNull.
@Test
public void testGetShapeIdWhenDiagramNameIsNull() {
final JSIDMNDiagram diagram = mock(JSIDMNDiagram.class);
assertEquals("dmnshape-_1111-2222", getShapeId(diagram, list(), "_1111-2222"));
}
use of org.kie.workbench.common.dmn.webapp.kogito.marshaller.js.model.dmndi12.JSIDMNDiagram in project kie-wb-common by kiegroup.
the class NodeEntriesFactory method getShapesByDiagramId.
private Map<JSIDMNShape, String> getShapesByDiagramId(final JSITDefinitions definitions) {
final Map<JSIDMNShape, String> dmnShapesByDiagramId = new HashMap<>();
final List<JSIDMNDiagram> diagrams = definitions.getDMNDI().getDMNDiagram();
forEach(diagrams, diagram -> {
final String diagramId = diagram.getId();
final List<JSIDiagramElement> diagramElements = diagram.getDMNDiagramElement();
forEach(diagramElements, diagramElement -> {
if (JSIDMNShape.instanceOf(diagramElement)) {
final JSIDMNShape shape = Js.uncheckedCast(diagramElement);
dmnShapesByDiagramId.put(shape, diagramId);
}
});
});
return dmnShapesByDiagramId;
}
Aggregations