A briefly explanation on how extends and superClass works on custom meta models

i’ve been reading the examples that you kindly provide, but i would like to get a deeply understanding on how the extends and superClass works when creating a json meta model, what it makes on the generated XML and what i can expect working with the modeler API.

{
  "name": "QualityAssurance",
  "uri": "http://some-company/schema/bpmn/qa",
  "prefix": "qa",
  "xml": {
    "tagAlias": "lowerCase"
  },
  "types": [
    {
      "name": "AnalyzedNode",
      "extends": [
        "bpmn:FlowNode"
      ],
      "properties": [
        {
          "name": "suitable",
          "isAttr": true,
          "type": "Float"
        }
      ]
    },
    {
      "name": "AnalysisDetails",
      "superClass": [ "Element" ],
      "properties": [
        {
          "name": "lastChecked",
          "isAttr": true,
          "type": "String"
        },
        {
          "name": "nextCheck",
          "isAttr": true,
          "type": "String"
        },
        {
          "name": "comments",
          "isMany": true,
          "type": "Comment"
        }
      ]
    },
    ...
  ],
  ...
}

Thanks for your hard work.

I am no expert in this, but I can provide you an example of how I use them. I don’t know if this is “the correct way” of doing things, but it is working for me.

{
            "name": "AttachedCondition",
            "superClass": [
                "Element"
            ],
            "properties": [
                {
                    "name": "name",
                    "type": "String",
                    "isAttr": true
                },
                {
                    "name": "description",
                    "type": "String",
                    "isAttr": true
                }
            ]
        },
        {
            "name": "AttachedConditions",
            "superClass": [
                "Element"
            ],
            "properties": [
                {
                    "name": "values",
                    "type": "AttachedCondition",
                    "isMany": true
                }
            ]
        }

With this, I can include a list of predefined conditions as an extension element (I use it to create gateways that call a webservice to evaluate a condition and then, I only allow to use the AttachedConditions of the gateway in the flowSequences that come from the gateway).

{
            "name": "onCustomerBusinessRuleTask",
            "extends": [
                "bpmn:BusinessRuleTask"
            ],
            "properties": [
                {
                    "name": "ruleId",
                    "type": "Integer",
                    "isAttr": true
                }
            ]
        }

This property allows me to include a new field on BusinessRuleTask (inside the business object) that indicates which rule should be evaluated (it also uses a webservice from an external application).