Skip to content

Commit 1c5bfd1

Browse files
committed
Add support for BPMN Escalations and BPMN Errors
1 parent 8522ca7 commit 1c5bfd1

File tree

6 files changed

+325
-121
lines changed

6 files changed

+325
-121
lines changed

README.md

Lines changed: 36 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -117,14 +117,46 @@ Local Builder: Deploy Webapp and access a local builder at: `http://..../forms/b
117117
Hosted Builder: [https://formio.github.io/formio.js/app/builder](https://formio.github.io/formio.js/app/builder)
118118

119119

120-
### Submitting a Form as a BPMN Error
120+
## Trigger 'BPMN Errors'
121121

122-
Coming soon!
122+
Support is provided to trigger interrupting BPMN Errors:
123123

124+
Trigger a formio event with the name `bpmn-error` (typically with a button: set the button event to `bpmn-error`)
124125

125-
### Submitting a Form as a BPMN Escalation
126+
The default error code is `default`. To set a custom error code, create a variable in the formio submission with the key
127+
`_errorCode`. Typical use cases are to use a `text` component or a `hidden` component.
128+
129+
No error message is submitted by default. To set a custom error message, create a variable in the formio submission with the key
130+
`_errorMessage`. Typical use cases are to use a `text` component or a `hidden` component.
131+
132+
**The submission variable created through the bpmn-error cannot be validated using the formio server validator: this is a limitation in Camunda**
133+
134+
## Trigger 'BPMN Escalations'
135+
136+
Support is provided to trigger interrupting and non-interrupting BPMN Escalations. Note that Camunda's form API does not
137+
make a distinction between interrupting and non-interrupting escalation events and therefore some best practices are implemented:
138+
139+
The escalation code is `default`. To set a custom escalation code, create a variable in the formio submission with the key
140+
`_escalationCode`. Typical use cases are to use a `text` component or a `hidden` component.
141+
142+
**The submission variable created through the bpmn-escalation cannot be validated using the formio server validator: this is a limitation in Camunda**
143+
144+
### Interrupting BPMN Escalations
145+
146+
To trigger BPMN Escalation that is designed to be used with a interrupting BPMN Escalation boundary event:
147+
148+
Trigger a formio event with the name `bpmn-escalation` (typically with a button: set the button event to `bpmn-escalaton`)
149+
150+
### Non-Interrupting BPMN Escalations
151+
152+
To trigger BPMN Escalation that is designed to be used with a non-interrupting BPMN Escalation boundary event:
153+
154+
Trigger a formio event with the name `bpmn-escalation-noninterrupt` (typically with a button: set the button event to `bpmn-escalaton-noninterrupt`)
155+
156+
A non-interrupting escalation means the user task will remain in the task list, and the submission variable name will be given a suffix of `_escalation`.
157+
The suffix is used to ensure if/when the user task is normally completed, the submission variable created through the
158+
user task completion does not overwrite the submission variable created through escalation.
126159

127-
Coming soon!
128160

129161

130162
## Deploying your Forms

bpmn/MyStartForm.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -155,7 +155,7 @@
155155
{
156156
"type": "button",
157157
"label": "Submit",
158-
"key": "submit",
158+
"key": "submitForm",
159159
"disableOnInvalid": true,
160160
"input": true,
161161
"tableView": false

bpmn/MyUT1.json

Lines changed: 19 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -82,7 +82,7 @@
8282
"input": true
8383
},
8484
{
85-
"label": "Submit as Escalation",
85+
"label": "Submit as Escalation (event: bpmn-escalation)",
8686
"action": "event",
8787
"showValidations": true,
8888
"theme": "secondary",
@@ -91,6 +91,24 @@
9191
"type": "button",
9292
"event": "bpmn-escalation",
9393
"input": true
94+
},
95+
{
96+
"label": "Submit as Escalation (event: bpmn-escalation-noninterrupt)",
97+
"action": "event",
98+
"showValidations": true,
99+
"theme": "secondary",
100+
"tableView": false,
101+
"key": "bpmn-escalation-noninterrupt",
102+
"type": "button",
103+
"event": "bpmn-escalation-noninterrupt",
104+
"input": true
105+
},
106+
{
107+
"label": "_escalationCode",
108+
"tableView": true,
109+
"key": "_escalationCode",
110+
"type": "textfield",
111+
"input": true
94112
}
95113
]
96114
}

0 commit comments

Comments
 (0)