@bpmn-ld/bpmn-ld 0.0.0-stage → 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.
Files changed (319) hide show
  1. package/LICENSE +201 -0
  2. package/README.md +125 -2
  3. package/contexts/combined.jsonld +3 -0
  4. package/contexts/core.jsonld +170 -0
  5. package/contexts/di.jsonld +37 -0
  6. package/dist/analyze/analyze.d.ts +3 -0
  7. package/dist/analyze/analyze.js +11 -0
  8. package/dist/analyze/findings.d.ts +8 -0
  9. package/dist/analyze/findings.js +1 -0
  10. package/dist/analyze/report.d.ts +3 -0
  11. package/dist/analyze/report.js +9 -0
  12. package/dist/analyze/rules/ad-hoc-completion-condition.d.ts +2 -0
  13. package/dist/analyze/rules/ad-hoc-completion-condition.js +7 -0
  14. package/dist/analyze/rules/cannot-reach-end.d.ts +2 -0
  15. package/dist/analyze/rules/cannot-reach-end.js +28 -0
  16. package/dist/analyze/rules/compensation-association.d.ts +2 -0
  17. package/dist/analyze/rules/compensation-association.js +13 -0
  18. package/dist/analyze/rules/dead-end.d.ts +2 -0
  19. package/dist/analyze/rules/dead-end.js +13 -0
  20. package/dist/analyze/rules/end-event.d.ts +2 -0
  21. package/dist/analyze/rules/end-event.js +8 -0
  22. package/dist/analyze/rules/error-catch.d.ts +2 -0
  23. package/dist/analyze/rules/error-catch.js +14 -0
  24. package/dist/analyze/rules/escalation-catch.d.ts +2 -0
  25. package/dist/analyze/rules/escalation-catch.js +14 -0
  26. package/dist/analyze/rules/gateway-cardinality.d.ts +3 -0
  27. package/dist/analyze/rules/gateway-cardinality.js +17 -0
  28. package/dist/analyze/rules/index.d.ts +4 -0
  29. package/dist/analyze/rules/index.js +21 -0
  30. package/dist/analyze/rules/instantiating-gateway.d.ts +2 -0
  31. package/dist/analyze/rules/instantiating-gateway.js +14 -0
  32. package/dist/analyze/rules/non-interrupting-start.d.ts +2 -0
  33. package/dist/analyze/rules/non-interrupting-start.js +14 -0
  34. package/dist/analyze/rules/reachability.d.ts +2 -0
  35. package/dist/analyze/rules/reachability.js +25 -0
  36. package/dist/analyze/rules/rule.d.ts +7 -0
  37. package/dist/analyze/rules/rule.js +1 -0
  38. package/dist/analyze/rules/signal-catch.d.ts +2 -0
  39. package/dist/analyze/rules/signal-catch.js +12 -0
  40. package/dist/analyze/rules/split-join-pairing.d.ts +3 -0
  41. package/dist/analyze/rules/split-join-pairing.js +50 -0
  42. package/dist/analyze/rules/start-event.d.ts +2 -0
  43. package/dist/analyze/rules/start-event.js +8 -0
  44. package/dist/analyze/rules/task-message-flow.d.ts +2 -0
  45. package/dist/analyze/rules/task-message-flow.js +19 -0
  46. package/dist/analyze/scope-graph.d.ts +56 -0
  47. package/dist/analyze/scope-graph.js +89 -0
  48. package/dist/analyze-cli.d.ts +1 -0
  49. package/dist/analyze-cli.js +5 -0
  50. package/dist/analyze-run.d.ts +12 -0
  51. package/dist/analyze-run.js +85 -0
  52. package/dist/bpmn-ld-cli.d.ts +1 -0
  53. package/dist/bpmn-ld-cli.js +90 -0
  54. package/dist/build-cli.d.ts +1 -0
  55. package/dist/build-cli.js +2 -0
  56. package/dist/build.d.ts +3 -0
  57. package/dist/build.js +38 -0
  58. package/dist/check-xml/check.d.ts +3 -0
  59. package/dist/check-xml/check.js +11 -0
  60. package/dist/check-xml/lint.d.ts +2 -0
  61. package/dist/check-xml/lint.js +47 -0
  62. package/dist/check-xml/moddle.d.ts +6 -0
  63. package/dist/check-xml/moddle.js +23 -0
  64. package/dist/check-xml/types.d.ts +20 -0
  65. package/dist/check-xml/types.js +1 -0
  66. package/dist/check-xml/xsd.d.ts +2 -0
  67. package/dist/check-xml/xsd.js +25 -0
  68. package/dist/check-xml-cli.d.ts +1 -0
  69. package/dist/check-xml-cli.js +5 -0
  70. package/dist/check-xml-run.d.ts +10 -0
  71. package/dist/check-xml-run.js +77 -0
  72. package/dist/convert/analyze-output.d.ts +3 -0
  73. package/dist/convert/analyze-output.js +8 -0
  74. package/dist/convert/convert.d.ts +19 -0
  75. package/dist/convert/convert.js +96 -0
  76. package/dist/convert/errors.d.ts +5 -0
  77. package/dist/convert/errors.js +8 -0
  78. package/dist/convert/extensions.d.ts +23 -0
  79. package/dist/convert/extensions.js +103 -0
  80. package/dist/convert/mapping-check.d.ts +15 -0
  81. package/dist/convert/mapping-check.js +66 -0
  82. package/dist/convert/mapping.d.ts +52 -0
  83. package/dist/convert/mapping.js +273 -0
  84. package/dist/convert/namespaces.d.ts +2 -0
  85. package/dist/convert/namespaces.js +19 -0
  86. package/dist/convert/validate-output.d.ts +2 -0
  87. package/dist/convert/validate-output.js +28 -0
  88. package/dist/convert/warnings.d.ts +9 -0
  89. package/dist/convert/warnings.js +67 -0
  90. package/dist/convert/xml-reader.d.ts +11 -0
  91. package/dist/convert/xml-reader.js +84 -0
  92. package/dist/convert-cli.d.ts +1 -0
  93. package/dist/convert-cli.js +5 -0
  94. package/dist/convert-run.d.ts +10 -0
  95. package/dist/convert-run.js +125 -0
  96. package/dist/coverage-cli.d.ts +1 -0
  97. package/dist/coverage-cli.js +8 -0
  98. package/dist/coverage-mappings.d.ts +3 -0
  99. package/dist/coverage-mappings.js +34 -0
  100. package/dist/coverage-scope.d.ts +11 -0
  101. package/dist/coverage-scope.js +187 -0
  102. package/dist/coverage-xsd.d.ts +15 -0
  103. package/dist/coverage-xsd.js +55 -0
  104. package/dist/coverage.d.ts +35 -0
  105. package/dist/coverage.js +152 -0
  106. package/dist/docs-cli.d.ts +1 -0
  107. package/dist/docs-cli.js +18 -0
  108. package/dist/docs.d.ts +8 -0
  109. package/dist/docs.js +136 -0
  110. package/dist/eval/checks.d.ts +19 -0
  111. package/dist/eval/checks.js +252 -0
  112. package/dist/eval/regenerate.d.ts +10 -0
  113. package/dist/eval/regenerate.js +48 -0
  114. package/dist/eval-regenerate-cli.d.ts +1 -0
  115. package/dist/eval-regenerate-cli.js +16 -0
  116. package/dist/export/data.d.ts +10 -0
  117. package/dist/export/data.js +127 -0
  118. package/dist/export/diagram.d.ts +8 -0
  119. package/dist/export/diagram.js +112 -0
  120. package/dist/export/element.d.ts +27 -0
  121. package/dist/export/element.js +175 -0
  122. package/dist/export/export.d.ts +22 -0
  123. package/dist/export/export.js +124 -0
  124. package/dist/export/extensions.d.ts +18 -0
  125. package/dist/export/extensions.js +122 -0
  126. package/dist/export/layout-export.d.ts +4 -0
  127. package/dist/export/layout-export.js +25 -0
  128. package/dist/export/mapping-check.d.ts +39 -0
  129. package/dist/export/mapping-check.js +175 -0
  130. package/dist/export/normalize.d.ts +3 -0
  131. package/dist/export/normalize.js +67 -0
  132. package/dist/export-cli.d.ts +1 -0
  133. package/dist/export-cli.js +5 -0
  134. package/dist/export-run.d.ts +10 -0
  135. package/dist/export-run.js +157 -0
  136. package/dist/index.d.ts +10 -0
  137. package/dist/index.js +10 -0
  138. package/dist/install-skill-run.d.ts +8 -0
  139. package/dist/install-skill-run.js +30 -0
  140. package/dist/install-skill.d.ts +23 -0
  141. package/dist/install-skill.js +76 -0
  142. package/dist/layout/collaboration.d.ts +36 -0
  143. package/dist/layout/collaboration.js +152 -0
  144. package/dist/layout/di.d.ts +15 -0
  145. package/dist/layout/di.js +52 -0
  146. package/dist/layout/extract.d.ts +2 -0
  147. package/dist/layout/extract.js +99 -0
  148. package/dist/layout/lanes.d.ts +30 -0
  149. package/dist/layout/lanes.js +112 -0
  150. package/dist/layout/layering.d.ts +7 -0
  151. package/dist/layout/layering.js +53 -0
  152. package/dist/layout/layout.d.ts +12 -0
  153. package/dist/layout/layout.js +299 -0
  154. package/dist/layout/model.d.ts +52 -0
  155. package/dist/layout/model.js +10 -0
  156. package/dist/layout/placement.d.ts +25 -0
  157. package/dist/layout/placement.js +256 -0
  158. package/dist/layout/standalone.d.ts +8 -0
  159. package/dist/layout/standalone.js +50 -0
  160. package/dist/layout-cli.d.ts +1 -0
  161. package/dist/layout-cli.js +5 -0
  162. package/dist/layout-run.d.ts +9 -0
  163. package/dist/layout-run.js +105 -0
  164. package/dist/loader.d.ts +5 -0
  165. package/dist/loader.js +7 -0
  166. package/dist/namespace.d.ts +5 -0
  167. package/dist/namespace.js +5 -0
  168. package/dist/ontology.d.ts +19 -0
  169. package/dist/ontology.js +94 -0
  170. package/dist/paths.d.ts +1 -0
  171. package/dist/paths.js +2 -0
  172. package/dist/render/geometry.d.ts +40 -0
  173. package/dist/render/geometry.js +81 -0
  174. package/dist/render/renderer.d.ts +31 -0
  175. package/dist/render/renderer.js +369 -0
  176. package/dist/render/symbols.d.ts +10 -0
  177. package/dist/render/symbols.js +26 -0
  178. package/dist/render/text.d.ts +20 -0
  179. package/dist/render/text.js +28 -0
  180. package/dist/render-cli.d.ts +1 -0
  181. package/dist/render-cli.js +7 -0
  182. package/dist/render-run.d.ts +9 -0
  183. package/dist/render-run.js +161 -0
  184. package/dist/render.d.ts +4 -0
  185. package/dist/render.js +4 -0
  186. package/dist/schema-overrides.d.ts +14 -0
  187. package/dist/schema-overrides.js +36 -0
  188. package/dist/schema-validate.d.ts +5 -0
  189. package/dist/schema-validate.js +8 -0
  190. package/dist/schema.d.ts +6 -0
  191. package/dist/schema.js +114 -0
  192. package/dist/shacl.d.ts +15 -0
  193. package/dist/shacl.js +37 -0
  194. package/dist/validate-cli.d.ts +1 -0
  195. package/dist/validate-cli.js +5 -0
  196. package/dist/validate-run.d.ts +8 -0
  197. package/dist/validate-run.js +58 -0
  198. package/dist/validate.d.ts +11 -0
  199. package/dist/validate.js +94 -0
  200. package/dist/versioning-cli.d.ts +1 -0
  201. package/dist/versioning-cli.js +18 -0
  202. package/dist/versioning.d.ts +17 -0
  203. package/dist/versioning.js +45 -0
  204. package/ontology/core.ttl +993 -0
  205. package/ontology/di.ttl +167 -0
  206. package/package.json +76 -4
  207. package/schema/bpmn-ld.schema.json +15230 -0
  208. package/shapes/core.shapes.ttl +398 -0
  209. package/skills/bpmn-ld/SKILL.md +154 -0
  210. package/skills/bpmn-ld/evals/models/order-approval-di.jsonld +296 -0
  211. package/skills/bpmn-ld/evals/models/refund-di.bpmn +82 -0
  212. package/skills/bpmn-ld/evals/models/refund.bpmn +18 -0
  213. package/skills/bpmn-ld/evals/outputs/explain-collaboration.md +22 -0
  214. package/skills/bpmn-ld/evals/outputs/explain-order-approval.md +24 -0
  215. package/skills/bpmn-ld/evals/outputs/explain-refund.md +17 -0
  216. package/skills/bpmn-ld/evals/outputs/generate-activity-compensation.jsonld +39 -0
  217. package/skills/bpmn-ld/evals/outputs/generate-ad-hoc-sub-process.jsonld +52 -0
  218. package/skills/bpmn-ld/evals/outputs/generate-boundary-event.jsonld +27 -0
  219. package/skills/bpmn-ld/evals/outputs/generate-collaboration.jsonld +49 -0
  220. package/skills/bpmn-ld/evals/outputs/generate-conditions.jsonld +93 -0
  221. package/skills/bpmn-ld/evals/outputs/generate-diagram-properties.jsonld +340 -0
  222. package/skills/bpmn-ld/evals/outputs/generate-error.jsonld +217 -0
  223. package/skills/bpmn-ld/evals/outputs/generate-escalation.jsonld +231 -0
  224. package/skills/bpmn-ld/evals/outputs/generate-event-definition-ref.jsonld +67 -0
  225. package/skills/bpmn-ld/evals/outputs/generate-event-sub-process.jsonld +54 -0
  226. package/skills/bpmn-ld/evals/outputs/generate-exclusive-choice.jsonld +32 -0
  227. package/skills/bpmn-ld/evals/outputs/generate-instantiating-gateway.jsonld +24 -0
  228. package/skills/bpmn-ld/evals/outputs/generate-lane-partition.jsonld +46 -0
  229. package/skills/bpmn-ld/evals/outputs/generate-link-event.expect.json +11 -0
  230. package/skills/bpmn-ld/evals/outputs/generate-link-event.jsonld +57 -0
  231. package/skills/bpmn-ld/evals/outputs/generate-loop.jsonld +30 -0
  232. package/skills/bpmn-ld/evals/outputs/generate-message.jsonld +61 -0
  233. package/skills/bpmn-ld/evals/outputs/generate-parallel-branches.jsonld +25 -0
  234. package/skills/bpmn-ld/evals/outputs/generate-process-attributes.jsonld +49 -0
  235. package/skills/bpmn-ld/evals/outputs/generate-script-task.jsonld +18 -0
  236. package/skills/bpmn-ld/evals/outputs/generate-signal.jsonld +178 -0
  237. package/skills/bpmn-ld/evals/outputs/generate-sub-process.jsonld +31 -0
  238. package/skills/bpmn-ld/evals/outputs/generate-targeted-compensation.jsonld +40 -0
  239. package/skills/bpmn-ld/evals/outputs/generate-task-implementation.jsonld +18 -0
  240. package/skills/bpmn-ld/evals/outputs/generate-task-message-references.jsonld +49 -0
  241. package/skills/bpmn-ld/evals/outputs/generate-transaction.jsonld +48 -0
  242. package/skills/bpmn-ld/evals/outputs/modify-order-approval.jsonld +376 -0
  243. package/skills/bpmn-ld/evals/outputs/modify-refund.jsonld +373 -0
  244. package/skills/bpmn-ld/evals/outputs/order-approval.jsonld +29 -0
  245. package/skills/bpmn-ld/evals/outputs/refine-order-approval.jsonld +377 -0
  246. package/skills/bpmn-ld/evals/prompts/explain-collaboration.md +3 -0
  247. package/skills/bpmn-ld/evals/prompts/explain-order-approval.md +3 -0
  248. package/skills/bpmn-ld/evals/prompts/explain-refund.md +3 -0
  249. package/skills/bpmn-ld/evals/prompts/generate-activity-compensation.md +1 -0
  250. package/skills/bpmn-ld/evals/prompts/generate-ad-hoc-sub-process.md +1 -0
  251. package/skills/bpmn-ld/evals/prompts/generate-boundary-event.md +1 -0
  252. package/skills/bpmn-ld/evals/prompts/generate-collaboration.md +1 -0
  253. package/skills/bpmn-ld/evals/prompts/generate-conditions.md +1 -0
  254. package/skills/bpmn-ld/evals/prompts/generate-diagram-properties.md +1 -0
  255. package/skills/bpmn-ld/evals/prompts/generate-error.md +1 -0
  256. package/skills/bpmn-ld/evals/prompts/generate-escalation.md +1 -0
  257. package/skills/bpmn-ld/evals/prompts/generate-event-definition-ref.md +1 -0
  258. package/skills/bpmn-ld/evals/prompts/generate-event-sub-process.md +1 -0
  259. package/skills/bpmn-ld/evals/prompts/generate-exclusive-choice.md +1 -0
  260. package/skills/bpmn-ld/evals/prompts/generate-instantiating-gateway.md +1 -0
  261. package/skills/bpmn-ld/evals/prompts/generate-lane-partition.md +1 -0
  262. package/skills/bpmn-ld/evals/prompts/generate-link-event.md +1 -0
  263. package/skills/bpmn-ld/evals/prompts/generate-loop.md +1 -0
  264. package/skills/bpmn-ld/evals/prompts/generate-message.md +1 -0
  265. package/skills/bpmn-ld/evals/prompts/generate-parallel-branches.md +1 -0
  266. package/skills/bpmn-ld/evals/prompts/generate-process-attributes.md +1 -0
  267. package/skills/bpmn-ld/evals/prompts/generate-script-task.md +1 -0
  268. package/skills/bpmn-ld/evals/prompts/generate-signal.md +1 -0
  269. package/skills/bpmn-ld/evals/prompts/generate-sub-process.md +1 -0
  270. package/skills/bpmn-ld/evals/prompts/generate-targeted-compensation.md +1 -0
  271. package/skills/bpmn-ld/evals/prompts/generate-task-implementation.md +1 -0
  272. package/skills/bpmn-ld/evals/prompts/generate-task-message-references.md +1 -0
  273. package/skills/bpmn-ld/evals/prompts/generate-transaction.md +1 -0
  274. package/skills/bpmn-ld/evals/prompts/modify-order-approval.md +4 -0
  275. package/skills/bpmn-ld/evals/prompts/modify-refund.md +4 -0
  276. package/skills/bpmn-ld/evals/prompts/order-approval.md +1 -0
  277. package/skills/bpmn-ld/evals/prompts/refine-order-approval.md +8 -0
  278. package/skills/bpmn-ld/examples/positive/activity-compensation.jsonld +39 -0
  279. package/skills/bpmn-ld/examples/positive/ad-hoc-sub-process.jsonld +52 -0
  280. package/skills/bpmn-ld/examples/positive/boundary-event.jsonld +27 -0
  281. package/skills/bpmn-ld/examples/positive/collaboration.jsonld +49 -0
  282. package/skills/bpmn-ld/examples/positive/conditions.jsonld +93 -0
  283. package/skills/bpmn-ld/examples/positive/diagram-properties.jsonld +340 -0
  284. package/skills/bpmn-ld/examples/positive/error.jsonld +208 -0
  285. package/skills/bpmn-ld/examples/positive/escalation.jsonld +231 -0
  286. package/skills/bpmn-ld/examples/positive/event-definition-ref.jsonld +142 -0
  287. package/skills/bpmn-ld/examples/positive/event-sub-process.jsonld +54 -0
  288. package/skills/bpmn-ld/examples/positive/exclusive-choice.jsonld +32 -0
  289. package/skills/bpmn-ld/examples/positive/instantiating-gateway.jsonld +24 -0
  290. package/skills/bpmn-ld/examples/positive/lane-partition.jsonld +46 -0
  291. package/skills/bpmn-ld/examples/positive/link-event.expect.json +10 -0
  292. package/skills/bpmn-ld/examples/positive/link-event.jsonld +138 -0
  293. package/skills/bpmn-ld/examples/positive/loop.jsonld +30 -0
  294. package/skills/bpmn-ld/examples/positive/message.jsonld +60 -0
  295. package/skills/bpmn-ld/examples/positive/order-approval.jsonld +29 -0
  296. package/skills/bpmn-ld/examples/positive/parallel-branches.jsonld +25 -0
  297. package/skills/bpmn-ld/examples/positive/process-attributes.jsonld +49 -0
  298. package/skills/bpmn-ld/examples/positive/script-task.jsonld +18 -0
  299. package/skills/bpmn-ld/examples/positive/signal.jsonld +150 -0
  300. package/skills/bpmn-ld/examples/positive/sub-process.jsonld +31 -0
  301. package/skills/bpmn-ld/examples/positive/targeted-compensation.jsonld +40 -0
  302. package/skills/bpmn-ld/examples/positive/task-implementation.jsonld +18 -0
  303. package/skills/bpmn-ld/examples/positive/task-message-references.jsonld +151 -0
  304. package/skills/bpmn-ld/examples/positive/transaction.jsonld +48 -0
  305. package/skills/bpmn-ld/references/clarification-and-refinement.md +60 -0
  306. package/skills/bpmn-ld/references/common-mistakes.md +110 -0
  307. package/skills/bpmn-ld/references/explain-and-document.md +36 -0
  308. package/skills/bpmn-ld/references/modify-existing-model.md +49 -0
  309. package/skills/bpmn-ld/references/patterns.md +292 -0
  310. package/skills/bpmn-ld/references/render-output.md +1 -0
  311. package/skills/bpmn-ld/references/rule-catalogue.md +183 -0
  312. package/skills/bpmn-ld/references/vocabulary-summary.md +65 -0
  313. package/skills/bpmn-ld/template.jsonld +14 -0
  314. package/templates/combined.jsonld +3 -0
  315. package/templates/core.jsonld +170 -0
  316. package/templates/core.shapes.ttl +398 -0
  317. package/templates/core.ttl +993 -0
  318. package/templates/di.jsonld +37 -0
  319. package/templates/di.ttl +167 -0
