bpmn-io / bpmn-js-properties-panel

A properties panel for bpmn-js.
MIT License
293 stars 196 forks source link

Camunda Property Integration #1001

Closed lukagerlach closed 9 months ago

lukagerlach commented 10 months ago

What should we do?

Context

I recently tried integrating the Camunda properties into the modeler/properties panel. I followed the README of this repo, where it says to integrate the CamundaExtensionModule as follows:

// use Camunda BPMN Moddle extension
import CamundaExtensionModule from 'camunda-bpmn-moddle/lib';

However, this does not work as the CamundaExtensionModule seems to be moved to the behaviors repo as this post / the camunda-bpmn-moddle changelog suggests.

I am now integrating Camunda properties like this:

import { BpmnPropertiesPanelModule, BpmnPropertiesProviderModule, CamundaPlatformPropertiesProviderModule } from "bpmn-js-properties-panel";
import camundaPlatformBehaviors from "camunda-bpmn-js-behaviors/lib/camunda-platform";
const camundaModdleDescriptor = require("camunda-bpmn-moddle/resources/camunda.json");

return new BpmnModeler({
            additionalModules: [
                BpmnPropertiesPanelModule,
                BpmnPropertiesProviderModule,
                CamundaPlatformPropertiesProviderModule,
                camundaPlatformBehaviors
            ],
            moddleExtensions: {
                camunda: camundaModdleDescriptor
            }
        });

This seems to work fine so i think it is the latest and actual way to integrate Camunda properties into the properties panel? It would be nice if you could update the readme if that is the case.

Why should we do it?

To keep the documentation in line with the updates and help users to get the modeler running.

General questions

I was a little unsure what the CamundaPlatformPropertiesProviderModule, camundaPlatformBehaviors and camundaModdleDescriptor are really doing. As far as i understand, the ModdleDescriptor is just a list of all possible extensions and the PropertiesProviderModule depends on the corresponding moddleDescriptor to provide all the right extensions for the properties panel as the behaviors ensure the right extensions on the right modeling elements and adds this kind of "business logic" to the properties. I know, as a user i do not really have to know about the internals and how these things are connected, but i am still curios to get a little clarification on this. 🙂

Also, from a user point of view, i think it would be cool to have this functionality wrapped in only one lib. This way it would be a lot easier to get things running and updating dependencies, as the user only has to care about one lib and not about between-lib entanglements and compatibilities, especially when they provide only one feature in total like the Camunda property integration. E.g., provide one lib that includes all stuff for camunda 7 and can be integrated as an additionalModule into the modeler.

Thank You!

philippfromme commented 10 months ago

Good catch. Indeed, the behaviors have been removed from camunda-bpmn-moddle (cf. https://github.com/camunda/camunda-bpmn-moddle/commit/c99c1aa46d17f7d5f73bd933730a34171dfec6a6) and are now part of camunda-bpmn-js-behaviors. We will update the README.

As for your questions, the separation of those libraries is on purpose to ensure things are composable. To get the Camunda properties panel out of the box you can use https://github.com/camunda/camunda-bpmn-js.

nikku commented 10 months ago

@philippfromme What about if we add that hint to the documentation? Could be part of some example, I think.