1

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 !

Exemple

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
    }

}
Andres
  • 11
  • 2
  • A challenge I see is how you are going to determine the file name and path you need to open. The model only references by process definition id. The Camunda 8 web modeler solves this by maintaining additional reference info, which doers not exists in the desktop modeler scenario. – rob2universe Nov 02 '22 at 00:58
  • Hi rob2universe, thank you for your comment. The file name is given by the value of the attribute CalledElement of the BPMN element, and all the BPMN files are in the same director path. – Andres Nov 02 '22 at 13:41
  • Sorry, but the called element attribute would contain the process id, not the file url. (https://docs.camunda.io/docs/components/modeler/bpmn/call-activities/) – rob2universe Nov 02 '22 at 15:16
  • Yes, I know, but by convetion of my project the file name have de ID of the called element with the XML extension and all the BPMN files are in the same repertory, so I can build the full path from the id of the called element. It isn't the case of all the projects, but it might work for mine – Andres Nov 02 '22 at 17:29

0 Answers0