DMN editor - disable id and name edit

Hi,

we are trying to use DMN modeller in our web application, to allow user to change and deploy decision table to camunda instance.
The problem I see now is that user is able to change table Id and table name, which would then during deploy over the REST to camunda create a new table, because id is changed. We would like to forbid that, so that always the same (selected by us) table is edited and end users are not able to create new tables.

As I see there are two options here:

  1. Disable possibiliy to edit id and name fields - can you describe in detail how to do that. Documentation about extending modeller is quite limited and I am not able to find some examples, except the one in the code. But, after looking at it, there is too much unknown for me how to do it, I mean:
  • whether it is possible to disallow edits
  • what kind of extension module should I implement
  • how should I pass it to the config in additionalModules property and so on.
  1. Somehow disable new table creation on Camunda side. We can imagine, that even if id and name edition is blocked, someone can change it in the request being send. But I believe there is no way of foridding that. Unless there is?

Regards,
Przemek

To (1): So what you basically want to achieve is to remove the editing capabilities of the decision table properties, right? You may have a look inside the decision-table-properties component where you find components for the editor and the normal viewer (no editing capabilities).

Depending on which type (Editor OR Viewer) you’re using, the correct component is included. What you need, if I understand you right, is the Editor with only the properties component having not the editor version.

It’s currently not possible to switch off editing capabilities for single components via config or something else, you would have to build it yourself. Or simply create your own Editor which the correct components including, so what I tried to describe above.

Does this answer your question?

To (2): This is not related to this project, but the Camunda forum might be helpful.

So what you’re saying is that I should create a new class, that will include the same list of modules, which Editor has, but without tablePropertiesEditorModule?

  1. How can I then use this my new class in DmnJS object?
  2. Isn’t it possible to provide a different implementation of tablePropertiesEditorModule, that would not allow for editing?

How can I then use this my new class in DmnJS object?

When creating your own decision table editor, you would have to override the existing one

Isn’t it possible to provide a different implementation of tablePropertiesEditorModule, that would not allow for editing?

Of course, having this would be the easiest option.

Can you please provide an example of providing such a module?
Maybe my JavaScript knowledge is not enough, but I find it hard to figure out how to do it.

Oh, am I right that this is an inferno.js module?
If yes, I will look it up in the inferno documentation.