Skip to content

Commit a87f972

Browse files
Merge branch 'main' of github.com:flowable/flowable-engine
2 parents a0829b9 + fe9f046 commit a87f972

3 files changed

Lines changed: 13 additions & 2 deletions

File tree

modules/flowable-engine-common-api/src/main/java/org/flowable/common/engine/api/delegate/BusinessError.java

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,11 @@ protected BusinessError(String errorCode, String message) {
4545
setErrorCode(errorCode);
4646
}
4747

48+
protected BusinessError(String errorCode, String message, Throwable cause) {
49+
super(message, cause);
50+
setErrorCode(errorCode);
51+
}
52+
4853
protected void setErrorCode(String errorCode) {
4954
if (errorCode == null) {
5055
throw new FlowableIllegalArgumentException("Error code must not be null.");

modules/flowable-engine/src/main/java/org/flowable/engine/delegate/BpmnError.java

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,10 @@ public BpmnError(String errorCode, String message) {
4141
super(errorCode, message);
4242
}
4343

44+
public BpmnError(String errorCode, String message, Throwable cause) {
45+
super(errorCode, message, cause);
46+
}
47+
4448
@Override
4549
public void addAdditionalData(String name, Object value) {
4650
if (this.getAdditionalDataContainer() == null) {

modules/flowable-engine/src/main/java/org/flowable/engine/impl/bpmn/helper/ErrorPropagation.java

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -122,7 +122,8 @@ protected static void propagateError(BpmnErrorVariableContainer errorVariableCon
122122
Map<String, List<RuntimeInstanceStateChangeCallback>> callbacks = processEngineConfiguration.getProcessInstanceStateChangedCallbacks();
123123
if (callbacks != null && callbacks.containsKey(processInstance.getCallbackType())) {
124124
BpmnError bpmnError = new BpmnError(errorCode,
125-
"No catching boundary event found for error with errorCode '" + errorCode + "' in process, propagating to parent engine");
125+
"No catching boundary event found for error with errorCode '" + errorCode + "' in process, propagating to parent engine",
126+
errorVariableContainer.error);
126127
bpmnError.setAdditionalDataContainer(errorVariableContainer);
127128
CallbackData callbackData = new CallbackData(processInstance.getCallbackId(),
128129
processInstance.getCallbackType(), processInstance.getId(), null, null);
@@ -140,7 +141,8 @@ protected static void propagateError(BpmnErrorVariableContainer errorVariableCon
140141
}
141142

142143
BpmnError bpmnError = new BpmnError(errorCode,
143-
"No catching boundary event found for error with errorCode '" + errorCode + "', neither in same process nor in parent process");
144+
"No catching boundary event found for error with errorCode '" + errorCode + "', neither in same process nor in parent process",
145+
errorVariableContainer.error);
144146
bpmnError.setAdditionalDataContainer(errorVariableContainer);
145147
throw bpmnError;
146148
}

0 commit comments

Comments
 (0)