Display XML of selected element inside properties panel


#1

Hello,

I’m creating a plugin for camunda modeler (CM) and I followed this article and made it as a plugin for CM.
Everything is working so far.

But I don’t find a solution on how to load XML before assigning new entries for my tab.
Because I would like my tab to be dynamic(probably not possible unless we can define in the JSON descriptor more input that we will display) and with the possibility to fetch data from our ecosystem when analyzing what is inside the XML.

Not sure if that’s the way to do it, though.
I saw there was also maybe another way to do it with this (but this is not really the way I would like to go).

Thanks for any response :slight_smile:


#2

What do you mean by loading the XML beforehand?


#3

Hello,

I went ahead and did this:

I created a new Props (like in the tutorial) and extended EntryFactory to add a new custom field (which is a XML view)

Problem is that it has no input so I can’t use the set() method of the Field.

I found one solution that should be working:

Overriding PropertiesPanel.js:

PropertiesPanel.prototype.updateState = function(entry, entryNode) {
  this.updateShow(entry, entryNode);
  this.updateDisable(entry, entryNode);
};

Into:

PropertiesPanel.prototype.updateState = function(entry, entryNode) {
  this.updateShow(entry, entryNode);
  this.updateDisable(entry, entryNode);
  this.updateXml(entry, entryNode);
};

And in the updateXml method I would use something like domQueryAll([data-xml], node) to set xml of selected task.

Problem is that I have absolutely no idea how I can do that(overriding) with a plugin because I don’t want to code inside dependency for maintainability.

I’ll be really glad if you can help me with this :slight_smile:


#4

I still don’t understand the question. What exactly do you want to do that’s not possible right now? What are you referring to as XML? A string containing the diagram XML?


#5

Hello,

Yes, it is indeed XML as a string, it looks like this:

bpmn-js-panel-xml

But to do this I had to add some code inside PropertiesPanel which is in dependency and I would like to know if there was some way to do it with a plugin.

Thanks :slight_smile:


#6

After reading inherits more carefully I managed to do it.

Thanks for the support! :slight_smile: