Skip to content

Commit

Permalink
fix(dmn-js): Load DMN models in right format
Browse files Browse the repository at this point in the history
  • Loading branch information
berndruecker authored and ralfpuchert committed Mar 1, 2022
1 parent 29501d5 commit 749a0b0
Showing 1 changed file with 31 additions and 27 deletions.
58 changes: 31 additions & 27 deletions static/js/bpmn-js-rendering.js
Original file line number Diff line number Diff line change
Expand Up @@ -112,34 +112,38 @@ async function renderBpmn(index, element) {

var dmnUrl = adjustUrl(element.attr("dmn"));

$.get(dmnUrl, async function (dmnDiagram) {
try {
await viewer.importXML(dmnDiagram);
if (element.attr("callouts")) {
// prepare a small array of callout objects
var callouts = [];
element.attr("callouts").split(',').forEach(function(entry) {
var ent = {
col: entry.split(':')[0],
row: entry.split(':')[1]
};
callouts.push(ent);
});

var i = 1;
callouts.forEach( callout => {
addOverlayToDmn(dmnId, callout, i);
i = i+1;
});
}
$.ajax({
url: dmnUrl,
dataType: "text",
success: async function (dmnDiagram) {
try {
await viewer.importXML(dmnDiagram);
if (element.attr("callouts")) {
// prepare a small array of callout objects
var callouts = [];
element.attr("callouts").split(',').forEach(function(entry) {
var ent = {
col: entry.split(':')[0],
row: entry.split(':')[1]
};
callouts.push(ent);
});

var i = 1;
callouts.forEach( callout => {
addOverlayToDmn(dmnId, callout, i);
i = i+1;
});
}

/*/enable thumbs
thumbs = thumbs ? " " + thumbs : "";
dmnDiv.attr("class", "tjs-asciidoc" + thumbs);
*/
scrollToHash();
} catch (err) {
console.log("Error while rendering " + element.attr("dmn") + ": ", err);
/*/enable thumbs
thumbs = thumbs ? " " + thumbs : "";
dmnDiv.attr("class", "tjs-asciidoc" + thumbs);
*/
scrollToHash();
} catch (err) {
console.log("Error while rendering " + element.attr("dmn") + ": ", err);
}
}
});
}
Expand Down

0 comments on commit 749a0b0

Please sign in to comment.