How to add custom elements to the control panel in camunda, the newly added controls and generate xml code, is it through plugin way or?

截取图片_20220209163419
How to add custom elements to the control panel in camunda, the newly added controls and generate xml code, is it through plugin way or?

Since you’ve already found the example have a look at https://github.com/bpmn-io/bpmn-js-example-custom-elements/blob/master/app/custom/CustomPalette.js. This is where the palette is extended through palette.registerProvider(this);.

Hi, philippfromme
Thank you for your reply, I successfully added a new graph node on the palette according to the example, but the xml generated by dragging it in is <bpmn:task>, the result I want is <bpmn:CustomTask />, what should I do? ?

<bpmn:CustomTask /> is not a valid use case for an extension. You cannot add new elements to the BPMN namespace. The resulting XML wouldn’t be considered valid. You can, however, use the extension mechanisms that the BPMN spec offers:

Custom Attributes

<bpmn:task custom:foo="bar" />

Extension Elements

<bpmn:task>
  <bpmn:extensionElements>
    <custom:Foo />
  </bpmn:extensionElements>
</bpmn:Task>

The example built using these extension mechanisms: https://github.com/bpmn-io/bpmn-js-examples/tree/master/custom-elements