Add in the BPMN XML a custom attribut in the bpmn:task attribut

Hello Team,

I need to customize the BPMN Xml in order to add a custom attribut called RankOrder = “1” in the bpmn:task attributes which will be set programmatically,
Would you please help me?

Thanks in advance.

<?xml version="1.0" encoding="UTF-8"?>
<bpmn:definitions xmlns:bpmn="" xmlns:bpmndi="" xmlns:di="" xmlns:dc="" xmlns:xsi="" id="Definitions_1" targetNamespace="">
  <bpmn:process id="Process_1" isExecutable="false">
    <bpmn:startEvent id="StartEvent_1" name="Open">
    <bpmn:task id="Task_0ne4plj" name="In Progress"   RankOrder = "1">
      </bpmn:task>  <bpmn:task id="Task_17yscmr" name="Approved" RankOrder = "2">

Hi Dhaker,

You have to use a custom descriptor, e.g.


  "name": "customDescriptor",
  "uri": "http://customDescriptor",
  "prefix": "custdesc",
  "xml": {
    "tagAlias": "lowerCase"
  "associations": [],
  "types": [
      "name": "RankOrder",
      "extends": [ "bpmn:Task" ],
      "properties": [
          "name": "rankorder",
          "isAttr": true,
          "type": "String"

this will recognize the attribute

<bpmn:task id="Task_0ne4plj" name="In Progress" custdesc:rankorder="1">

you have to include the moddle descriptor as


 var customDescriptor = require('./descriptor/customDescriptor');
 var viewer = new Viewer({
    container: '#divcontainer',
    moddleExtensions: {
      customDescriptor: customDescriptor

Hello David,

Thank you so much you save my day.
Q1: does the ./lib/descriptor/customDescriptor.json file will override the actual one in .//bpmn-moddle/blob/master/resources/bpmn/json/bpmn.json?

other request please, which i dropped in the [Camunda Forum] (

Is there a way to connect task via javascript code without using the arrow connection shapes:
In my case i have a generic task that will be dropped in the diagram then all other tasks will connect to it implictly without using the sequence/Message fow action,

Any clues :wink:

Thank you again.