Hello everybody !
I would like to change rendering and add some properties to a serviceTask.
And i just don’t know how to do it correctly.
Case next:
- user adds some custom task from palette
- this task adds as a serviceTask with custom extension to the diagram
- the item should render differently depending on the extension inside it
I’ve already done the rendering. But I think my decision is very naive and simply bad
I have extended from the BaseRenderer
and made my custom logic there.
EtaRenderer.prototype.drawShape = function(parentGfx, element) {
var type = element.type;
let label = '';
if (isCreateTaksExtension(element)) {
return drawEtaProcess(parentGfx, element.width, element.height, '[Cоздать задачу]')
}
isCreateTaksExtension
- looking for expected extension inside. And if found, return true.
drawEtaProcess
- just creates the gfx rect with all needed params.
Rendering works when loading an existing schema …
But i dont know how to add extensions to added from palette task.
I’d like to know. Am I even going the right way ?
And if so, how do I add an extension to an item from the palette ?