use of org.kie.workbench.common.dmn.webapp.kogito.marshaller.js.model.dmn12.JSITDRGElement in project kie-wb-common by kiegroup.
the class DMNMarshaller method addNodeToDefinitions.
void addNodeToDefinitions(final JSITDRGElement node, final JSITDefinitions definitions) {
final JSINodeLocalPartName localPart = getLocalPart(node);
final JSITDRGElement toAdd = getWrappedJSITDRGElement(node, localPart);
definitions.addDrgElement(toAdd);
}
use of org.kie.workbench.common.dmn.webapp.kogito.marshaller.js.model.dmn12.JSITDRGElement in project kie-wb-common by kiegroup.
the class DMNExternalLinksToExtensionElements method loadExternalLinksIntoExtensionElements.
static void loadExternalLinksIntoExtensionElements(final DRGElement source, final JSITDRGElement target) {
if (Objects.isNull(source.getLinksHolder()) || Objects.isNull(source.getLinksHolder().getValue())) {
return;
}
final DocumentationLinks links = source.getLinksHolder().getValue();
final JSITDMNElement.JSIExtensionElements elements = getOrCreateExtensionElements(target);
removeAllExistingLinks(elements);
for (final DMNExternalLink link : links.getLinks()) {
final JSITAttachment attachment = new JSITAttachment();
attachment.setName(link.getDescription());
attachment.setUrl(link.getUrl());
final JSITAttachment wrappedAttachment = WrapperUtils.getWrappedJSITAttachment(attachment);
elements.addAny(wrappedAttachment);
}
target.setExtensionElements(elements);
}
use of org.kie.workbench.common.dmn.webapp.kogito.marshaller.js.model.dmn12.JSITDRGElement in project kie-wb-common by kiegroup.
the class DMNMarshallerImportsClientHelper method getImportedDRGElements.
@Override
public List<JSITDRGElement> getImportedDRGElements(final Map<JSITImport, JSITDefinitions> importDefinitions) {
final List<JSITDRGElement> importedNodes = new ArrayList<>();
for (final Map.Entry<JSITImport, JSITDefinitions> entry : importDefinitions.entrySet()) {
final JSITImport anImport = Js.uncheckedCast(entry.getKey());
final JSITDefinitions definitions = Js.uncheckedCast(entry.getValue());
importedNodes.addAll(getDrgElementsWithNamespace(definitions, anImport));
}
return importedNodes;
}
use of org.kie.workbench.common.dmn.webapp.kogito.marshaller.js.model.dmn12.JSITDRGElement in project kie-wb-common by kiegroup.
the class DMNMarshaller method getExistingNode.
Optional<JSITDRGElement> getExistingNode(final JSITDefinitions definitions, final JSITDRGElement node) {
final JSITDRGElement[] existingDRGElement = new JSITDRGElement[1];
forEach(definitions.getDrgElement(), drgElement -> {
if (Objects.equals(drgElement.getId(), node.getId())) {
existingDRGElement[0] = drgElement;
}
});
final JSITDRGElement value = Js.uncheckedCast(existingDRGElement[0]);
return Optional.ofNullable(value);
}
Aggregations