I would like to adapt the Camunda Modeler Tooltip plugin for open in a new tab the BPMN Diagram of a given CallActivit by doing Double Click on it.
By exemple, doing double click on the "My Process" CallActivity, I would like to open the associated BPMN Diagram in a new tab, whose the xml file name is the value of the Called Element attribute of the BPMN element.
In my case, all the diagrams xml files are in the same directory.
I use the Camunda Modeler Platform.
Thank you for your help !
I'have tried with the bpmn-io library (importXML method) but the documentation doesn't explain my use case and I haven't found the methods for add a new tab in the modeler.
Below the code I'have imagined to built.
Thank you for your help !
'use strict';
var $ = require('jquery');
var _ = require('lodash');
function TooltipInfoService(eventBus, overlays, elementRegistry, editorActions) {
// register 'toggleTooltipInfos'-event
editorActions.register({
toggleTooltipInfos: function () {
toggleTooltipInfos();
}
});
// tooltip event for dblclick
eventBus.on('element.dblclick', function (e) { _.defer(function () { dblclick(e); }); });
}
/**
* Double Click Function
*/
function dblclick(e) {
var type = e.element.businessObject.$type;
if (type == 'bpmn:CallActivity')
{
// HERE THE CODE FOR OPEN THE BPMN DIAGRAM OF THE ELEMENT
}
}