@@ -0,0 +1,151 @@
1
+ {
2
+ "@context": [
3
+ "../../../../contexts/core.jsonld",
4
+ {
5
+ "@base": "https://example.org/models/task-message-references/"
6
+ }
7
+ ],
8
+ "@graph": [
9
+ {
10
+ "id": "Message_Confirmation",
11
+ "type": "Message",
12
+ "name": "Order confirmation"
13
+ },
14
+ {
15
+ "id": "Message_Order",
16
+ "type": "Message",
17
+ "name": "Order"
18
+ },
19
+ {
20
+ "id": "Collaboration_1",
21
+ "type": "Collaboration",
22
+ "participants": [
23
+ {
24
+ "id": "Participant_Customer",
25
+ "type": "Participant",
26
+ "name": "Customer",
27
+ "processRef": "Process_Customer"
28
+ },
29
+ {
30
+ "id": "Participant_Shop",
31
+ "type": "Participant",
32
+ "name": "Shop",
33
+ "processRef": "Process_Shop"
34
+ }
35
+ ],
36
+ "messageFlows": [
37
+ {
38
+ "id": "MessageFlow_Order",
39
+ "type": "MessageFlow",
40
+ "name": "Order",
41
+ "sourceRef": "SendOrder",
42
+ "targetRef": "ReceiveOrder",
43
+ "messageRef": "Message_Order"
44
+ },
45
+ {
46
+ "id": "MessageFlow_Confirmation",
47
+ "type": "MessageFlow",
48
+ "name": "Confirmation",
49
+ "sourceRef": "SendConfirmation",
50
+ "targetRef": "ReceiveConfirmation"
51
+ }
52
+ ]
53
+ },
54
+ {
55
+ "id": "Process_Customer",
56
+ "type": "Process",
57
+ "name": "Customer process",
58
+ "flowElements": [
59
+ {
60
+ "id": "CustomerStart",
61
+ "type": "StartEvent",
62
+ "name": "Wants to order"
63
+ },
64
+ {
65
+ "id": "SendOrder",
66
+ "type": "SendTask",
67
+ "name": "Send order",
68
+ "implementation": "##WebService",
69
+ "messageRef": "Message_Order"
70
+ },
71
+ {
72
+ "id": "ReceiveConfirmation",
73
+ "type": "ReceiveTask",
74
+ "name": "Receive confirmation",
75
+ "messageRef": "Message_Confirmation"
76
+ },
77
+ {
78
+ "id": "CustomerEnd",
79
+ "type": "EndEvent",
80
+ "name": "Order confirmed"
81
+ },
82
+ {
83
+ "id": "CustomerFlow_1",
84
+ "type": "SequenceFlow",
85
+ "sourceRef": "CustomerStart",
86
+ "targetRef": "SendOrder"
87
+ },
88
+ {
89
+ "id": "CustomerFlow_2",
90
+ "type": "SequenceFlow",
91
+ "sourceRef": "SendOrder",
92
+ "targetRef": "ReceiveConfirmation"
93
+ },
94
+ {
95
+ "id": "CustomerFlow_3",
96
+ "type": "SequenceFlow",
97
+ "sourceRef": "ReceiveConfirmation",
98
+ "targetRef": "CustomerEnd"
99
+ }
100
+ ]
101
+ },
102
+ {
103
+ "id": "Process_Shop",
104
+ "type": "Process",
105
+ "name": "Shop process",
106
+ "flowElements": [
107
+ {
108
+ "id": "ReceiveOrder",
109
+ "type": "ReceiveTask",
110
+ "name": "Receive order",
111
+ "instantiate": true,
112
+ "messageRef": "Message_Order"
113
+ },
114
+ {
115
+ "id": "CheckStock",
116
+ "type": "ServiceTask",
117
+ "name": "Check stock"
118
+ },
119
+ {
120
+ "id": "SendConfirmation",
121
+ "type": "SendTask",
122
+ "name": "Send confirmation",
123
+ "messageRef": "Message_Confirmation"
124
+ },
125
+ {
126
+ "id": "ShopEnd",
127
+ "type": "EndEvent",
128
+ "name": "Order handled"
129
+ },
130
+ {
131
+ "id": "ShopFlow_1",
132
+ "type": "SequenceFlow",
133
+ "sourceRef": "ReceiveOrder",
134
+ "targetRef": "CheckStock"
135
+ },
136
+ {
137
+ "id": "ShopFlow_2",
138
+ "type": "SequenceFlow",
139
+ "sourceRef": "CheckStock",
140
+ "targetRef": "SendConfirmation"
141
+ },
142
+ {
143
+ "id": "ShopFlow_3",
144
+ "type": "SequenceFlow",
145
+ "sourceRef": "SendConfirmation",
146
+ "targetRef": "ShopEnd"
147
+ }
148
+ ]
149
+ }
150
+ ]
151
+ }
@@ -0,0 +1,48 @@
1
+ {
2
+ "@context": [
3
+ "../../../../contexts/core.jsonld",
4
+ { "@base": "https://example.org/models/transaction/" }
5
+ ],
6
+ "@graph": [
7
+ {
8
+ "id": "Process_Order",
9
+ "type": "Process",
10
+ "name": "Order fulfilment",
11
+ "flowElements": [
12
+ { "id": "OrderReceived", "type": "StartEvent", "name": "Order received" },
13
+ {
14
+ "id": "ChargeAndShip",
15
+ "type": "Transaction",
16
+ "name": "Charge and ship",
17
+ "method": "Compensate",
18
+ "flowElements": [
19
+ { "id": "TxStart", "type": "StartEvent", "name": "Begin" },
20
+ { "id": "ChargeCard", "type": "ServiceTask", "name": "Charge card" },
21
+ { "id": "ShipGoods", "type": "ServiceTask", "name": "Ship goods" },
22
+ { "id": "TxEnd", "type": "EndEvent", "name": "Done" },
23
+ { "id": "TxFlow_1", "type": "SequenceFlow", "sourceRef": "TxStart", "targetRef": "ChargeCard" },
24
+ { "id": "TxFlow_2", "type": "SequenceFlow", "sourceRef": "ChargeCard", "targetRef": "ShipGoods" },
25
+ { "id": "TxFlow_3", "type": "SequenceFlow", "sourceRef": "ShipGoods", "targetRef": "TxEnd" }
26
+ ]
27
+ },
28
+ {
29
+ "id": "ReserveStock",
30
+ "type": "Transaction",
31
+ "name": "Reserve stock",
32
+ "method": "Store",
33
+ "flowElements": [
34
+ { "id": "StockStart", "type": "StartEvent", "name": "Begin" },
35
+ { "id": "ReserveItems", "type": "ServiceTask", "name": "Reserve items" },
36
+ { "id": "StockEnd", "type": "EndEvent", "name": "Reserved" },
37
+ { "id": "StockFlow_1", "type": "SequenceFlow", "sourceRef": "StockStart", "targetRef": "ReserveItems" },
38
+ { "id": "StockFlow_2", "type": "SequenceFlow", "sourceRef": "ReserveItems", "targetRef": "StockEnd" }
39
+ ]
40
+ },
41
+ { "id": "OrderCompleted", "type": "EndEvent", "name": "Order completed" },
42
+ { "id": "Flow_1", "type": "SequenceFlow", "sourceRef": "OrderReceived", "targetRef": "ChargeAndShip" },
43
+ { "id": "Flow_2", "type": "SequenceFlow", "sourceRef": "ChargeAndShip", "targetRef": "ReserveStock" },
44
+ { "id": "Flow_3", "type": "SequenceFlow", "sourceRef": "ReserveStock", "targetRef": "OrderCompleted" }
45
+ ]
46
+ }
47
+ ]
48
+ }
@@ -0,0 +1,60 @@
1
+ # Clarification, assumptions and refinement
2
+
3
+ How to decide between asking and assuming, how to apply feedback to an existing model, and how to report. The fix-round cap is three rounds, as in `SKILL.md`.
4
+
5
+ ## When to ask and when to assume
6
+
7
+ Ask before writing when the answer would change the shape of the process and cannot be inferred. Otherwise state an assumption, keep going and report it.
8
+
9
+ Ask when:
10
+
11
+ - the request does not say what the process is for, where it starts or where it ends, and no reasonable default exists;
12
+ - a decision has several plausible outcomes that lead to different flows, for example "who approves, the manager or finance?";
13
+ - the answer decides whether branches run in parallel or as an exclusive choice and the text gives no hint;
14
+ - several participants are involved and it is unclear who owns which step.
15
+
16
+ Assume when:
17
+
18
+ - the gap is a detail that is cheap to change later, such as the exact name of a task or the wording of a condition;
19
+ - a default is standard practice, for example one start event and an end event per outcome;
20
+ - the request is silent on an unhappy path that the user did not ask for.
21
+
22
+ Examples:
23
+
24
+ - "Model our order process": ask what starts it and what the possible outcomes are. Nothing can be inferred.
25
+ - "Orders over 1000 need approval": assume that smaller orders skip approval and continue, and report it.
26
+ - "Notify the customer and update stock": assume the two steps run in parallel only if the text says they are independent; otherwise ask or state the sequence assumed.
27
+
28
+ Ask at most a few focused questions in one message, then wait. Never ask something the request already answers.
29
+
30
+ ## Reporting assumptions
31
+
32
+ List every assumption in the final report under an `Assumptions` list, one per line, in plain language:
33
+
34
+ - name the element by its `id` where one exists;
35
+ - say what was assumed and what the alternative would have been;
36
+ - mark which assumptions are most likely to need confirmation.
37
+
38
+ Do not hide assumptions inside the model or leave them out because the checks passed. A valid model can still be the wrong process.
39
+
40
+ ## Applying feedback to an existing model
41
+
42
+ Edit the existing document in place. Do not regenerate it from scratch.
43
+
44
+ - Change only the elements the feedback touches: add, remove or rewire the nodes and sequence flows concerned.
45
+ - Preserve existing `id` values of every element that stays, so references, diagrams and the user's mental model stay stable.
46
+ - When inserting a step, give the new elements fresh unique ids and update `sourceRef` and `targetRef` of the neighbouring flows.
47
+ - When removing a step, remove the flows attached to it and reconnect its neighbours.
48
+ - Re-run both checks from `SKILL.md` after every change set, then report as usual.
49
+ - Treat feedback that changes the intent of the process as a new clarification question, not as an edit.
50
+
51
+ Each feedback application is its own session of checks. The three-round cap applies to fix rounds within one request.
52
+
53
+ ## Never present a model with errors as finished
54
+
55
+ A model is finished only when `npm run validate` prints `ok` for it and `summary.errors` is 0.
56
+
57
+ - After the third fix round, run both commands one last time and stop, even if errors remain.
58
+ - Report what remains: each remaining error with its rule or message, the element, the likely cause and the suggested fix from `references/rule-catalogue.md`.
59
+ - State plainly that the model is not valid. Do not call it done, complete or ready.
60
+ - Warnings do not block. Report them with an explanation and do not present them as errors.
@@ -0,0 +1,110 @@
1
+ # Common modelling mistakes
2
+
3
+ Mistakes that often appear in process models, how to repair each one in BPMN-LD, and whether the analyzer catches it. Rule identifiers are explained in `references/rule-catalogue.md`; worked examples are in `examples/positive/`.
4
+
5
+ Each entry has the same fields:
6
+
7
+ - Mistake: what the model does wrong.
8
+ - Why it matters: what goes wrong when the process runs.
9
+ - Fix in BPMN-LD: the change to make in the document.
10
+ - Analyzer coverage: the rule that reports it, or a statement that the analyzer does not.
11
+
12
+ ## Splitting without merging
13
+
14
+ Mistake: a gateway splits the flow into several branches, but the branches never come back together through a matching gateway, or they are joined by a gateway of the other type.
15
+
16
+ Why it matters: the work after the branches runs once per branch, or a join waits for a branch that is never taken and the process stalls.
17
+
18
+ Fix in BPMN-LD: give every split a converging gateway of the same type that all branches enter, and set `gatewayDirection` to `Diverging` on the split and `Converging` on the join. Use two `ParallelGateway` elements for branches that all run (`examples/positive/parallel-branches.jsonld`) and two `ExclusiveGateway` elements for a choice (`examples/positive/exclusive-choice.jsonld`). A branch that deliberately ends on its own may end in its own end event instead.
19
+
20
+ Analyzer coverage: `split-join-exclusive-to-parallel`, `split-join-parallel-to-exclusive`, `gateway-diverging-too-few-outgoing` and `gateway-converging-too-few-incoming` report mismatched or incomplete gateways. A split whose branches are simply never merged is not reported as such; the branches show up as `node-dead-end` only when one of them stops without an end event.
21
+
22
+ ## Missing end events
23
+
24
+ Mistake: a process or sub-process has no end event, or a branch stops at an activity with nothing after it.
25
+
26
+ Why it matters: completion is only implicit, so a reader or tool cannot tell where the process finishes or which outcomes exist, and a sub-process may never hand control back.
27
+
28
+ Fix in BPMN-LD: add an `EndEvent` to the scope and connect the last activity of each branch to one. Use a separate, named end event for each distinct outcome (`examples/positive/order-approval.jsonld`).
29
+
30
+ Analyzer coverage: `end-event-missing` (warning) for a scope with no end event, `node-dead-end` (warning) for a flow node with no outgoing flow that is not an end event, and `node-cannot-reach-end` (warning) for a node from which no end event can be reached.
31
+
32
+ ## Too many or no start events
33
+
34
+ Mistake: a process has no start event, or several plain start events that all start the same process without saying why.
35
+
36
+ Why it matters: without a start event the process cannot begin and everything in it is unreachable; with several unexplained ones it is unclear which situation starts it and whether they start separate instances.
37
+
38
+ Fix in BPMN-LD: give each process and sub-process one `StartEvent` connected to the first activity. When there are really several triggers, keep one start event per trigger and give each a typed event definition such as a message or timer, or use an instantiating gateway when the first of several events starts the process (`examples/positive/instantiating-gateway.jsonld`).
39
+
40
+ Analyzer coverage: `start-event-missing` (error) for a process or sub-process with no start event. The analyzer does not report a scope that has more than one start event, so check that by reading the model.
41
+
42
+ ## Unlabelled decision branches
43
+
44
+ Mistake: an exclusive gateway has several outgoing flows, but the flows carry no name and no condition, and no flow is marked as the default.
45
+
46
+ Why it matters: a reader cannot tell which path is taken in which situation, and an engine cannot choose between the branches or has no path to take when no condition holds, so the process stalls or picks arbitrarily.
47
+
48
+ Fix in BPMN-LD: phrase the gateway `name` as a question, give every outgoing `SequenceFlow` a short `name` that answers it, and put a `conditionExpression` on all but one of the flows. Name the remaining flow in the gateway's `default` so there is always a path to take (`examples/positive/exclusive-choice.jsonld`, `examples/positive/order-approval.jsonld`).
49
+
50
+ Analyzer coverage: not detected by the analyzer; check by review. No rule reports an exclusive gateway whose outgoing flows lack names, conditions or a default flow, so read each gateway in the model.
51
+
52
+ ## Gateways doing the work
53
+
54
+ Mistake: a gateway is treated as a step that performs or evaluates the work, for example a gateway named "Check credit" that also decides, instead of only routing on a result that already exists.
55
+
56
+ Why it matters: a gateway only routes the flow; it takes no time, has no performer and records no result. Putting the work in it hides who does the work and what information the decision depends on.
57
+
58
+ Fix in BPMN-LD: add a task before the gateway that does the work, such as a `UserTask` or `ServiceTask` named with a verb and an object, and connect it to the gateway with a `SequenceFlow`. Name the gateway as the question asked of that result and let its outgoing flows carry the answers (`examples/positive/order-approval.jsonld` has the review task before the "Approved?" gateway).
59
+
60
+ Analyzer coverage: not detected by the analyzer; check by review. No rule judges what a gateway is named or whether a task precedes it, so check each diverging gateway for a task that produces the result it decides on.
61
+
62
+ ## Mixed levels of detail
63
+
64
+ Mistake: one process mixes coarse steps with fine-grained ones, for example "Handle onboarding" next to "Click save in the form" in the same flow.
65
+
66
+ Why it matters: the diagram is hard to read at a glance, steps cannot be compared or assigned consistently, and the detailed part cannot be reused, changed or measured separately from the overview.
67
+
68
+ Fix in BPMN-LD: keep the parent process at one level and move the detailed steps into a `SubProcess`. Give the sub-process its own `StartEvent`, tasks and `EndEvent` in its `flowElements`, and connect the sub-process in the parent like any other activity (`examples/positive/sub-process.jsonld`).
69
+
70
+ Analyzer coverage: not detected by the analyzer; check by review. No rule judges how detailed a step is, so compare the names in each flow and group the fine-grained ones. The analyzer does check that the sub-process you introduce has a start and an end event (`start-event-missing`, `end-event-missing`).
71
+
72
+ ## Wrong task type
73
+
74
+ Mistake: every step is a generic `Task`, or a step uses a type that does not match who or what performs it, for example a `UserTask` for an automatic call.
75
+
76
+ Why it matters: the type tells readers and engines whether a person, a system or a rule does the work. A wrong or generic type hides the performer, and an engine may wait for a person or run an automation that was never meant for that step.
77
+
78
+ Fix in BPMN-LD: choose the specific type for each step. Use `UserTask` for work a person does in a system, `ManualTask` for work done without any system, `ServiceTask` for an automated call, `ScriptTask` for a script the engine runs, `BusinessRuleTask` for evaluating a decision rule, `SendTask` for sending a message and `ReceiveTask` for waiting for one (`examples/positive/task-implementation.jsonld` shows user and service tasks, `examples/positive/script-task.jsonld` a script task and `examples/positive/task-message-references.jsonld` send and receive tasks).
79
+
80
+ Analyzer coverage: not detected by the analyzer; check by review. No rule judges whether a task type fits the work. The analyzer only checks that a `SendTask` or `ReceiveTask` with a `messageRef` has a matching message flow (`task-message-without-message-flow`).
81
+
82
+ ## Exceptions on the happy path
83
+
84
+ Mistake: error, timeout or cancellation handling is drawn as ordinary gateways and tasks in the main flow, for example a gateway after every task asking "Did it fail?".
85
+
86
+ Why it matters: the normal route is buried under checks, so the main purpose of the process is hard to see. Gateways also test only after the task has finished, so they cannot react while it is still running, such as when a deadline passes.
87
+
88
+ Fix in BPMN-LD: keep the main flow for the normal case and attach a `BoundaryEvent` to the activity, with `attachedToRef` set to the activity id and an event definition such as `TimerEventDefinition` or `ErrorEventDefinition`. Connect the boundary event with a `SequenceFlow` to the handling steps. A boundary event interrupts the activity by default; set `cancelActivity` to `false` when the activity should keep running while the exception is handled (`examples/positive/boundary-event.jsonld`, `examples/positive/escalation.jsonld`).
89
+
90
+ Analyzer coverage: not detected by the analyzer; check by review. No rule reports exception checks modelled as gateways. The analyzer does treat a boundary event as part of the flow, so a boundary event whose host cannot be reached is reported as `node-unreachable`.
91
+
92
+ ## Solid arrows between pools
93
+
94
+ Mistake: a `SequenceFlow` is drawn from an element in one participant (pool) to an element in another, for example from "Send order" in the customer's process straight to "Receive order" in the shop's process.
95
+
96
+ Why it matters: a sequence flow only orders work inside one process. Between participants the two sides are separate processes run by separate parties, and the only way they interact is by sending messages, so a solid arrow misstates how they are coupled.
97
+
98
+ Fix in BPMN-LD: keep each `SequenceFlow` inside the `flowElements` of the process that owns both of its ends. Connect the participants with a `MessageFlow` in the `messageFlows` of the `Collaboration`, with `sourceRef` and `targetRef` pointing at the sending and receiving elements, or at the participants when the exchange is not tied to one step. Use a `SendTask` and a `ReceiveTask` or message events as the ends (`examples/positive/collaboration.jsonld`).
99
+
100
+ Analyzer coverage: not detected by the analyzer; check by review. No rule reports a sequence flow whose source and target are in different participants, so check that every sequence flow stays within one process. The analyzer does check that a `SendTask` or `ReceiveTask` with a `messageRef` has a matching message flow (`task-message-without-message-flow`).
101
+
102
+ ## Spaghetti layout
103
+
104
+ Mistake: the diagram is placed by hand with coordinates, so flows cross, loop back over other elements and the main path is hard to follow.
105
+
106
+ Why it matters: a diagram that cannot be read at a glance hides the process it describes, and hand-placed coordinates drift out of date whenever the model changes.
107
+
108
+ Fix in BPMN-LD: leave the diagram out while building the model and let the layout command place it. Run `npm run layout -- <file> -o <out.jsonld>` to write the model with a laid-out diagram, or `npm run export -- --layout <work>/positive/<name>.jsonld -o <work>/<name>.bpmn` to lay out and export in one step. Existing diagram content is kept; adding `--force` to either command replaces it by a fresh full layout, so use `--force` only when the layout should be redone.
109
+
110
+ Analyzer coverage: not detected by the analyzer; check by review. The analyzer looks at the process structure, not at the diagram, so look at the laid-out result and keep the flow direction consistent.
@@ -0,0 +1,36 @@
1
+ # Explain and document an existing model
2
+
3
+ Use this when the user gives a model and asks what it does, or asks for documentation of it. Read the model; do not change it.
4
+
5
+ ## Get a BPMN-LD model
6
+
7
+ - A BPMN-LD file (`.jsonld`): read it directly.
8
+ - A BPMN 2.0 XML file (`.bpmn`, `.xml`): convert it first, from the repository root, into a scratch directory:
9
+
10
+ ```
11
+ npm run convert -- <work>/<name>.bpmn -o <work>/positive/<name>.jsonld
12
+ ```
13
+
14
+ Exit code 0 means the file was written. Conversion `warning:` lines go to standard error; they name XML constructs that were not carried over, so mention them when they affect the explanation. Exit code 2 means unusable input (missing file, malformed XML, not BPMN): report it and stop. Explain the converted file, never the XML.
15
+
16
+ ## Explain in plain language
17
+
18
+ 1. Read the whole model first: processes, participants, lanes, flow nodes and sequence flows. Follow `sourceRef` and `targetRef` to trace paths from each start event.
19
+ 2. Start with one or two sentences saying what the process achieves and what triggers it.
20
+ 3. Walk the steps in the order they happen. Say who or what performs a step from its type: a user task is done by a person, a service task by a system, a sub-process groups further steps.
21
+ 4. Explain every gateway: an exclusive gateway chooses one path, a parallel gateway runs all paths at once, and say what each outgoing flow means using its `name` and `conditionExpression`; name the default flow.
22
+ 5. Describe how the process can end, one end event per outcome.
23
+ 6. Use the exact name of every named element (the `name` property), so the reader can find it in the model. Mention every named element: events, tasks, gateways, sequence flows, participants and lanes. Use plain words around the names and avoid identifiers, IRIs and JSON-LD terms unless asked.
24
+ 7. Do not invent behaviour the model does not state. Say so when a name or condition is missing, and say which element it concerns, by `id`.
25
+
26
+ ## Documentation structure
27
+
28
+ When the user wants documentation, write Markdown (or prose when asked) with these sections:
29
+
30
+ - A heading with the process name and a short summary.
31
+ - Steps: a numbered list in execution order, each naming the element exactly.
32
+ - Decisions: each gateway with its outcomes.
33
+ - Outcomes: the end events and what each means.
34
+ - Notes: conversion warnings, unnamed elements and anything uncertain.
35
+
36
+ Write the documentation to the path the user gives, or present it in the reply.
@@ -0,0 +1,49 @@
1
+ # Modify an existing model
2
+
3
+ Use this when the user gives a model, as BPMN-LD or BPMN 2.0 XML, and asks for a change. Edit the model in place; never regenerate it from scratch.
4
+
5
+ ## Get a BPMN-LD model
6
+
7
+ - A BPMN-LD file (`.jsonld`): copy it to `<work>/positive/<name>.jsonld` and edit the copy.
8
+ - A BPMN 2.0 XML file (`.bpmn`, `.xml`): convert it first, from the repository root:
9
+
10
+ ```
11
+ npm run convert -- <work>/<name>.bpmn -o <work>/positive/<name>.jsonld
12
+ ```
13
+
14
+ Exit code 0 means the file was written. Conversion `warning:` lines go to standard error and name XML constructs that were not carried over (`incoming` and `outgoing` children are derived and not kept); report those that affect the change. Exit code 2 means unusable input: report it and stop. Existing diagram data (`bpmndi:`) is converted to `BPMNDiagram`, `BPMNShape` and `BPMNEdge` nodes with the same coordinates. The converted file points its `@context` at the hosted `combined.jsonld`, which the validation commands cannot fetch: replace that first `@context` entry with the two entries `<repo>/contexts/core.jsonld` and `<repo>/contexts/di.jsonld` (absolute path of the repository root, as in `template.jsonld`). A model with diagram data needs the `di.jsonld` context. Edit the converted file, never the XML.
15
+
16
+ ## Edit in place
17
+
18
+ 1. Make exactly the requested change and nothing else. Do not reformat, reorder, rename or re-id other elements.
19
+ 2. Preserve identifiers: every existing `id` stays as it is, and so do `sourceRef`, `targetRef`, `attachedToRef` and `default` values that point at untouched elements. Give new elements new unique `id` values in the style of the existing ones.
20
+ 3. Preserve extensions: keep every property with a prefix or absolute IRI (for example `acme:priority`) and the prefix declarations in the `@context`, on every element, including those you change.
21
+ 4. Preserve existing diagram data: do not edit, move, resize, delete or re-id any `BPMNShape`, `BPMNEdge`, their `bounds` or `waypoints`. Do not write coordinates for new elements by hand.
22
+ 5. When a change removes an element, remove its own shape and edges together with it. When a change rewires a flow, its existing edge keeps its old waypoints; say so in the report instead of editing it.
23
+ 6. Keep the structure of the document: nested stays nested, `@graph` stays `@graph`.
24
+
25
+ ## Lay out only what is missing
26
+
27
+ Layout completes partial diagram data: it appends shapes and edges only for the flow nodes and sequence flows that lack them and never modifies existing ones (see `docs/conventions/layout.md`). To get a file with the completed diagram:
28
+
29
+ ```
30
+ npm run layout -- <work>/positive/<name>.jsonld -o <work>/<name>-laid-out.jsonld
31
+ ```
32
+
33
+ Do not use `--force`: it replaces the whole diagram with a fresh layout and so discards the existing coordinates. Only use it when the user explicitly asks for the layout to be redone.
34
+
35
+ ## Re-check and export
36
+
37
+ 1. `npm run validate -- <work>` and `npm run analyze -- <work>/positive/<name>.jsonld --format json`; fix errors as in the generate workflow, within the same three-round cap.
38
+ 2. Export with layout of the missing parts, then run the external checks:
39
+
40
+ ```
41
+ npm run export -- --layout <work>/positive/<name>.jsonld -o <work>/<name>.bpmn --json
42
+ npm run check-xml -- <work>/<name>.bpmn --json
43
+ ```
44
+
45
+ 3. Compare with the original: every element you were not asked to change has the same properties, and every original shape and edge has the same `bounds` and `waypoints`.
46
+
47
+ ## Report
48
+
49
+ State the path of the modified model, which elements were changed, added or removed by `id`, the results of validate, analyze and check-xml, the path of the exported `.bpmn` file, and any assumptions.