Custom renderer does not take an effect after update


#1

I have updated from 0.18.4 to 0.19.0 and the custom renderer from your colors example stopped working… Is there any other way how to influence the appearance of the tasks? Thanks in advance!


#2

We’ll look into this. I guess you refer to our color example?


#3

Yes, the custom renderer like in this example: https://github.com/bpmn-io/bpmn-js-task-priorities/blob/master/lib/priorities/ColorRenderer.js

Thank you for any advice.


#4

Please, we still did not updated bpmn-js (and thus bpmn-js-properties-panel, bpmn-moddle and diagram-js also) in our project because of the impossibility of using the custom renderer. Is it still functional in the way you present at https://github.com/bpmn-io/bpmn-js-task-priorities/blob/master/lib/priorities/ColorRenderer.js ? The method this.drawShape is not being fired anymore. Thank you in advance for any advice.


#5

Not really sure what you’re doing. I’ve just updated the task priorities example and it still works works like a charm with the latest version of bpmn-js.

Update: I can reproduce it now. Investigating…


#6

So after a little bit of investigation I’ve upgraded the example to the latest version of bpmn-js.

The change impacting it’s functionality is the switch away from the underlying SVG rendering layer we performed with bpmn-js v0.18.0. Please read about the change, as it may impact you if you plan to upgrade the library.

Best,

Nico


#7

Thank you very much for the tip and the upgrade, I’ll look at it a little bit deeper.

Best


#8

Ok, for the case somebody will have the same problem, my problem was that I did not notice the order of arguments changed from

function CustomRenderer(eventBus, styles, pathMap) {

    BpmnRenderer.call(this, eventBus, styles, pathMap, 1200);
...

to

function CustomRenderer(eventBus, styles, pathMap, canvas, priority) {

    BpmnRenderer.call(this, eventBus, styles, pathMap, canvas, priority || 1200);
...

and as a result required canvas injecting:

CustomRenderer.$inject = [ 'eventBus', 'styles', 'pathMap', 'canvas' ];

Thank you for the assistance, the example upgrade really helped!