@pbinitiative/zenbpm-bpmn-moddle 0.1.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/LICENSE ADDED
@@ -0,0 +1,21 @@
1
+ The MIT License (MIT)
2
+
3
+ Copyright (c) 2026-present Process Builders Initiative, z.s.
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in
13
+ all copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
21
+ THE SOFTWARE.
package/README.md ADDED
@@ -0,0 +1,151 @@
1
+ # zenbpm-bpmn-moddle
2
+
3
+ Custom BPMN 2.0 extension namespace — **`zenbpm`** — derived from the
4
+ [Zeebe](https://github.com/camunda/zeebe-bpmn-moddle) extension schema and fully
5
+ re-namespaced as a standalone public specification.
6
+
7
+ [![License: MIT](https://img.shields.io/badge/License-MIT-green.svg)](LICENSE)
8
+
9
+ ---
10
+
11
+ ## Namespace
12
+
13
+ | Property | Value |
14
+ |---|---|
15
+ | **Prefix** | `zenbpm` |
16
+ | **URI** | `http://zenbpm.pbinitiative.org/1.0` |
17
+ | **XSD** | `xsd/zenbpm.xsd` |
18
+ | **Moddle descriptor** | `resources/zenbpm.json` |
19
+
20
+ ---
21
+
22
+ ## Quick Start
23
+
24
+ ### 1. Declare the namespace in your BPMN file
25
+
26
+ ```xml
27
+ <bpmn:definitions
28
+ xmlns:bpmn="http://www.omg.org/spec/BPMN/20100524/MODEL"
29
+ xmlns:zenbpm="http://zenbpm.pbinitiative.org/1.0"
30
+ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
31
+ xsi:schemaLocation="http://zenbpm.pbinitiative.org/1.0
32
+ https://zenbpm.pbinitiative.org/1.0/zenbpm.xsd"
33
+ targetNamespace="http://zenbpm.pbinitiative.org"
34
+ id="Definitions_1">
35
+ ...
36
+ </bpmn:definitions>
37
+ ```
38
+
39
+ ### 2. Use extension elements inside BPMN tasks
40
+
41
+ ```xml
42
+ <bpmn:serviceTask id="Task_pay" name="Process Payment">
43
+ <bpmn:extensionElements>
44
+ <zenbpm:taskDefinition type="payment-worker" retries="3"/>
45
+ <zenbpm:ioMapping>
46
+ <zenbpm:input source="=orderId" target="id"/>
47
+ <zenbpm:output source="=result" target="paymentResult"/>
48
+ </zenbpm:ioMapping>
49
+ </bpmn:extensionElements>
50
+ </bpmn:serviceTask>
51
+ ```
52
+
53
+ ---
54
+
55
+ ## Extension Elements Reference
56
+
57
+ | Element | Allowed in | Purpose |
58
+ |---|---|---|
59
+ | `zenbpm:taskDefinition` | Service/Script/Business-rule/Send tasks, End/Intermediate events, AdHocSubProcess | Job type + retry count |
60
+ | `zenbpm:ioMapping` | Service tasks, Call activities, Receive tasks, SubProcesses, UserTasks, Events | Input/output variable mapping |
61
+ | `zenbpm:taskHeaders` | Service tasks, UserTask, Execution listeners | Static key/value headers for the job worker |
62
+ | `zenbpm:subscription` | Receive tasks, Message events | Correlation key for message subscriptions |
63
+ | `zenbpm:loopCharacteristics` | `bpmn:MultiInstanceLoopCharacteristics` | Collection expressions for multi-instance loops |
64
+ | `zenbpm:calledElement` | `bpmn:CallActivity` | Target process ID, propagation flags, binding type |
65
+ | `zenbpm:calledDecision` | `bpmn:BusinessRuleTask` | DMN decision ID, result variable, binding type |
66
+ | `zenbpm:script` | `bpmn:ScriptTask` | Inline FEEL expression + result variable |
67
+ | `zenbpm:userTask` | `bpmn:UserTask` | Marker for engine-managed user-task lifecycle |
68
+ | `zenbpm:formDefinition` | `bpmn:UserTask` | Form key / form ID / external form reference |
69
+ | `zenbpm:userTaskForm` | `bpmn:Process` | Embedded form JSON body |
70
+ | `zenbpm:assignmentDefinition` | `bpmn:UserTask` | Assignee, candidate groups/users |
71
+ | `zenbpm:priorityDefinition` | `bpmn:UserTask` | Task priority (0–100) |
72
+ | `zenbpm:taskSchedule` | `bpmn:UserTask` | Due date + follow-up date |
73
+ | `zenbpm:taskListeners` | `bpmn:UserTask` | Task-lifecycle listener declarations |
74
+ | `zenbpm:executionListeners` | Events, Activities, Process, Gateways | Flow-execution listener declarations |
75
+ | `zenbpm:properties` | Any element | Arbitrary key/value metadata |
76
+ | `zenbpm:versionTag` | `bpmn:Process` | Human-readable process version tag |
77
+ | `zenbpm:linkedResources` | `bpmn:ServiceTask` | External resource references (OpenAPI, etc.) |
78
+ | `zenbpm:adHoc` | `bpmn:AdHocSubProcess` | Active-elements collection + output collection |
79
+ | `zenbpm:conditionalFilter` | `bpmn:ConditionalEventDefinition` | Variable-name / event-type filter |
80
+ | `zenbpm:zenForm` | `bpmn:UserTask` | ZenBPM-native form reference by `formId` |
81
+
82
+ ---
83
+
84
+ ## Modeler Attribute Injectors
85
+
86
+ These are **abstract types** — they do not appear as child elements inside `<bpmn:extensionElements>` but instead inject XML attributes directly onto standard BPMN elements. They are primarily used by BPMN modelers to track element templates.
87
+
88
+ ### `TemplateSupported`
89
+
90
+ Injects modeler-template tracking attributes onto:
91
+ `bpmn:Collaboration`, `bpmn:Process`, `bpmn:FlowElement` (and all its subtypes — tasks, events, gateways, etc.)
92
+
93
+ | Attribute | Type | Purpose |
94
+ |---|---|---|
95
+ | `zenbpm:modelerTemplate` | `String` | ID of the element template applied by the modeler |
96
+ | `zenbpm:modelerTemplateVersion` | `Integer` | Version of the applied template |
97
+ | `zenbpm:modelerTemplateIcon` | `String` | Icon override for the element in the modeler |
98
+
99
+ **Example:**
100
+ ```xml
101
+ <bpmn:serviceTask id="Task_1" zenbpm:modelerTemplate="my-template" zenbpm:modelerTemplateVersion="3" />
102
+ ```
103
+
104
+ ### `TemplatedRootElement`
105
+
106
+ Injects a modeler-template reference onto root-level BPMN elements:
107
+ `bpmn:Error`, `bpmn:Escalation`, `bpmn:Message`, `bpmn:Signal`
108
+
109
+ | Attribute | Type | Purpose |
110
+ |---|---|---|
111
+ | `zenbpm:modelerTemplate` | `String` | ID of the element template that created this root element |
112
+
113
+ **Example:**
114
+ ```xml
115
+ <bpmn:message id="Msg_1" name="OrderReceived" zenbpm:modelerTemplate="order-template" />
116
+ ```
117
+
118
+ ---
119
+
120
+ ## File Layout
121
+
122
+ ```
123
+ zenbpm-bpmn-moddle/
124
+ ├── resources/
125
+ │ └── zenbpm.json ← moddle descriptor (register with bpmn-moddle)
126
+ ├── xsd/
127
+ │ └── zenbpm.xsd ← XSD — authoritative XML schema for validators/IDEs
128
+ ├── test/
129
+ │ ├── example.bpmn ← example BPMN using every extension element
130
+ │ ├── validate-xsd.js ← XSD validation test runner
131
+ │ └── spec/
132
+ │ └── moddle.spec.js ← Mocha unit tests for the moddle descriptor
133
+ ├── package.json
134
+ └── README.md
135
+ ```
136
+ ---
137
+
138
+ ## Building & Testing
139
+
140
+ ```bash
141
+ npm install
142
+ npm test # mocha unit tests
143
+ npm run validate-xsd # XSD validation of example.bpmn
144
+ npm run all # lint + test
145
+ ```
146
+
147
+ ---
148
+
149
+ ## License
150
+
151
+ [MIT](LICENSE)
package/package.json ADDED
@@ -0,0 +1,48 @@
1
+ {
2
+ "name": "@pbinitiative/zenbpm-bpmn-moddle",
3
+ "version": "0.1.0",
4
+ "description": "Custom BPMN 2.0 extension namespace — zenbpm (derived from Zeebe/Camunda",
5
+ "main": "resources/zenbpm.json",
6
+ "scripts": {
7
+ "all": "run-s lint test",
8
+ "lint": "eslint .",
9
+ "test": "mocha --reporter=spec --recursive test",
10
+ "validate-xsd": "node test/validate-xsd.js"
11
+ },
12
+ "repository": {
13
+ "type": "git",
14
+ "url": "https://github.com/pbinitiative/zenbpm-bpmn-moddle"
15
+ },
16
+ "keywords": [
17
+ "bpmn",
18
+ "moddle",
19
+ "bpmn20",
20
+ "zenbpm",
21
+ "meta-model",
22
+ "extension"
23
+ ],
24
+ "license": "MIT",
25
+ "engines": {
26
+ "node": ">=14"
27
+ },
28
+ "exports": {
29
+ ".": "./resources/zenbpm.json"
30
+ },
31
+ "peerDependencies": {
32
+ "bpmn-moddle": ">=7"
33
+ },
34
+ "devDependencies": {
35
+ "@eslint/js": "^9.39.4",
36
+ "bpmn-moddle": "^10.0.0",
37
+ "chai": "^5.0.0",
38
+ "eslint": "^9.0.0",
39
+ "globals": "^17.6.0",
40
+ "mocha": "^11.0.0",
41
+ "npm-run-all": "^4.1.5",
42
+ "xsd-schema-validator": "^0.11.0"
43
+ },
44
+ "files": [
45
+ "resources",
46
+ "xsd"
47
+ ]
48
+ }