Do Camunda extensions only work for bpmn-js modeler and not viewer?

Hi,

I am using the following code to allow editing Camunda-base workflows. It works fine with a modeler, but NOT with a viewer:

import * as BpmnJS from 'bpmn-js/dist/bpmn-modeler.production.min.js';
import camundaExtensionModule from 'camunda-bpmn-moddle/lib'
import camundaModdle from 'camunda-bpmn-moddle/resources/camunda.json'

[...]

bpmnJS = new BpmnJS({
  additionalModules: [
    customRenderer,
    camundaExtensionModule,
  ],
  moddleExtensions: {
    camunda: camundaModdle
  }
});

When I replace ‘modeler’ with ‘viewer’ in the 1st import, I get the following 2 errors:

Error: No provider for "moddleCopy"! (Resolving: camundaCopyPasteRootElementBehavior -> moddleCopy)

ERROR Error: Uncaught (in promise): Error: No provider for "moddleCopy"! (Resolving: camundaCopyPasteRootElementBehavior -> moddleCopy)
Error: No provider for "moddleCopy"! (Resolving: camundaCopyPasteRootElementBehavior -> moddleCopy)

Is there anything I can do to make Camunda extensions work with the viewer and not the modeler?

My goal is to have a web page of my application where a workflow can only be viewed. It should not be editable, and there should be no palette, among other restrictions.

Any suggestion will be welcome! Thank you!

Hi @bfredo123

For questions like these i would tend to point you in the direction of the modeler/bpmn.io forum : https://forum.bpmn.io/

But maybe @philippfromme or @nikku are around here to help you out :slight_smile:

@bfredo123 Please post this one in the bpmn.io community forum. Happy to share the resolution here.

1 Like

Thank you so much Niall & nikku, just did it: Do Camunda extensions only work for bpmn-js modeler and not viewer? - Developers - Forum - bpmn.io

Best regards

Resolution and more details can be found here:

1 Like