@bpmnkit/core 1.8.0 → 1.10.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/agent-cards/bpmn.md +4 -2
- package/builder-reference.md +11 -9
- package/dist/bpmn/auto-layout.js +82 -26
- package/dist/bpmn/bpmn-builder.d.ts +84 -7
- package/dist/bpmn/bpmn-builder.js +321 -76
- package/dist/bpmn/bpmn-model.d.ts +2 -0
- package/dist/bpmn/bpmn-parser.js +68 -76
- package/dist/bpmn/bpmn-serializer.js +60 -19
- package/dist/bpmn/bpmnlint.js +4 -69
- package/dist/bpmn/builder-rules.d.ts +20 -0
- package/dist/bpmn/builder-rules.js +120 -0
- package/dist/bpmn/camunda-compat-data.d.ts +10 -148
- package/dist/bpmn/camunda-compat-data.js +16 -407
- package/dist/bpmn/camunda-compat-feel.d.ts +3 -0
- package/dist/bpmn/camunda-compat-feel.js +1 -1
- package/dist/bpmn/camunda-compat.js +7 -6
- package/dist/bpmn/camunda7/export.js +4 -1
- package/dist/bpmn/camunda7/juel.js +2 -1
- package/dist/bpmn/camunda7/migrate.d.ts +23 -0
- package/dist/bpmn/camunda7/migrate.js +75 -3
- package/dist/bpmn/compact-stream.js +2 -1
- package/dist/bpmn/compact.d.ts +80 -4
- package/dist/bpmn/compact.js +220 -38
- package/dist/bpmn/feel-condition.d.ts +9 -0
- package/dist/bpmn/feel-condition.js +19 -0
- package/dist/bpmn/full-operations.js +31 -4
- package/dist/bpmn/index.d.ts +17 -1
- package/dist/bpmn/index.js +19 -25
- package/dist/bpmn/operations.d.ts +4 -4
- package/dist/bpmn/operations.js +14 -2
- package/dist/bpmn/optimize/bpmnlint-rules.js +7 -40
- package/dist/bpmn/optimize/index.js +15 -1
- package/dist/bpmn/optimize/tasks.js +12 -3
- package/dist/bpmn/process-delta.d.ts +18 -0
- package/dist/bpmn/process-delta.js +20 -2
- package/dist/bpmn/process-text-writer.js +27 -1
- package/dist/bpmn/process-text.d.ts +9 -3
- package/dist/bpmn/process-text.js +122 -16
- package/dist/bpmn/stable-ids.d.ts +2 -0
- package/dist/bpmn/stable-ids.js +8 -0
- package/dist/bpmn/xsd-guards.d.ts +8 -0
- package/dist/bpmn/xsd-guards.js +56 -0
- package/dist/bpmn/zeebe-extensions.js +2 -1
- package/dist/bpmn/zeebe-placement.js +6 -129
- package/dist/bpmn/zeebe-validate/context.d.ts +132 -0
- package/dist/bpmn/zeebe-validate/context.js +241 -0
- package/dist/bpmn/zeebe-validate/gate.d.ts +87 -0
- package/dist/bpmn/zeebe-validate/gate.js +492 -0
- package/dist/bpmn/zeebe-validate/index.d.ts +37 -0
- package/dist/bpmn/zeebe-validate/index.js +106 -0
- package/dist/bpmn/zeebe-validate/rules/events.d.ts +4 -0
- package/dist/bpmn/zeebe-validate/rules/events.js +580 -0
- package/dist/bpmn/zeebe-validate/rules/extensions.d.ts +4 -0
- package/dist/bpmn/zeebe-validate/rules/extensions.js +411 -0
- package/dist/bpmn/zeebe-validate/rules/gateways.d.ts +3 -0
- package/dist/bpmn/zeebe-validate/rules/gateways.js +296 -0
- package/dist/bpmn/zeebe-validate/rules/references.d.ts +3 -0
- package/dist/bpmn/zeebe-validate/rules/references.js +495 -0
- package/dist/bpmn/zeebe-validate/rules/structure.d.ts +3 -0
- package/dist/bpmn/zeebe-validate/rules/structure.js +629 -0
- package/dist/bpmn/zeebe-validate/rules/tasks.d.ts +4 -0
- package/dist/bpmn/zeebe-validate/rules/tasks.js +446 -0
- package/dist/bpmn/zeebe-validate/xml.d.ts +15 -0
- package/dist/bpmn/zeebe-validate/xml.js +1062 -0
- package/dist/bpmn/zeebe-validate/xsd.d.ts +19 -0
- package/dist/bpmn/zeebe-validate/xsd.js +350 -0
- package/dist/connectors/apply-element.d.ts +5 -2
- package/dist/connectors/apply-element.js +6 -0
- package/dist/connectors/apply-many.d.ts +9 -2
- package/dist/connectors/apply-many.js +17 -2
- package/dist/connectors/apply.d.ts +4 -2
- package/dist/connectors/deployability.d.ts +27 -0
- package/dist/connectors/deployability.js +41 -0
- package/dist/connectors/index.d.ts +1 -0
- package/dist/connectors/lines.d.ts +10 -0
- package/dist/connectors/lines.js +13 -4
- package/dist/dmn/dmn-model.d.ts +24 -4
- package/dist/dmn/dmn-parser.js +37 -3
- package/dist/dmn/dmn-serializer.js +48 -47
- package/dist/dmn/lint.js +4 -11
- package/dist/errors.d.ts +30 -1
- package/dist/errors.js +31 -0
- package/dist/form/form-model.d.ts +11 -0
- package/dist/form/form-parser.d.ts +1 -0
- package/dist/form/form-parser.js +48 -12
- package/dist/form/form-serializer.js +40 -17
- package/dist/form/lint.js +6 -40
- package/dist/generated/bpmn-elements.d.ts +5 -0
- package/dist/generated/bpmn-elements.js +151 -0
- package/dist/generated/camunda-compat-data.d.ts +148 -0
- package/dist/generated/camunda-compat-data.js +371 -0
- package/dist/generated/dmn-elements.d.ts +12 -0
- package/dist/generated/dmn-elements.js +45 -0
- package/dist/generated/form-elements.d.ts +5 -0
- package/dist/generated/form-elements.js +45 -0
- package/dist/generated/lint-rules.d.ts +17 -0
- package/dist/generated/lint-rules.js +116 -0
- package/dist/generated/zeebe-elements.d.ts +10 -0
- package/dist/generated/zeebe-elements.js +168 -0
- package/dist/generated/zeebe-rules.d.ts +25 -0
- package/dist/generated/zeebe-rules.js +202 -0
- package/dist/index.d.ts +11 -4
- package/dist/index.js +4 -1
- package/dist/layout/annotations.js +21 -1
- package/dist/layout/orthogonal.js +9 -3
- package/dist/plan/compile.d.ts +26 -1
- package/dist/plan/compile.js +48 -6
- package/dist/plan/merge.d.ts +2 -1
- package/dist/plan/merge.js +13 -5
- package/package.json +2 -2
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Zeebe's BPMN 2.0 schemas (Semantic, BPMN20, BPMNDI, DI and DC .xsd from
|
|
3
|
+
* zeebe-bpmn-model 8.9.28), compiled to the content models xml.ts validates
|
|
4
|
+
* against. Generated from the .xsd files; edit by regenerating, not by hand.
|
|
5
|
+
*
|
|
6
|
+
* - `XSD_ELEMENTS`: global element -> `type` or `type/substitutionHead`.
|
|
7
|
+
* - `XSD_TYPES`: complex type -> `base|particles|attributes|flags`. A particle is a
|
|
8
|
+
* global element ref, `name=type` for a local element, `#any`/`#other` for a
|
|
9
|
+
* wildcard, or `(a|b)` for a choice, then `?`, `*`, `+` or `{min,max}`. An
|
|
10
|
+
* attribute is `name=type`, `!` when required. Flags: `@` any attribute from
|
|
11
|
+
* another namespace, `~` mixed content, `!` abstract.
|
|
12
|
+
* - `XSD_ENUMS`: simple type -> its enumeration (`[]` for a union, any string).
|
|
13
|
+
*
|
|
14
|
+
* Names without a prefix are in the BPMN model namespace.
|
|
15
|
+
*/
|
|
16
|
+
export declare const XSD_ELEMENTS: Readonly<Record<string, string>>;
|
|
17
|
+
export declare const XSD_TYPES: Readonly<Record<string, string>>;
|
|
18
|
+
export declare const XSD_ENUMS: Readonly<Record<string, readonly string[]>>;
|
|
19
|
+
//# sourceMappingURL=xsd.d.ts.map
|
|
@@ -0,0 +1,350 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Zeebe's BPMN 2.0 schemas (Semantic, BPMN20, BPMNDI, DI and DC .xsd from
|
|
3
|
+
* zeebe-bpmn-model 8.9.28), compiled to the content models xml.ts validates
|
|
4
|
+
* against. Generated from the .xsd files; edit by regenerating, not by hand.
|
|
5
|
+
*
|
|
6
|
+
* - `XSD_ELEMENTS`: global element -> `type` or `type/substitutionHead`.
|
|
7
|
+
* - `XSD_TYPES`: complex type -> `base|particles|attributes|flags`. A particle is a
|
|
8
|
+
* global element ref, `name=type` for a local element, `#any`/`#other` for a
|
|
9
|
+
* wildcard, or `(a|b)` for a choice, then `?`, `*`, `+` or `{min,max}`. An
|
|
10
|
+
* attribute is `name=type`, `!` when required. Flags: `@` any attribute from
|
|
11
|
+
* another namespace, `~` mixed content, `!` abstract.
|
|
12
|
+
* - `XSD_ENUMS`: simple type -> its enumeration (`[]` for a union, any string).
|
|
13
|
+
*
|
|
14
|
+
* Names without a prefix are in the BPMN model namespace.
|
|
15
|
+
*/
|
|
16
|
+
export const XSD_ELEMENTS = {
|
|
17
|
+
activity: "tActivity",
|
|
18
|
+
adHocSubProcess: "tAdHocSubProcess/flowElement",
|
|
19
|
+
artifact: "tArtifact",
|
|
20
|
+
assignment: "tAssignment",
|
|
21
|
+
association: "tAssociation/artifact",
|
|
22
|
+
auditing: "tAuditing",
|
|
23
|
+
baseElement: "tBaseElement",
|
|
24
|
+
baseElementWithMixedContent: "tBaseElementWithMixedContent",
|
|
25
|
+
boundaryEvent: "tBoundaryEvent/flowElement",
|
|
26
|
+
businessRuleTask: "tBusinessRuleTask/flowElement",
|
|
27
|
+
callableElement: "tCallableElement",
|
|
28
|
+
callActivity: "tCallActivity/flowElement",
|
|
29
|
+
callChoreography: "tCallChoreography/flowElement",
|
|
30
|
+
callConversation: "tCallConversation/conversationNode",
|
|
31
|
+
cancelEventDefinition: "tCancelEventDefinition/eventDefinition",
|
|
32
|
+
catchEvent: "tCatchEvent",
|
|
33
|
+
category: "tCategory/rootElement",
|
|
34
|
+
categoryValue: "tCategoryValue",
|
|
35
|
+
choreography: "tChoreography/collaboration",
|
|
36
|
+
choreographyActivity: "tChoreographyActivity",
|
|
37
|
+
choreographyTask: "tChoreographyTask/flowElement",
|
|
38
|
+
collaboration: "tCollaboration/rootElement",
|
|
39
|
+
compensateEventDefinition: "tCompensateEventDefinition/eventDefinition",
|
|
40
|
+
complexBehaviorDefinition: "tComplexBehaviorDefinition",
|
|
41
|
+
complexGateway: "tComplexGateway/flowElement",
|
|
42
|
+
conditionalEventDefinition: "tConditionalEventDefinition/eventDefinition",
|
|
43
|
+
conversation: "tConversation/conversationNode",
|
|
44
|
+
conversationAssociation: "tConversationAssociation",
|
|
45
|
+
conversationLink: "tConversationLink",
|
|
46
|
+
conversationNode: "tConversationNode",
|
|
47
|
+
correlationKey: "tCorrelationKey",
|
|
48
|
+
correlationProperty: "tCorrelationProperty/rootElement",
|
|
49
|
+
correlationPropertyBinding: "tCorrelationPropertyBinding",
|
|
50
|
+
correlationPropertyRetrievalExpression: "tCorrelationPropertyRetrievalExpression",
|
|
51
|
+
correlationSubscription: "tCorrelationSubscription",
|
|
52
|
+
dataAssociation: "tDataAssociation",
|
|
53
|
+
dataInput: "tDataInput",
|
|
54
|
+
dataInputAssociation: "tDataInputAssociation",
|
|
55
|
+
dataObject: "tDataObject/flowElement",
|
|
56
|
+
dataObjectReference: "tDataObjectReference/flowElement",
|
|
57
|
+
dataOutput: "tDataOutput",
|
|
58
|
+
dataOutputAssociation: "tDataOutputAssociation",
|
|
59
|
+
dataState: "tDataState",
|
|
60
|
+
dataStore: "tDataStore/rootElement",
|
|
61
|
+
dataStoreReference: "tDataStoreReference/flowElement",
|
|
62
|
+
documentation: "tDocumentation",
|
|
63
|
+
endEvent: "tEndEvent/flowElement",
|
|
64
|
+
endPoint: "tEndPoint/rootElement",
|
|
65
|
+
error: "tError/rootElement",
|
|
66
|
+
errorEventDefinition: "tErrorEventDefinition/eventDefinition",
|
|
67
|
+
escalation: "tEscalation/rootElement",
|
|
68
|
+
escalationEventDefinition: "tEscalationEventDefinition/eventDefinition",
|
|
69
|
+
event: "tEvent/flowElement",
|
|
70
|
+
eventBasedGateway: "tEventBasedGateway/flowElement",
|
|
71
|
+
eventDefinition: "tEventDefinition/rootElement",
|
|
72
|
+
exclusiveGateway: "tExclusiveGateway/flowElement",
|
|
73
|
+
expression: "tExpression",
|
|
74
|
+
extension: "tExtension",
|
|
75
|
+
extensionElements: "tExtensionElements",
|
|
76
|
+
flowElement: "tFlowElement",
|
|
77
|
+
flowNode: "tFlowNode",
|
|
78
|
+
formalExpression: "tFormalExpression/expression",
|
|
79
|
+
gateway: "tGateway",
|
|
80
|
+
globalBusinessRuleTask: "tGlobalBusinessRuleTask/rootElement",
|
|
81
|
+
globalChoreographyTask: "tGlobalChoreographyTask/choreography",
|
|
82
|
+
globalConversation: "tGlobalConversation/collaboration",
|
|
83
|
+
globalManualTask: "tGlobalManualTask/rootElement",
|
|
84
|
+
globalScriptTask: "tGlobalScriptTask/rootElement",
|
|
85
|
+
globalTask: "tGlobalTask/rootElement",
|
|
86
|
+
globalUserTask: "tGlobalUserTask/rootElement",
|
|
87
|
+
group: "tGroup/artifact",
|
|
88
|
+
humanPerformer: "tHumanPerformer/performer",
|
|
89
|
+
implicitThrowEvent: "tImplicitThrowEvent/flowElement",
|
|
90
|
+
inclusiveGateway: "tInclusiveGateway/flowElement",
|
|
91
|
+
inputSet: "tInputSet",
|
|
92
|
+
interface: "tInterface/rootElement",
|
|
93
|
+
intermediateCatchEvent: "tIntermediateCatchEvent/flowElement",
|
|
94
|
+
intermediateThrowEvent: "tIntermediateThrowEvent/flowElement",
|
|
95
|
+
ioBinding: "tInputOutputBinding",
|
|
96
|
+
ioSpecification: "tInputOutputSpecification",
|
|
97
|
+
itemDefinition: "tItemDefinition/rootElement",
|
|
98
|
+
lane: "tLane",
|
|
99
|
+
laneSet: "tLaneSet",
|
|
100
|
+
linkEventDefinition: "tLinkEventDefinition/eventDefinition",
|
|
101
|
+
loopCharacteristics: "tLoopCharacteristics",
|
|
102
|
+
manualTask: "tManualTask/flowElement",
|
|
103
|
+
message: "tMessage/rootElement",
|
|
104
|
+
messageEventDefinition: "tMessageEventDefinition/eventDefinition",
|
|
105
|
+
messageFlow: "tMessageFlow",
|
|
106
|
+
messageFlowAssociation: "tMessageFlowAssociation",
|
|
107
|
+
monitoring: "tMonitoring",
|
|
108
|
+
multiInstanceLoopCharacteristics: "tMultiInstanceLoopCharacteristics/loopCharacteristics",
|
|
109
|
+
operation: "tOperation",
|
|
110
|
+
outputSet: "tOutputSet",
|
|
111
|
+
parallelGateway: "tParallelGateway/flowElement",
|
|
112
|
+
participant: "tParticipant",
|
|
113
|
+
participantAssociation: "tParticipantAssociation",
|
|
114
|
+
participantMultiplicity: "tParticipantMultiplicity",
|
|
115
|
+
partnerEntity: "tPartnerEntity/rootElement",
|
|
116
|
+
partnerRole: "tPartnerRole/rootElement",
|
|
117
|
+
performer: "tPerformer/resourceRole",
|
|
118
|
+
potentialOwner: "tPotentialOwner/performer",
|
|
119
|
+
process: "tProcess/rootElement",
|
|
120
|
+
property: "tProperty",
|
|
121
|
+
receiveTask: "tReceiveTask/flowElement",
|
|
122
|
+
relationship: "tRelationship",
|
|
123
|
+
rendering: "tRendering",
|
|
124
|
+
resource: "tResource/rootElement",
|
|
125
|
+
resourceAssignmentExpression: "tResourceAssignmentExpression",
|
|
126
|
+
resourceParameter: "tResourceParameter",
|
|
127
|
+
resourceParameterBinding: "tResourceParameterBinding",
|
|
128
|
+
resourceRole: "tResourceRole",
|
|
129
|
+
rootElement: "tRootElement",
|
|
130
|
+
scriptTask: "tScriptTask/flowElement",
|
|
131
|
+
script: "tScript",
|
|
132
|
+
sendTask: "tSendTask/flowElement",
|
|
133
|
+
sequenceFlow: "tSequenceFlow/flowElement",
|
|
134
|
+
serviceTask: "tServiceTask/flowElement",
|
|
135
|
+
signal: "tSignal/rootElement",
|
|
136
|
+
signalEventDefinition: "tSignalEventDefinition/eventDefinition",
|
|
137
|
+
standardLoopCharacteristics: "tStandardLoopCharacteristics/loopCharacteristics",
|
|
138
|
+
startEvent: "tStartEvent/flowElement",
|
|
139
|
+
subChoreography: "tSubChoreography/flowElement",
|
|
140
|
+
subConversation: "tSubConversation/conversationNode",
|
|
141
|
+
subProcess: "tSubProcess/flowElement",
|
|
142
|
+
task: "tTask/flowElement",
|
|
143
|
+
terminateEventDefinition: "tTerminateEventDefinition/eventDefinition",
|
|
144
|
+
textAnnotation: "tTextAnnotation/artifact",
|
|
145
|
+
text: "tText",
|
|
146
|
+
throwEvent: "tThrowEvent",
|
|
147
|
+
timerEventDefinition: "tTimerEventDefinition/eventDefinition",
|
|
148
|
+
transaction: "tTransaction/flowElement",
|
|
149
|
+
userTask: "tUserTask/flowElement",
|
|
150
|
+
definitions: "tDefinitions",
|
|
151
|
+
import: "tImport",
|
|
152
|
+
"bpmndi:BPMNDiagram": "bpmndi:BPMNDiagram",
|
|
153
|
+
"bpmndi:BPMNPlane": "bpmndi:BPMNPlane",
|
|
154
|
+
"bpmndi:BPMNLabelStyle": "bpmndi:BPMNLabelStyle",
|
|
155
|
+
"bpmndi:BPMNShape": "bpmndi:BPMNShape/di:DiagramElement",
|
|
156
|
+
"bpmndi:BPMNLabel": "bpmndi:BPMNLabel",
|
|
157
|
+
"bpmndi:BPMNEdge": "bpmndi:BPMNEdge/di:DiagramElement",
|
|
158
|
+
"di:DiagramElement": "di:DiagramElement",
|
|
159
|
+
"di:Diagram": "di:Diagram",
|
|
160
|
+
"di:Style": "di:Style",
|
|
161
|
+
"di:Node": "di:Node",
|
|
162
|
+
"di:Edge": "di:Edge",
|
|
163
|
+
"di:Shape": "di:Shape",
|
|
164
|
+
"di:Plane": "di:Plane",
|
|
165
|
+
"di:LabeledEdge": "di:LabeledEdge",
|
|
166
|
+
"di:Label": "di:Label",
|
|
167
|
+
"di:LabeledShape": "di:LabeledShape",
|
|
168
|
+
"dc:Font": "dc:Font",
|
|
169
|
+
"dc:Point": "dc:Point",
|
|
170
|
+
"dc:Bounds": "dc:Bounds",
|
|
171
|
+
};
|
|
172
|
+
export const XSD_TYPES = {
|
|
173
|
+
tActivity: "tFlowNode|ioSpecification?,property*,dataInputAssociation*,dataOutputAssociation*,resourceRole*,loopCharacteristics?|isForCompensation=boolean,startQuantity=integer,completionQuantity=integer,default=IDREF|!",
|
|
174
|
+
tAdHocSubProcess: "tSubProcess|completionCondition=tExpression?|cancelRemainingInstances=boolean,ordering=tAdHocOrdering|",
|
|
175
|
+
tArtifact: "tBaseElement|||!",
|
|
176
|
+
tAssignment: "tBaseElement|from=tExpression,to=tExpression||",
|
|
177
|
+
tAssociation: "tArtifact||sourceRef=QName!,targetRef=QName!,associationDirection=tAssociationDirection|",
|
|
178
|
+
tAuditing: "tBaseElement|||",
|
|
179
|
+
tBaseElement: "|documentation*,extensionElements?|id=ID|@!",
|
|
180
|
+
tBaseElementWithMixedContent: "|documentation*,extensionElements?|id=ID|@~!",
|
|
181
|
+
tBoundaryEvent: "tCatchEvent||cancelActivity=boolean,attachedToRef=QName!|",
|
|
182
|
+
tBusinessRuleTask: "tTask||implementation=tImplementation|",
|
|
183
|
+
tCallableElement: "tRootElement|supportedInterfaceRef=QName*,ioSpecification?,ioBinding*|name=string|",
|
|
184
|
+
tCallActivity: "tActivity||calledElement=string|",
|
|
185
|
+
tCallChoreography: "tChoreographyActivity|participantAssociation*|calledChoreographyRef=QName|",
|
|
186
|
+
tCallConversation: "tConversationNode|participantAssociation*|calledCollaborationRef=QName|",
|
|
187
|
+
tCancelEventDefinition: "tEventDefinition|||",
|
|
188
|
+
tCatchEvent: "tEvent|dataOutput*,dataOutputAssociation*,outputSet?,eventDefinition*,eventDefinitionRef=QName*|parallelMultiple=boolean|!",
|
|
189
|
+
tCategory: "tRootElement|categoryValue*|name=string|",
|
|
190
|
+
tCategoryValue: "tBaseElement||value=string|",
|
|
191
|
+
tChoreography: "tCollaboration|flowElement*||",
|
|
192
|
+
tChoreographyActivity: "tFlowNode|participantRef=QName{2,},correlationKey*|initiatingParticipantRef=QName!,loopType=tChoreographyLoopType|!",
|
|
193
|
+
tChoreographyTask: "tChoreographyActivity|messageFlowRef=QName{1,2}||",
|
|
194
|
+
tCollaboration: "tRootElement|participant*,messageFlow*,artifact*,conversationNode*,conversationAssociation*,participantAssociation*,messageFlowAssociation*,correlationKey*,choreographyRef=QName*,conversationLink*|name=string,isClosed=boolean|",
|
|
195
|
+
tCompensateEventDefinition: "tEventDefinition||waitForCompletion=boolean,activityRef=QName|",
|
|
196
|
+
tComplexBehaviorDefinition: "tBaseElement|condition=tFormalExpression,event=tImplicitThrowEvent?||",
|
|
197
|
+
tComplexGateway: "tGateway|activationCondition=tExpression?|default=IDREF|",
|
|
198
|
+
tConditionalEventDefinition: "tEventDefinition|condition=tExpression||",
|
|
199
|
+
tConversation: "tConversationNode|||",
|
|
200
|
+
tConversationAssociation: "tBaseElement||innerConversationNodeRef=QName!,outerConversationNodeRef=QName!|",
|
|
201
|
+
tConversationLink: "tBaseElement||name=string,sourceRef=QName!,targetRef=QName!|",
|
|
202
|
+
tConversationNode: "tBaseElement|participantRef=QName*,messageFlowRef=QName*,correlationKey*|name=string|!",
|
|
203
|
+
tCorrelationKey: "tBaseElement|correlationPropertyRef=QName*|name=string|",
|
|
204
|
+
tCorrelationProperty: "tRootElement|correlationPropertyRetrievalExpression+|name=string,type=QName|",
|
|
205
|
+
tCorrelationPropertyBinding: "tBaseElement|dataPath=tFormalExpression|correlationPropertyRef=QName!|",
|
|
206
|
+
tCorrelationPropertyRetrievalExpression: "tBaseElement|messagePath=tFormalExpression|messageRef=QName!|",
|
|
207
|
+
tCorrelationSubscription: "tBaseElement|correlationPropertyBinding*|correlationKeyRef=QName!|",
|
|
208
|
+
tDataAssociation: "tBaseElement|sourceRef=IDREF*,targetRef=IDREF,transformation=tFormalExpression?,assignment*||",
|
|
209
|
+
tDataInput: "tBaseElement|dataState?|name=string,itemSubjectRef=QName,isCollection=boolean|",
|
|
210
|
+
tDataInputAssociation: "tDataAssociation|||",
|
|
211
|
+
tDataObject: "tFlowElement|dataState?|itemSubjectRef=QName,isCollection=boolean|",
|
|
212
|
+
tDataObjectReference: "tFlowElement|dataState?|itemSubjectRef=QName,dataObjectRef=IDREF|",
|
|
213
|
+
tDataOutput: "tBaseElement|dataState?|name=string,itemSubjectRef=QName,isCollection=boolean|",
|
|
214
|
+
tDataOutputAssociation: "tDataAssociation|||",
|
|
215
|
+
tDataState: "tBaseElement||name=string|",
|
|
216
|
+
tDataStore: "tRootElement|dataState?|name=string,capacity=integer,isUnlimited=boolean,itemSubjectRef=QName|",
|
|
217
|
+
tDataStoreReference: "tFlowElement|dataState?|itemSubjectRef=QName,dataStoreRef=QName|",
|
|
218
|
+
tDocumentation: "|#any?|id=ID,textFormat=string|~",
|
|
219
|
+
tEndEvent: "tThrowEvent|||",
|
|
220
|
+
tEndPoint: "tRootElement|||",
|
|
221
|
+
tError: "tRootElement||name=string,errorCode=string,structureRef=QName|",
|
|
222
|
+
tErrorEventDefinition: "tEventDefinition||errorRef=QName|",
|
|
223
|
+
tEscalation: "tRootElement||name=string,escalationCode=string,structureRef=QName|",
|
|
224
|
+
tEscalationEventDefinition: "tEventDefinition||escalationRef=QName|",
|
|
225
|
+
tEvent: "tFlowNode|property*||!",
|
|
226
|
+
tEventBasedGateway: "tGateway||instantiate=boolean,eventGatewayType=tEventBasedGatewayType|",
|
|
227
|
+
tEventDefinition: "tRootElement|||!",
|
|
228
|
+
tExclusiveGateway: "tGateway||default=IDREF|",
|
|
229
|
+
tExpression: "tBaseElementWithMixedContent|||",
|
|
230
|
+
tExtension: "|documentation*|definition=QName,mustUnderstand=boolean|",
|
|
231
|
+
tExtensionElements: "|#other*||",
|
|
232
|
+
tFlowElement: "tBaseElement|auditing?,monitoring?,categoryValueRef=QName*|name=string|!",
|
|
233
|
+
tFlowNode: "tFlowElement|incoming=QName*,outgoing=QName*||!",
|
|
234
|
+
tFormalExpression: "tExpression||language=anyURI,evaluatesToTypeRef=QName|",
|
|
235
|
+
tGateway: "tFlowNode||gatewayDirection=tGatewayDirection|",
|
|
236
|
+
tGlobalBusinessRuleTask: "tGlobalTask||implementation=tImplementation|",
|
|
237
|
+
tGlobalChoreographyTask: "tChoreography||initiatingParticipantRef=QName|",
|
|
238
|
+
tGlobalConversation: "tCollaboration|||",
|
|
239
|
+
tGlobalManualTask: "tGlobalTask|||",
|
|
240
|
+
tGlobalScriptTask: "tGlobalTask|script?|scriptLanguage=anyURI|",
|
|
241
|
+
tGlobalTask: "tCallableElement|resourceRole*||",
|
|
242
|
+
tGlobalUserTask: "tGlobalTask|rendering*|implementation=tImplementation|",
|
|
243
|
+
tGroup: "tArtifact||categoryValueRef=QName|",
|
|
244
|
+
tHumanPerformer: "tPerformer|||",
|
|
245
|
+
tImplicitThrowEvent: "tThrowEvent|||",
|
|
246
|
+
tInclusiveGateway: "tGateway||default=IDREF|",
|
|
247
|
+
tInputSet: "tBaseElement|dataInputRefs=IDREF*,optionalInputRefs=IDREF*,whileExecutingInputRefs=IDREF*,outputSetRefs=IDREF*|name=string|",
|
|
248
|
+
tInterface: "tRootElement|operation+|name=string!,implementationRef=QName|",
|
|
249
|
+
tIntermediateCatchEvent: "tCatchEvent|||",
|
|
250
|
+
tIntermediateThrowEvent: "tThrowEvent|||",
|
|
251
|
+
tInputOutputBinding: "tBaseElement||operationRef=QName!,inputDataRef=IDREF!,outputDataRef=IDREF!|",
|
|
252
|
+
tInputOutputSpecification: "tBaseElement|dataInput*,dataOutput*,inputSet+,outputSet+||",
|
|
253
|
+
tItemDefinition: "tRootElement||structureRef=QName,isCollection=boolean,itemKind=tItemKind|",
|
|
254
|
+
tLane: "tBaseElement|partitionElement=tBaseElement?,flowNodeRef=IDREF*,childLaneSet=tLaneSet?|name=string,partitionElementRef=QName|",
|
|
255
|
+
tLaneSet: "tBaseElement|lane*|name=string|",
|
|
256
|
+
tLinkEventDefinition: "tEventDefinition|source=QName*,target=QName?|name=string!|",
|
|
257
|
+
tLoopCharacteristics: "tBaseElement|||!",
|
|
258
|
+
tManualTask: "tTask|||",
|
|
259
|
+
tMessage: "tRootElement||name=string,itemRef=QName|",
|
|
260
|
+
tMessageEventDefinition: "tEventDefinition|operationRef=QName?|messageRef=QName|",
|
|
261
|
+
tMessageFlow: "tBaseElement||name=string,sourceRef=QName!,targetRef=QName!,messageRef=QName|",
|
|
262
|
+
tMessageFlowAssociation: "tBaseElement||innerMessageFlowRef=QName!,outerMessageFlowRef=QName!|",
|
|
263
|
+
tMonitoring: "tBaseElement|||",
|
|
264
|
+
tMultiInstanceLoopCharacteristics: "tLoopCharacteristics|loopCardinality=tExpression?,loopDataInputRef=QName?,loopDataOutputRef=QName?,inputDataItem=tDataInput?,outputDataItem=tDataOutput?,complexBehaviorDefinition*,completionCondition=tExpression?|isSequential=boolean,behavior=tMultiInstanceFlowCondition,oneBehaviorEventRef=QName,noneBehaviorEventRef=QName|",
|
|
265
|
+
tOperation: "tBaseElement|inMessageRef=QName,outMessageRef=QName?,errorRef=QName*|name=string!,implementationRef=QName|",
|
|
266
|
+
tOutputSet: "tBaseElement|dataOutputRefs=IDREF*,optionalOutputRefs=IDREF*,whileExecutingOutputRefs=IDREF*,inputSetRefs=IDREF*|name=string|",
|
|
267
|
+
tParallelGateway: "tGateway|||",
|
|
268
|
+
tParticipant: "tBaseElement|interfaceRef=QName*,endPointRef=QName*,participantMultiplicity?|name=string,processRef=QName|",
|
|
269
|
+
tParticipantAssociation: "tBaseElement|innerParticipantRef=QName,outerParticipantRef=QName||",
|
|
270
|
+
tParticipantMultiplicity: "tBaseElement||minimum=int,maximum=int|",
|
|
271
|
+
tPartnerEntity: "tRootElement|participantRef=QName*|name=string|",
|
|
272
|
+
tPartnerRole: "tRootElement|participantRef=QName*|name=string|",
|
|
273
|
+
tPerformer: "tResourceRole|||",
|
|
274
|
+
tPotentialOwner: "tHumanPerformer|||",
|
|
275
|
+
tProcess: "tCallableElement|auditing?,monitoring?,property*,laneSet*,flowElement*,artifact*,resourceRole*,correlationSubscription*,supports=QName*|processType=tProcessType,isClosed=boolean,isExecutable=boolean,definitionalCollaborationRef=QName|",
|
|
276
|
+
tProperty: "tBaseElement|dataState?|name=string,itemSubjectRef=QName|",
|
|
277
|
+
tReceiveTask: "tTask||implementation=tImplementation,instantiate=boolean,messageRef=QName,operationRef=QName|",
|
|
278
|
+
tRelationship: "tBaseElement|source=QName+,target=QName+|type=string!,direction=tRelationshipDirection|",
|
|
279
|
+
tRendering: "tBaseElement|||",
|
|
280
|
+
tResource: "tRootElement|resourceParameter*|name=string!|",
|
|
281
|
+
tResourceAssignmentExpression: "tBaseElement|expression||",
|
|
282
|
+
tResourceParameter: "tBaseElement||name=string,type=QName,isRequired=boolean|",
|
|
283
|
+
tResourceParameterBinding: "tBaseElement|expression|parameterRef=QName!|",
|
|
284
|
+
tResourceRole: "tBaseElement|(resourceRef=QName|resourceParameterBinding*|resourceAssignmentExpression?)|name=string|",
|
|
285
|
+
tRootElement: "tBaseElement|||!",
|
|
286
|
+
tScriptTask: "tTask|script?|scriptFormat=string|",
|
|
287
|
+
tScript: "|#any?||~",
|
|
288
|
+
tSendTask: "tTask||implementation=tImplementation,messageRef=QName,operationRef=QName|",
|
|
289
|
+
tSequenceFlow: "tFlowElement|conditionExpression=tExpression?|sourceRef=IDREF!,targetRef=IDREF!,isImmediate=boolean|",
|
|
290
|
+
tServiceTask: "tTask||implementation=tImplementation,operationRef=QName|",
|
|
291
|
+
tSignal: "tRootElement||name=string,structureRef=QName|",
|
|
292
|
+
tSignalEventDefinition: "tEventDefinition||signalRef=QName|",
|
|
293
|
+
tStandardLoopCharacteristics: "tLoopCharacteristics|loopCondition=tExpression?|testBefore=boolean,loopMaximum=integer|",
|
|
294
|
+
tStartEvent: "tCatchEvent||isInterrupting=boolean|",
|
|
295
|
+
tSubChoreography: "tChoreographyActivity|flowElement*,artifact*||",
|
|
296
|
+
tSubConversation: "tConversationNode|conversationNode*||",
|
|
297
|
+
tSubProcess: "tActivity|laneSet*,flowElement*,artifact*|triggeredByEvent=boolean|",
|
|
298
|
+
tTask: "tActivity|||",
|
|
299
|
+
tTerminateEventDefinition: "tEventDefinition|||",
|
|
300
|
+
tTextAnnotation: "tArtifact|text?|textFormat=string|",
|
|
301
|
+
tText: "|#any?||~",
|
|
302
|
+
tThrowEvent: "tEvent|dataInput*,dataInputAssociation*,inputSet?,eventDefinition*,eventDefinitionRef=QName*||!",
|
|
303
|
+
tTimerEventDefinition: "tEventDefinition|(timeDate=tExpression?|timeDuration=tExpression?|timeCycle=tExpression?)||",
|
|
304
|
+
tTransaction: "tSubProcess||method=tTransactionMethod|",
|
|
305
|
+
tUserTask: "tTask|rendering*|implementation=tImplementation|",
|
|
306
|
+
tDefinitions: "|import*,extension*,rootElement*,bpmndi:BPMNDiagram*,relationship*|id=ID,name=string,targetNamespace=anyURI!,expressionLanguage=anyURI,typeLanguage=anyURI,exporter=string,exporterVersion=string|@",
|
|
307
|
+
tImport: "||namespace=anyURI!,location=string!,importType=anyURI!|",
|
|
308
|
+
"bpmndi:BPMNDiagram": "di:Diagram|bpmndi:BPMNPlane,bpmndi:BPMNLabelStyle*||",
|
|
309
|
+
"bpmndi:BPMNPlane": "di:Plane||bpmnElement=QName|",
|
|
310
|
+
"bpmndi:BPMNEdge": "di:LabeledEdge|bpmndi:BPMNLabel?|bpmnElement=QName,sourceElement=QName,targetElement=QName,messageVisibleKind=bpmndi:MessageVisibleKind|",
|
|
311
|
+
"bpmndi:BPMNShape": "di:LabeledShape|bpmndi:BPMNLabel?|bpmnElement=QName,isHorizontal=boolean,isExpanded=boolean,isMarkerVisible=boolean,isMessageVisible=boolean,participantBandKind=bpmndi:ParticipantBandKind,choreographyActivityShape=QName|",
|
|
312
|
+
"bpmndi:BPMNLabel": "di:Label||labelStyle=QName|",
|
|
313
|
+
"bpmndi:BPMNLabelStyle": "di:Style|dc:Font||",
|
|
314
|
+
"di:DiagramElement": "|di:extension=#ext?|id=ID|@!",
|
|
315
|
+
"di:Diagram": "||name=string,documentation=string,resolution=double,id=ID|!",
|
|
316
|
+
"di:Node": "di:DiagramElement|||!",
|
|
317
|
+
"di:Edge": "di:DiagramElement|di:waypoint=dc:Point{2,}||!",
|
|
318
|
+
"di:LabeledEdge": "di:Edge|||!",
|
|
319
|
+
"di:Shape": "di:Node|dc:Bounds||!",
|
|
320
|
+
"di:LabeledShape": "di:Shape|||!",
|
|
321
|
+
"di:Label": "di:Node|dc:Bounds?||!",
|
|
322
|
+
"di:Plane": "di:Node|di:DiagramElement*||!",
|
|
323
|
+
"di:Style": "||id=ID|!",
|
|
324
|
+
"dc:Font": "||name=string,size=double,isBold=boolean,isItalic=boolean,isUnderline=boolean,isStrikeThrough=boolean|",
|
|
325
|
+
"dc:Point": "||x=double!,y=double!|",
|
|
326
|
+
"dc:Bounds": "||x=double!,y=double!,width=double!,height=double!|",
|
|
327
|
+
};
|
|
328
|
+
export const XSD_ENUMS = {
|
|
329
|
+
tAdHocOrdering: ["Parallel", "Sequential"],
|
|
330
|
+
tAssociationDirection: ["None", "One", "Both"],
|
|
331
|
+
tChoreographyLoopType: ["None", "Standard", "MultiInstanceSequential", "MultiInstanceParallel"],
|
|
332
|
+
tEventBasedGatewayType: ["Exclusive", "Parallel"],
|
|
333
|
+
tGatewayDirection: ["Unspecified", "Converging", "Diverging", "Mixed"],
|
|
334
|
+
tImplementation: [],
|
|
335
|
+
tItemKind: ["Information", "Physical"],
|
|
336
|
+
tMultiInstanceFlowCondition: ["None", "One", "All", "Complex"],
|
|
337
|
+
tProcessType: ["None", "Public", "Private"],
|
|
338
|
+
tRelationshipDirection: ["None", "Forward", "Backward", "Both"],
|
|
339
|
+
tTransactionMethod: [],
|
|
340
|
+
"bpmndi:ParticipantBandKind": [
|
|
341
|
+
"top_initiating",
|
|
342
|
+
"middle_initiating",
|
|
343
|
+
"bottom_initiating",
|
|
344
|
+
"top_non_initiating",
|
|
345
|
+
"middle_non_initiating",
|
|
346
|
+
"bottom_non_initiating",
|
|
347
|
+
],
|
|
348
|
+
"bpmndi:MessageVisibleKind": ["initiating", "non_initiating"],
|
|
349
|
+
};
|
|
350
|
+
//# sourceMappingURL=xsd.js.map
|
|
@@ -8,7 +8,8 @@
|
|
|
8
8
|
* option reaches. This writes all of it onto an element that already exists.
|
|
9
9
|
*/
|
|
10
10
|
import type { BpmnDefinitions, BpmnFlowElement } from "../index.js";
|
|
11
|
-
import { type
|
|
11
|
+
import { type ApplyProblem } from "./apply.js";
|
|
12
|
+
import { type ApplyToModelOptions } from "./deployability.js";
|
|
12
13
|
import type { ElementTemplate } from "./template-types.js";
|
|
13
14
|
/** The one `elementType.eventDefinition` this toolkit writes. */
|
|
14
15
|
export declare const APPLIED_EVENT_DEFINITION = "bpmn:MessageEventDefinition";
|
|
@@ -58,6 +59,8 @@ export declare function messageRefOf(element: BpmnFlowElement): string | undefin
|
|
|
58
59
|
* @param values - Keyed as in {@link applyElementTemplate}; `name` sets the element's name.
|
|
59
60
|
* @param options - `omitDefaults` leaves out properties carrying only the template's default;
|
|
60
61
|
* re-applying replaces the extensions wholesale, so an earlier apply's default does not survive.
|
|
62
|
+
* Unless `validate: false`, the applied element is checked with Zeebe's deploy rules and each
|
|
63
|
+
* error is a `not-deployable` problem (the model is still returned, as for any other problem).
|
|
61
64
|
*/
|
|
62
|
-
export declare function applyTemplateToElement(definitions: BpmnDefinitions, elementId: string, template: ElementTemplate, values?: Record<string, string>, options?:
|
|
65
|
+
export declare function applyTemplateToElement(definitions: BpmnDefinitions, elementId: string, template: ElementTemplate, values?: Record<string, string>, options?: ApplyToModelOptions): ApplyToElementResult;
|
|
63
66
|
//# sourceMappingURL=apply-element.d.ts.map
|
|
@@ -9,6 +9,7 @@
|
|
|
9
9
|
*/
|
|
10
10
|
import { bpmnElementName, isZeebePlacementAllowed, retypeElement, sha256Hex, zeebeExtensionsToXmlElements, } from "../index.js";
|
|
11
11
|
import { resolveBindings, } from "./apply.js";
|
|
12
|
+
import { appliedDeployProblems } from "./deployability.js";
|
|
12
13
|
/** The one `elementType.eventDefinition` this toolkit writes. */
|
|
13
14
|
export const APPLIED_EVENT_DEFINITION = "bpmn:MessageEventDefinition";
|
|
14
15
|
/** Every flow element type, so a template's `elementType` is checked rather than cast. */
|
|
@@ -371,6 +372,8 @@ function ownedExtensions(declared, accum) {
|
|
|
371
372
|
* @param values - Keyed as in {@link applyElementTemplate}; `name` sets the element's name.
|
|
372
373
|
* @param options - `omitDefaults` leaves out properties carrying only the template's default;
|
|
373
374
|
* re-applying replaces the extensions wholesale, so an earlier apply's default does not survive.
|
|
375
|
+
* Unless `validate: false`, the applied element is checked with Zeebe's deploy rules and each
|
|
376
|
+
* error is a `not-deployable` problem (the model is still returned, as for any other problem).
|
|
374
377
|
*/
|
|
375
378
|
export function applyTemplateToElement(definitions, elementId, template, values = {}, options = {}) {
|
|
376
379
|
const refuse = (message) => ({
|
|
@@ -491,6 +494,9 @@ export function applyTemplateToElement(definitions, elementId, template, values
|
|
|
491
494
|
}
|
|
492
495
|
}
|
|
493
496
|
location.siblings[location.index] = element;
|
|
497
|
+
for (const problem of appliedDeployProblems(next, [elementId], options)) {
|
|
498
|
+
problems.push({ kind: "not-deployable", message: problem.message });
|
|
499
|
+
}
|
|
494
500
|
return { definitions: next, problems };
|
|
495
501
|
}
|
|
496
502
|
//# sourceMappingURL=apply-element.js.map
|
|
@@ -7,7 +7,7 @@
|
|
|
7
7
|
* misspelt key with the key the template meant.
|
|
8
8
|
*/
|
|
9
9
|
import type { BpmnDefinitions } from "../index.js";
|
|
10
|
-
import { type
|
|
10
|
+
import { type ApplyToModelOptions } from "./deployability.js";
|
|
11
11
|
import type { ElementTemplate } from "./template-types.js";
|
|
12
12
|
export interface TemplateApplication {
|
|
13
13
|
elementId: string;
|
|
@@ -42,11 +42,18 @@ export interface TemplateApplicationProblem {
|
|
|
42
42
|
*
|
|
43
43
|
* @param definitions - The model; not mutated.
|
|
44
44
|
* @param entries - Elements anywhere in the model, nested ones included.
|
|
45
|
+
* - **Deployability.** Unless `validate: false`, the applied elements are checked
|
|
46
|
+
* with Zeebe's deploy rules once all entries are applied, and each error is a
|
|
47
|
+
* problem naming its element (`Not deployable on Camunda <version>: ...`). The
|
|
48
|
+
* rest of the model is not checked, so an unfinished diagram reports only what
|
|
49
|
+
* the templates left undeployable.
|
|
50
|
+
*
|
|
45
51
|
* @param options - `omitDefaults: true` leaves out properties whose value would only be the
|
|
46
52
|
* template's default (a key the entry does not give, on a property that is neither Hidden nor
|
|
47
53
|
* required), so the element carries what the caller chose. Default `false`.
|
|
54
|
+
* `validate` (default `true`) and `camundaVersion` as above.
|
|
48
55
|
*/
|
|
49
|
-
export declare function applyTemplates(definitions: BpmnDefinitions, entries: TemplateApplication[], options?:
|
|
56
|
+
export declare function applyTemplates(definitions: BpmnDefinitions, entries: TemplateApplication[], options?: ApplyToModelOptions): {
|
|
50
57
|
definitions: BpmnDefinitions;
|
|
51
58
|
problems: TemplateApplicationProblem[];
|
|
52
59
|
};
|
|
@@ -11,6 +11,7 @@ import { applyTemplateToElement } from "./apply-element.js";
|
|
|
11
11
|
import { resolveValues } from "./apply.js";
|
|
12
12
|
import { templateIdForAlias } from "./cards.js";
|
|
13
13
|
import { getTemplate, propertyKey } from "./catalog.js";
|
|
14
|
+
import { appliedDeployProblems } from "./deployability.js";
|
|
14
15
|
function resolveTemplate(reference) {
|
|
15
16
|
const at = reference.lastIndexOf("@");
|
|
16
17
|
const name = at === -1 ? reference : reference.slice(0, at);
|
|
@@ -118,13 +119,23 @@ function unwrittenValues(template, elementId, values) {
|
|
|
118
119
|
*
|
|
119
120
|
* @param definitions - The model; not mutated.
|
|
120
121
|
* @param entries - Elements anywhere in the model, nested ones included.
|
|
122
|
+
* - **Deployability.** Unless `validate: false`, the applied elements are checked
|
|
123
|
+
* with Zeebe's deploy rules once all entries are applied, and each error is a
|
|
124
|
+
* problem naming its element (`Not deployable on Camunda <version>: ...`). The
|
|
125
|
+
* rest of the model is not checked, so an unfinished diagram reports only what
|
|
126
|
+
* the templates left undeployable.
|
|
127
|
+
*
|
|
121
128
|
* @param options - `omitDefaults: true` leaves out properties whose value would only be the
|
|
122
129
|
* template's default (a key the entry does not give, on a property that is neither Hidden nor
|
|
123
130
|
* required), so the element carries what the caller chose. Default `false`.
|
|
131
|
+
* `validate` (default `true`) and `camundaVersion` as above.
|
|
124
132
|
*/
|
|
125
133
|
export function applyTemplates(definitions, entries, options = {}) {
|
|
126
134
|
const problems = [];
|
|
127
135
|
let current = definitions;
|
|
136
|
+
const applied = [];
|
|
137
|
+
// One check at the end, not one per entry: a later entry can finish what an earlier one began.
|
|
138
|
+
const each = { ...options, validate: false };
|
|
128
139
|
for (const entry of entries) {
|
|
129
140
|
const { elementId } = entry;
|
|
130
141
|
let template;
|
|
@@ -140,7 +151,7 @@ export function applyTemplates(definitions, entries, options = {}) {
|
|
|
140
151
|
template = entry.template;
|
|
141
152
|
}
|
|
142
153
|
const values = Object.fromEntries(Object.entries(entry.values).map(([key, value]) => [key, String(value)]));
|
|
143
|
-
const result = applyTemplateToElement(current, elementId, template, values,
|
|
154
|
+
const result = applyTemplateToElement(current, elementId, template, values, each);
|
|
144
155
|
// A refusal returns the model it was given; its one problem says all there is.
|
|
145
156
|
const refused = result.definitions === current;
|
|
146
157
|
current = result.definitions;
|
|
@@ -157,9 +168,13 @@ export function applyTemplates(definitions, entries, options = {}) {
|
|
|
157
168
|
}
|
|
158
169
|
problems.push(reported);
|
|
159
170
|
}
|
|
160
|
-
if (!refused)
|
|
171
|
+
if (!refused) {
|
|
161
172
|
problems.push(...unwrittenValues(template, elementId, values));
|
|
173
|
+
if (!applied.includes(elementId))
|
|
174
|
+
applied.push(elementId);
|
|
175
|
+
}
|
|
162
176
|
}
|
|
177
|
+
problems.push(...appliedDeployProblems(current, applied, options));
|
|
163
178
|
return { definitions: current, problems };
|
|
164
179
|
}
|
|
165
180
|
//# sourceMappingURL=apply-many.js.map
|
|
@@ -11,9 +11,11 @@ export interface ApplyProblem {
|
|
|
11
11
|
* with no resolvable task type ("no-task-type"). Callers that specifically
|
|
12
12
|
* want "what's still required" (e.g. the deploy-lint connector check)
|
|
13
13
|
* must filter on `kind === "missing-required"` — an unknown key is not
|
|
14
|
-
* evidence that some other field is missing.
|
|
14
|
+
* evidence that some other field is missing. `"not-deployable"` is an error
|
|
15
|
+
* Zeebe would raise on deploy for the applied element (functions that write
|
|
16
|
+
* onto a model check it unless `validate: false`).
|
|
15
17
|
*/
|
|
16
|
-
kind?: "missing-required" | "unknown-key" | "invalid-feel" | "no-task-type";
|
|
18
|
+
kind?: "missing-required" | "unknown-key" | "invalid-feel" | "no-task-type" | "not-deployable";
|
|
17
19
|
}
|
|
18
20
|
/**
|
|
19
21
|
* The result of applying a connector template — exactly one of `serviceTask`,
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import type { BpmnDefinitions } from "../index.js";
|
|
2
|
+
import type { ApplyOptions } from "./apply.js";
|
|
3
|
+
/** Options of the template functions that write onto a model. */
|
|
4
|
+
export interface ApplyToModelOptions extends ApplyOptions {
|
|
5
|
+
/**
|
|
6
|
+
* Check the applied elements with Zeebe's deploy rules and report what Zeebe
|
|
7
|
+
* would reject as `not-deployable` problems (default `true`). Only the applied
|
|
8
|
+
* elements (and the message they reference) are checked, so applying a template
|
|
9
|
+
* to an unfinished diagram does not report the rest of it.
|
|
10
|
+
*/
|
|
11
|
+
validate?: boolean;
|
|
12
|
+
/** The Camunda 8 version to check for. Default: the model's `executionPlatformVersion`, else the newest. */
|
|
13
|
+
camundaVersion?: string;
|
|
14
|
+
}
|
|
15
|
+
/** One Zeebe deploy error on an applied element. */
|
|
16
|
+
export interface AppliedDeployProblem {
|
|
17
|
+
/** The applied element the error belongs to. */
|
|
18
|
+
elementId: string;
|
|
19
|
+
message: string;
|
|
20
|
+
}
|
|
21
|
+
/**
|
|
22
|
+
* Zeebe's deploy errors on the applied elements, one problem per error:
|
|
23
|
+
* `Not deployable on Camunda <version>: <id>: <zeebe message> (<rule>)`, the
|
|
24
|
+
* line `assertDeployable` writes for the same error.
|
|
25
|
+
*/
|
|
26
|
+
export declare function appliedDeployProblems(definitions: BpmnDefinitions, elementIds: readonly string[], options: ApplyToModelOptions): AppliedDeployProblem[];
|
|
27
|
+
//# sourceMappingURL=deployability.d.ts.map
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
import { serializeBpmn } from "../bpmn/bpmn-serializer.js";
|
|
2
|
+
import { normalizeCamundaVersion } from "../bpmn/camunda-compat.js";
|
|
3
|
+
import { findElement } from "../bpmn/utils.js";
|
|
4
|
+
import { validateDeployableXml } from "../bpmn/zeebe-validate/index.js";
|
|
5
|
+
import { ZEEBE_LATEST_VERSION } from "../generated/zeebe-rules.js";
|
|
6
|
+
import { messageRefOf } from "./apply-element.js";
|
|
7
|
+
/**
|
|
8
|
+
* Zeebe's deploy errors on the applied elements, one problem per error:
|
|
9
|
+
* `Not deployable on Camunda <version>: <id>: <zeebe message> (<rule>)`, the
|
|
10
|
+
* line `assertDeployable` writes for the same error.
|
|
11
|
+
*/
|
|
12
|
+
export function appliedDeployProblems(definitions, elementIds, options) {
|
|
13
|
+
if (options.validate === false || elementIds.length === 0)
|
|
14
|
+
return [];
|
|
15
|
+
const camundaVersion = options.camundaVersion ?? definitions.unknownAttributes["modeler:executionPlatformVersion"];
|
|
16
|
+
const version = normalizeCamundaVersion(camundaVersion) ?? ZEEBE_LATEST_VERSION;
|
|
17
|
+
// An error on the message an inbound template writes belongs to the element that uses it.
|
|
18
|
+
const owner = new Map();
|
|
19
|
+
for (const id of elementIds) {
|
|
20
|
+
owner.set(id, id);
|
|
21
|
+
const element = findElement(definitions, id);
|
|
22
|
+
const messageId = element === undefined ? undefined : messageRefOf(element);
|
|
23
|
+
if (messageId !== undefined && !owner.has(messageId))
|
|
24
|
+
owner.set(messageId, id);
|
|
25
|
+
}
|
|
26
|
+
const problems = [];
|
|
27
|
+
for (const finding of validateDeployableXml(serializeBpmn(definitions), {
|
|
28
|
+
camundaVersion: version,
|
|
29
|
+
})) {
|
|
30
|
+
const id = finding.elementIds[0];
|
|
31
|
+
const elementId = id === undefined ? undefined : owner.get(id);
|
|
32
|
+
if (finding.severity !== "error" || elementId === undefined)
|
|
33
|
+
continue;
|
|
34
|
+
problems.push({
|
|
35
|
+
elementId,
|
|
36
|
+
message: `Not deployable on Camunda ${version}: ${id}: ${finding.message} (${finding.id})`,
|
|
37
|
+
});
|
|
38
|
+
}
|
|
39
|
+
return problems;
|
|
40
|
+
}
|
|
41
|
+
//# sourceMappingURL=deployability.js.map
|
|
@@ -14,6 +14,7 @@ export { listConnectors, searchConnectors, getTemplate, propertyKey, registerEle
|
|
|
14
14
|
export type { ConnectorSummary, ConnectorInputSpec, ConnectorDirection } from "./catalog.js";
|
|
15
15
|
export { applyConnectorTemplate, applyElementTemplate } from "./apply.js";
|
|
16
16
|
export type { ApplyOptions, ApplyResult, ApplyProblem } from "./apply.js";
|
|
17
|
+
export type { ApplyToModelOptions } from "./deployability.js";
|
|
17
18
|
export { applyTemplateToElement } from "./apply-element.js";
|
|
18
19
|
export type { ApplyToElementResult } from "./apply-element.js";
|
|
19
20
|
export { applyTemplates } from "./apply-many.js";
|
|
@@ -45,6 +45,13 @@ export interface ConnectorLineOptions {
|
|
|
45
45
|
* operation needs; a call the index does not know becomes a question.
|
|
46
46
|
*/
|
|
47
47
|
apis?: readonly ApiService[];
|
|
48
|
+
/**
|
|
49
|
+
* Check the elements the lines configured with Zeebe's deploy rules once all
|
|
50
|
+
* lines are applied; each error is a problem on its line (default `true`).
|
|
51
|
+
*/
|
|
52
|
+
validate?: boolean;
|
|
53
|
+
/** The Camunda 8 version to check for. Default: the model's `executionPlatformVersion`, else the newest. */
|
|
54
|
+
camundaVersion?: string;
|
|
48
55
|
}
|
|
49
56
|
/**
|
|
50
57
|
* Whether a `with` line's alias names a connector, as the resolver reads it: exactly, by a
|
|
@@ -91,6 +98,9 @@ export interface AppliedConnectorLines {
|
|
|
91
98
|
*
|
|
92
99
|
* Pass `parseProcessText(text).connectors` with the expanded diagram, or the
|
|
93
100
|
* lines of a change script with the ids they resolve to.
|
|
101
|
+
*
|
|
102
|
+
* Unless `validate: false`, the configured elements are then checked with Zeebe's
|
|
103
|
+
* deploy rules; each error is a problem on the line that configured the element.
|
|
94
104
|
*/
|
|
95
105
|
export declare function applyConnectorLines(definitions: BpmnDefinitions, lines: ReadonlyArray<ConnectorLine & {
|
|
96
106
|
elementId: string;
|