forked from flowable/flowable-engine
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add support for handling custom input parameters for error start and …
…boundary events and for passing additional data in error end events
- Loading branch information
Showing
40 changed files
with
1,047 additions
and
45 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
42 changes: 42 additions & 0 deletions
42
...erter/src/test/java/org/flowable/editor/language/xml/BoundaryErrorEventConverterTest.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,42 @@ | ||
/* Licensed under the Apache License, Version 2.0 (the "License"); | ||
* you may not use this file except in compliance with the License. | ||
* You may obtain a copy of the License at | ||
* | ||
* http://www.apache.org/licenses/LICENSE-2.0 | ||
* | ||
* Unless required by applicable law or agreed to in writing, software | ||
* distributed under the License is distributed on an "AS IS" BASIS, | ||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
* See the License for the specific language governing permissions and | ||
* limitations under the License. | ||
*/ | ||
package org.flowable.editor.language.xml; | ||
|
||
import static org.assertj.core.api.Assertions.assertThat; | ||
import static org.assertj.core.api.Assertions.tuple; | ||
|
||
import org.flowable.bpmn.model.BoundaryEvent; | ||
import org.flowable.bpmn.model.BpmnModel; | ||
import org.flowable.bpmn.model.FlowElement; | ||
import org.flowable.bpmn.model.IOParameter; | ||
import org.flowable.editor.language.xml.util.BpmnXmlConverterTest; | ||
|
||
/** | ||
* @author Filip Hrisafov | ||
*/ | ||
class BoundaryErrorEventConverterTest { | ||
|
||
@BpmnXmlConverterTest("boundaryErrorEventWithInParameters.bpmn") | ||
void validateErrorBoundaryWithInParameters(BpmnModel model) { | ||
FlowElement flowElement = model.getFlowElement("theErrorBoundary"); | ||
assertThat(flowElement).isInstanceOfSatisfying(BoundaryEvent.class, event -> { | ||
assertThat(event.getInParameters()) | ||
.extracting(IOParameter::getTarget, IOParameter::getSource, IOParameter::getSourceExpression) | ||
.containsExactlyInAnyOrder( | ||
tuple("targetErrorVar", "sourceVar", null), | ||
tuple("targetErrorVarFromExpression", null, "${'test'}") | ||
); | ||
}); | ||
} | ||
|
||
} |
43 changes: 43 additions & 0 deletions
43
...-converter/src/test/java/org/flowable/editor/language/xml/EndErrorEventConverterTest.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,43 @@ | ||
/* Licensed under the Apache License, Version 2.0 (the "License"); | ||
* you may not use this file except in compliance with the License. | ||
* You may obtain a copy of the License at | ||
* | ||
* http://www.apache.org/licenses/LICENSE-2.0 | ||
* | ||
* Unless required by applicable law or agreed to in writing, software | ||
* distributed under the License is distributed on an "AS IS" BASIS, | ||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
* See the License for the specific language governing permissions and | ||
* limitations under the License. | ||
*/ | ||
package org.flowable.editor.language.xml; | ||
|
||
import static org.assertj.core.api.Assertions.assertThat; | ||
import static org.assertj.core.api.Assertions.tuple; | ||
|
||
import org.flowable.bpmn.model.BpmnModel; | ||
import org.flowable.bpmn.model.EndEvent; | ||
import org.flowable.bpmn.model.FlowElement; | ||
import org.flowable.bpmn.model.IOParameter; | ||
import org.flowable.bpmn.model.StartEvent; | ||
import org.flowable.editor.language.xml.util.BpmnXmlConverterTest; | ||
|
||
/** | ||
* @author Filip Hrisafov | ||
*/ | ||
class EndErrorEventConverterTest { | ||
|
||
@BpmnXmlConverterTest("endErrorEventWithOutParameters.bpmn") | ||
void validateStartErrorWithInParameters(BpmnModel model) { | ||
FlowElement flowElement = model.getFlowElement("theSubProcessEnd"); | ||
assertThat(flowElement).isInstanceOfSatisfying(EndEvent.class, event -> { | ||
assertThat(event.getOutParameters()) | ||
.extracting(IOParameter::getTarget, IOParameter::getSource, IOParameter::getSourceExpression) | ||
.containsExactlyInAnyOrder( | ||
tuple("targetErrorVar", "sourceVar", null), | ||
tuple("targetErrorVarFromExpression", null, "${'test'}") | ||
); | ||
}); | ||
} | ||
|
||
} |
43 changes: 43 additions & 0 deletions
43
...onverter/src/test/java/org/flowable/editor/language/xml/StartErrorEventConverterTest.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,43 @@ | ||
/* Licensed under the Apache License, Version 2.0 (the "License"); | ||
* you may not use this file except in compliance with the License. | ||
* You may obtain a copy of the License at | ||
* | ||
* http://www.apache.org/licenses/LICENSE-2.0 | ||
* | ||
* Unless required by applicable law or agreed to in writing, software | ||
* distributed under the License is distributed on an "AS IS" BASIS, | ||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
* See the License for the specific language governing permissions and | ||
* limitations under the License. | ||
*/ | ||
package org.flowable.editor.language.xml; | ||
|
||
import static org.assertj.core.api.Assertions.assertThat; | ||
import static org.assertj.core.api.Assertions.tuple; | ||
|
||
import org.flowable.bpmn.model.BoundaryEvent; | ||
import org.flowable.bpmn.model.BpmnModel; | ||
import org.flowable.bpmn.model.FlowElement; | ||
import org.flowable.bpmn.model.IOParameter; | ||
import org.flowable.bpmn.model.StartEvent; | ||
import org.flowable.editor.language.xml.util.BpmnXmlConverterTest; | ||
|
||
/** | ||
* @author Filip Hrisafov | ||
*/ | ||
class StartErrorEventConverterTest { | ||
|
||
@BpmnXmlConverterTest("startErrorEventWithInParameters.bpmn") | ||
void validateStartErrorWithInParameters(BpmnModel model) { | ||
FlowElement flowElement = model.getFlowElement("startErrorSubProcess"); | ||
assertThat(flowElement).isInstanceOfSatisfying(StartEvent.class, event -> { | ||
assertThat(event.getInParameters()) | ||
.extracting(IOParameter::getTarget, IOParameter::getSource, IOParameter::getSourceExpression) | ||
.containsExactlyInAnyOrder( | ||
tuple("targetErrorVar", "sourceVar", null), | ||
tuple("targetErrorVarFromExpression", null, "${'test'}") | ||
); | ||
}); | ||
} | ||
|
||
} |
22 changes: 22 additions & 0 deletions
22
modules/flowable-bpmn-converter/src/test/resources/boundaryErrorEventWithInParameters.bpmn
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
<?xml version="1.0" encoding="UTF-8" standalone="yes"?> | ||
<definitions xmlns="http://www.omg.org/spec/BPMN/20100524/MODEL" xmlns:flowable="http://flowable.org/bpmn" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" | ||
exporter="Yaoqiang BPMN Editor" exporterVersion="2.2.12 (GPLv3, Non-Commercial)" expressionLanguage="http://www.w3.org/1999/XPath" | ||
id="_1384552647085" name="" targetNamespace="http://sourceforge.net/bpmn/definitions/_1384552647085" | ||
typeLanguage="http://www.w3.org/2001/XMLSchema" | ||
xsi:schemaLocation="http://www.omg.org/spec/BPMN/20100524/MODEL http://bpmn.sourceforge.net/schemas/BPMN20.xsd"> | ||
<error id="errorOne" name="Error One" errorCode="errorOne"/> | ||
<process id="testProcess" isExecutable="true" name="Test Process"> | ||
<startEvent id="theStart"/> | ||
<sequenceFlow id="flow1" sourceRef="theStart" targetRef="theTask"/> | ||
<serviceTask id="theTask" flowable:expression="${true}"/> | ||
<sequenceFlow id="flow2" sourceRef="theTask" targetRef="theEnd"/> | ||
<boundaryEvent id="theErrorBoundary" attachedToRef="theTask"> | ||
<extensionElements> | ||
<flowable:in target="targetErrorVar" source="sourceVar"/> | ||
<flowable:in target="targetErrorVarFromExpression" sourceExpression="${'test'}"/> | ||
</extensionElements> | ||
<errorEventDefinition id="one" errorRef="errorOne"/> | ||
</boundaryEvent> | ||
<endEvent id="theEnd"/> | ||
</process> | ||
</definitions> |
30 changes: 30 additions & 0 deletions
30
modules/flowable-bpmn-converter/src/test/resources/endErrorEventWithOutParameters.bpmn
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
<?xml version="1.0" encoding="UTF-8" standalone="yes"?> | ||
<definitions xmlns="http://www.omg.org/spec/BPMN/20100524/MODEL" xmlns:flowable="http://flowable.org/bpmn" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" | ||
exporter="Yaoqiang BPMN Editor" exporterVersion="2.2.12 (GPLv3, Non-Commercial)" expressionLanguage="http://www.w3.org/1999/XPath" | ||
id="_1384552647085" name="" targetNamespace="http://sourceforge.net/bpmn/definitions/_1384552647085" | ||
typeLanguage="http://www.w3.org/2001/XMLSchema" | ||
xsi:schemaLocation="http://www.omg.org/spec/BPMN/20100524/MODEL http://bpmn.sourceforge.net/schemas/BPMN20.xsd"> | ||
<error id="errorOne" name="Error One" errorCode="errorOne"/> | ||
<process id="testProcess" isExecutable="true" name="Test Process"> | ||
<startEvent id="theStart"/> | ||
<sequenceFlow id="flow1" sourceRef="theStart" targetRef="theSubProcess"/> | ||
<subProcess id="theSubProcess"> | ||
<startEvent id="theSubProcessStart"/> | ||
<sequenceFlow id="subFlow1" sourceRef="theStart" targetRef="theTask"/> | ||
<serviceTask id="theTask" flowable:expression="${true}"/> | ||
<sequenceFlow id="subFlow2" sourceRef="theTask" targetRef="theSubProcessEnd"/> | ||
<endEvent id="theSubProcessEnd"> | ||
<extensionElements> | ||
<flowable:out target="targetErrorVar" source="sourceVar"/> | ||
<flowable:out target="targetErrorVarFromExpression" sourceExpression="${'test'}"/> | ||
</extensionElements> | ||
<errorEventDefinition errorRef="testError" /> | ||
</endEvent> | ||
</subProcess> | ||
<boundaryEvent id="theErrorBoundary" attachedToRef="theSubProcess"> | ||
<errorEventDefinition id="one" errorRef="errorOne"/> | ||
</boundaryEvent> | ||
<sequenceFlow id="flow2" sourceRef="theErrorBoundary" targetRef="theEnd"/> | ||
<endEvent id="theEnd"/> | ||
</process> | ||
</definitions> |
28 changes: 28 additions & 0 deletions
28
modules/flowable-bpmn-converter/src/test/resources/startErrorEventWithInParameters.bpmn
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
<?xml version="1.0" encoding="UTF-8" standalone="yes"?> | ||
<definitions xmlns="http://www.omg.org/spec/BPMN/20100524/MODEL" xmlns:flowable="http://flowable.org/bpmn" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" | ||
exporter="Yaoqiang BPMN Editor" exporterVersion="2.2.12 (GPLv3, Non-Commercial)" expressionLanguage="http://www.w3.org/1999/XPath" | ||
id="_1384552647085" name="" targetNamespace="http://sourceforge.net/bpmn/definitions/_1384552647085" | ||
typeLanguage="http://www.w3.org/2001/XMLSchema" | ||
xsi:schemaLocation="http://www.omg.org/spec/BPMN/20100524/MODEL http://bpmn.sourceforge.net/schemas/BPMN20.xsd"> | ||
<error id="errorOne" name="Error One" errorCode="errorOne"/> | ||
<process id="testProcess" isExecutable="true" name="Test Process"> | ||
<startEvent id="theStart"/> | ||
<sequenceFlow id="flow1" sourceRef="theStart" targetRef="theTask"/> | ||
<serviceTask id="theTask" flowable:expression="${true}"/> | ||
<sequenceFlow id="flow2" sourceRef="theTask" targetRef="theEnd"/> | ||
<boundaryEvent id="theErrorBoundary" attachedToRef="theTask"> | ||
<errorEventDefinition id="one" errorRef="errorOne"/> | ||
</boundaryEvent> | ||
<endEvent id="theEnd"/> | ||
|
||
<subProcess id="errorSubProcess" triggeredByEvent="true"> | ||
<startEvent id="startErrorSubProcess"> | ||
<extensionElements> | ||
<flowable:in target="targetErrorVar" source="sourceVar"/> | ||
<flowable:in target="targetErrorVarFromExpression" sourceExpression="${'test'}"/> | ||
</extensionElements> | ||
<errorEventDefinition/> | ||
</startEvent> | ||
</subProcess> | ||
</process> | ||
</definitions> |
Oops, something went wrong.