Hi,
When I tried to update bpmn to 17.9.2 from 0.22.1 in my application, I am getting below error from the bpmn-modeler.js file.
‘no diagram to display’
Could you please let me know how to resolve this?
Hi,
Please read the changelog breaking changes as updating 17 major versions up is quite unusual.
Hi,
The change log from v0.x to 17.x seems to have a large list of changes. Is it possible to upgrade from v0.x to 17.x? If so could you please let me know what are the key points to be checked to resolve these kind of issues?
It is certainly possible, but we don’t have any guides on such a big upgrade.
For further assistance, please share a CodeSandbox that reproduces your issue in a way that we can inspect it.
If so could you please let me know what are the key points to be checked to resolve these kind of issues?
Some standard techniques:
- Read through BREAKING CHANGES and see if you may or may not be affected
- Bisect, i.e. try an incremental upgrade and see where it breaks
It should not be too hard for you to figure out what breaks where.
Hi,
When checked the change logs I can see businessObject() is changed but I am currently using that in my code.
bpmnModeler.get(‘elementRegistry’).get(‘Participant_0q1tuee’).businessObject.set(
‘xmlns:sonet’, ‘http://sonet.com.au/’
);
bpmnModeler.get(‘elementRegistry’) is getting it’s value but bpmnModeler.get(‘elementRegistry’).get(‘Participant_0q1tuee’) is getting undefined even though the id ‘Participant_0q1tuee’ exists
Since this is not valid when upgrading to v17, Could you please help me to know how can I make this available
Have you tried to bisect as @nikku suggested above?
Also, without a way to reproduce your issue, it’s impossible to anybody to provide help above guessing what your problem is. Please share a codesandbox: Issue when updating from 0.22.1 to 17.9.2 - #4 by barmac
Hi, I am new to bpmn and the forum, Could you please try to understand the issue and help me to resolve it. I’m not able to reproduce the issue with the codesandbox since I am not able to access the sandbox.
The initial issue which I mentioned was fixed and currently having another issue. I am sharing the code below.
bpmnModeler.get(‘elementRegistry’).get(‘Participant_0q1tuee’).businessObject.set(
‘xmlns:sonet’, ‘http://sonet.com.au/’
);
Above is the existing code in my application which is written for v0.22.1, After upgrading to v17.9.2 I am getting undefined for the participant id.
bpmnModeler.get(‘elementRegistry’) is getting it’s value which is like
The above data has the participant id which is ‘Participant_0q1tuee’ but when I tried bpmnModeler.get(‘elementRegistry’).get(‘Participant_0q1tuee’) which is the existing code, I am getting undefined.
I hope you understand the issue, Could you please help me to resolve this?
Hi @barmac ,
Currently facing the issue missing namespace information for … , I assume it is due to businessObject. Could you please help me to resolve those. Below is the code :-
bpmnModeler.get(‘elementRegistry’).get(‘Participant_0q1tuee’).businessObject.set(
‘xmlns:sonet’, ‘http://sonet.com.au/’
);
The above code is getting undefined but the value is getting up to Participant_0q1tuee. Please suggest the alternative that can be used for businessObject in the latest version since there are some breaking changes for the businessObject(Decouple DIs from business Objects · Issue #1472 · bpmn-io/bpmn-js · GitHub).
FYI, I am using the pre-packed version for the upgrade.
Please share more of your code, specifically lines around where the bpmnModeler.get(‘elementRegistry’).get(‘Participant_0q1tuee’).businessObject.set( ‘xmlns:sonet’, ‘http://sonet.com.au/’ );
line is present.
My wild guess is that you call it right after bpmnModeler.importXML
which then fails because since v14 the call returns a Promise, so your model is not imported yet when you try to get the participant (bpmn-js/CHANGELOG.md at develop · bpmn-io/bpmn-js · GitHub).
However, this is just a wild guess. Until you find out on which version breaks your application, e.g. via bisect technique mentioned by Nico, we will not be able to help.
Hi @barmac ,
Could you please check the related code and update.
await bpmnModeler.importXML(xml);
var canvas = bpmnModeler.get('canvas');
canvas.zoom('fit-viewport');
bpmnModeler.get('elementRegistry').get('Participant_0q1tuee').businessObject.set(
'xmlns:sonet', 'http://sonet.com.au/'
);
var modeling = bpmnModeler.get('modeling');
var mainProcess = bpmnModeler.get('elementRegistry').get('Participant_0q1tuee');
modeling.updateProperties(mainProcess, {
name : $scope.assetMetadata.title
});
Does the XML contain the ID? Let’s console.log
what bpmnModeler.get('elementRegistry').get('Participant_0q1tuee')
returns;
@barmac The xml contains the id Participant_0q1tuee, the value of bpmnModeler.get(‘elementRegistry’).get(‘Participant_0q1tuee’) is
{
"labels": [],
"children": [
{
"labels": [],
"children": [],
"id": "Lane_1ygjgpp",
"width": 608,
"height": 118,
"type": "bpmn:Lane",
"di": {
"$type": "bpmndi:BPMNShape",
"id": "Lane_1ygjgpp_di",
"bounds": {
"$type": "dc:Bounds",
"x": 206,
"y": 22,
"width": 608,
"height": 118
}
},
"collapsed": false,
"hidden": false,
"x": 206,
"y": 22,
"isFrame": false
},
{
"labels": [
{
"labels": [],
"children": [],
"type": "label",
"di": {
"$type": "bpmndi:BPMNShape",
"id": "StartEvent_1d82csf_di",
"bounds": {
"$type": "dc:Bounds",
"x": 262,
"y": 63,
"width": 36,
"height": 36
},
"label": {
"$type": "bpmndi:BPMNLabel",
"bounds": {
"$type": "dc:Bounds",
"x": 269,
"y": 103,
"width": 23,
"height": 12
}
}
},
"width": 22,
"height": 14,
"id": "StartEvent_1d82csf_label",
"hidden": false,
"x": 270,
"y": 103
}
],
"children": [],
"id": "StartEvent_1d82csf",
"width": 36,
"height": 36,
"type": "bpmn:StartEvent",
"di": {
"$type": "bpmndi:BPMNShape",
"id": "StartEvent_1d82csf_di",
"bounds": {
"$type": "dc:Bounds",
"x": 262,
"y": 63,
"width": 36,
"height": 36
},
"label": {
"$type": "bpmndi:BPMNLabel",
"bounds": {
"$type": "dc:Bounds",
"x": 269,
"y": 103,
"width": 23,
"height": 12
}
}
},
"collapsed": false,
"hidden": false,
"x": 262,
"y": 63,
"isFrame": false
},
{
"labels": [],
"children": [],
"type": "label",
"di": {
"$type": "bpmndi:BPMNShape",
"id": "StartEvent_1d82csf_di",
"bounds": {
"$type": "dc:Bounds",
"x": 262,
"y": 63,
"width": 36,
"height": 36
},
"label": {
"$type": "bpmndi:BPMNLabel",
"bounds": {
"$type": "dc:Bounds",
"x": 269,
"y": 103,
"width": 23,
"height": 12
}
}
},
"width": 22,
"height": 14,
"id": "StartEvent_1d82csf_label",
"hidden": false,
"x": 270,
"y": 103
},
{
"labels": [
{
"labels": [],
"children": [],
"type": "label",
"di": {
"$type": "bpmndi:BPMNShape",
"id": "EndEvent_0dvi5rk_di",
"bounds": {
"$type": "dc:Bounds",
"x": 730,
"y": 63,
"width": 36,
"height": 36
},
"label": {
"$type": "bpmndi:BPMNLabel",
"bounds": {
"$type": "dc:Bounds",
"x": 739,
"y": 103,
"width": 19,
"height": 12
}
}
},
"width": 19,
"height": 14,
"id": "EndEvent_0dvi5rk_label",
"hidden": false,
"x": 739,
"y": 103
}
],
"children": [],
"id": "EndEvent_0dvi5rk",
"width": 36,
"height": 36,
"type": "bpmn:EndEvent",
"di": {
"$type": "bpmndi:BPMNShape",
"id": "EndEvent_0dvi5rk_di",
"bounds": {
"$type": "dc:Bounds",
"x": 730,
"y": 63,
"width": 36,
"height": 36
},
"label": {
"$type": "bpmndi:BPMNLabel",
"bounds": {
"$type": "dc:Bounds",
"x": 739,
"y": 103,
"width": 19,
"height": 12
}
}
},
"collapsed": false,
"hidden": false,
"x": 730,
"y": 63,
"isFrame": false
},
{
"labels": [],
"children": [],
"type": "label",
"di": {
"$type": "bpmndi:BPMNShape",
"id": "EndEvent_0dvi5rk_di",
"bounds": {
"$type": "dc:Bounds",
"x": 730,
"y": 63,
"width": 36,
"height": 36
},
"label": {
"$type": "bpmndi:BPMNLabel",
"bounds": {
"$type": "dc:Bounds",
"x": 739,
"y": 103,
"width": 19,
"height": 12
}
}
},
"width": 19,
"height": 14,
"id": "EndEvent_0dvi5rk_label",
"hidden": false,
"x": 739,
"y": 103
}
],
"id": "Participant_0q1tuee",
"width": 638,
"height": 118,
"type": "bpmn:Participant",
"di": {
"$type": "bpmndi:BPMNShape",
"id": "Participant_0q1tuee_di",
"bounds": {
"$type": "dc:Bounds",
"x": 176,
"y": 22,
"width": 638,
"height": 118
},
"label": {
"$type": "bpmndi:BPMNLabel"
}
},
"collapsed": false,
"x": 176,
"y": 22,
"isFrame": false
}
Do you want to set the property on the process or on the participant? Note that these are two different things.
BTW from you pasted it appears that the call returns something, so can you confirm that this is not true?
The above data has the participant id which is ‘Participant_0q1tuee’ but when I tried bpmnModeler.get(‘elementRegistry’).get(‘Participant_0q1tuee’) which is the existing code, I am getting undefined.
Hi @barmac , The undefined issue is resolved for Participant_0q1tuee. As I mentioned, I am getting value up to bpmnModeler.get(‘elementRegistry’).get(‘Participant_0q1tuee’).
undefined is getting for
bpmnModeler.get(‘elementRegistry’).get(‘Participant_0q1tuee’).businessObject.set( ‘xmlns:sonet’, ‘http://sonet.com.au/’ );
I assume the above code set property on the participant, which I need to work well even after the upgrade.
I hope after resolving this will fix the error missing namespace information for …
What is the latest version of bpmn-js on which your code works correctly?
Hi @barmac, Tried upgrading from 0 to 6 which was working fine. Since we need to deliver this immediately, trying each version will take time. So could you please help me to resolve the issue. I have already share the code and the error currently we are facing.
Please check the screenshot below
When debugged, getting the error 1. [Exception: Error: Tried to access di from the businessObject. The di is available through the diagram element only.
Why don’t you try to bisect as Nico pointed out? Instead of trying out all 17 major versions, you’d only need to perform 4 checks to find the breaking version.
Hi @barmac , Could you please make this more clear?
Install the version half-way to latest. Check if it’s breaking. If so, install a version half-way from old to the current one. Otherwise, install half-way from current to latest. Rinse and repeat. Please read the link.