Arguments args(
d -> consumer.accept(catchThrowableOfType(clazz, () -> d.execute(Map.of()))));
}
+ private static void checkNotCompeteOuput(WorkflowInstance instance) {
+ JsonNode out = instance.outputAsJsonNode();
+ logger.debug("Output is {}", out);
+ assertThat(out).isInstanceOf(ArrayNode.class);
+ assertThat(out).hasSize(2);
+ ArrayNode array = (ArrayNode) out;
+ assertThat(array)
+ .containsExactlyInAnyOrder(
+ createObjectNode("callNurse", "patientId", "John", "room", 1),
+ createObjectNode("callDoctor", "patientId", "Smith", "room", 2));
+ }
+
+ private static JsonNode createObjectNode(
+ String parent, String key1, String value1, String key2, int value2) {
+ return JsonUtils.mapper()
+ .createObjectNode()
+ .set(parent, JsonUtils.mapper().createObjectNode().put(key1, value1).put(key2, value2));
+ }
+
private static void checkWorkflowException(WorkflowException ex) {
assertThat(ex.getWorflowError().type())
.isEqualTo("https://serverlessworkflow.io/errors/not-implemented");
diff --git a/impl/core/src/test/resources/fork-no-compete.yaml b/impl/core/src/test/resources/fork-no-compete.yaml
new file mode 100644
index 00000000..ee882f13
--- /dev/null
+++ b/impl/core/src/test/resources/fork-no-compete.yaml
@@ -0,0 +1,28 @@
+document:
+ dsl: '1.0.0-alpha5'
+ namespace: test
+ name: fork-example
+ version: '0.1.0'
+do:
+ - callSomeone:
+ fork:
+ compete: false
+ branches:
+ - callNurse:
+ do:
+ - waitForNurse:
+ wait:
+ milliseconds: 500
+ - nurseArrived:
+ set:
+ patientId: John
+ room: 1
+ - callDoctor:
+ do:
+ - waitForDoctor:
+ wait:
+ milliseconds: 499
+ - doctorArrived:
+ set:
+ patientId: Smith
+ room: 2
\ No newline at end of file
diff --git a/impl/core/src/test/resources/fork.yaml b/impl/core/src/test/resources/fork.yaml
new file mode 100644
index 00000000..e9f3e7a3
--- /dev/null
+++ b/impl/core/src/test/resources/fork.yaml
@@ -0,0 +1,18 @@
+document:
+ dsl: '1.0.0-alpha5'
+ namespace: test
+ name: fork-no-compete
+ version: '0.1.0'
+do:
+ - callSomeone:
+ fork:
+ compete: true
+ branches:
+ - callNurse:
+ set:
+ patientId: John
+ room: 1
+ - callDoctor:
+ set:
+ patientId: Smith
+ room: 2
\ No newline at end of file
pFad - Phonifier reborn
Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.
Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.
Alternative Proxies:
Alternative Proxy
pFad Proxy
pFad v3 Proxy
pFad v4 Proxy