-
-
-
-
+ * * 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 io.serverlessworkflow.api.interfaces;
+package io.serverlessworkflow.annotations;
-public interface SwitchCondition {
+public interface OneOfValueProvider Provides utility methods to determine the format based on file name or path, and to access the
+ * corresponding {@link ObjectMapper} for serialization and deserialization.
+ */
+public enum WorkflowFormat {
+ /** JSON format for workflow definitions. */
+ JSON(ObjectMapperFactory.jsonMapper()),
+
+ /** YAML format for workflow definitions. */
+ YAML(ObjectMapperFactory.yamlMapper());
+
+ private final ObjectMapper mapper;
+
+ /**
+ * Determines the {@link WorkflowFormat} from a file path by inspecting its file extension.
+ *
+ * @param path the file path to inspect
+ * @return the corresponding {@link WorkflowFormat}
+ */
+ public static WorkflowFormat fromPath(Path path) {
+ return fromFileName(path.getFileName().toString());
+ }
+
+ /**
+ * Determines the {@link WorkflowFormat} from a file name by inspecting its extension. Returns
+ * {@code JSON} if the file name ends with ".json", otherwise returns {@code YAML}.
+ *
+ * @param fileName the file name to inspect
+ * @return the corresponding {@link WorkflowFormat}
+ */
+ public static WorkflowFormat fromFileName(String fileName) {
+ return fileName.endsWith(".json") ? JSON : YAML;
+ }
+
+ /**
+ * Constructs a {@link WorkflowFormat} with the specified {@link ObjectMapper}.
+ *
+ * @param mapper the object mapper for this format
+ */
+ private WorkflowFormat(ObjectMapper mapper) {
+ this.mapper = mapper;
+ }
+
+ /**
+ * Returns the {@link ObjectMapper} associated with this workflow format.
+ *
+ * @return the object mapper for this format
+ */
+ public ObjectMapper mapper() {
+ return mapper;
+ }
+}
diff --git a/api/src/main/java/io/serverlessworkflow/api/WorkflowReader.java b/api/src/main/java/io/serverlessworkflow/api/WorkflowReader.java
new file mode 100644
index 00000000..b4401af0
--- /dev/null
+++ b/api/src/main/java/io/serverlessworkflow/api/WorkflowReader.java
@@ -0,0 +1,228 @@
+/*
+ * Copyright 2020-Present The Serverless Workflow Specification Authors
+ *
+ * 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 io.serverlessworkflow.api;
+
+import io.serverlessworkflow.api.types.Workflow;
+import java.io.FileNotFoundException;
+import java.io.IOException;
+import java.io.InputStream;
+import java.io.Reader;
+import java.nio.file.Files;
+import java.nio.file.Path;
+
+/** Utility class for reading and parsing Serverless Workflow definitions from various sources. */
+public class WorkflowReader {
+
+ /**
+ * Reads a workflow from an {@link InputStream} using the specified format.
+ *
+ * @param input the input stream containing the workflow definition
+ * @param format the workflow format
+ * @return the parsed {@link Workflow}
+ * @throws IOException if an I/O error occurs
+ */
+ public static Workflow readWorkflow(InputStream input, WorkflowFormat format) throws IOException {
+ return defaultReader().read(input, format);
+ }
+
+ /**
+ * Reads a workflow from a {@link Reader} using the specified format.
+ *
+ * @param input the reader containing the workflow definition
+ * @param format the workflow format
+ * @return the parsed {@link Workflow}
+ * @throws IOException if an I/O error occurs
+ */
+ public static Workflow readWorkflow(Reader input, WorkflowFormat format) throws IOException {
+ return defaultReader().read(input, format);
+ }
+
+ /**
+ * Reads a workflow from a byte array using the specified format.
+ *
+ * @param input the byte array containing the workflow definition
+ * @param format the workflow format
+ * @return the parsed {@link Workflow}
+ * @throws IOException if an I/O error occurs
+ */
+ public static Workflow readWorkflow(byte[] input, WorkflowFormat format) throws IOException {
+ return defaultReader().read(input, format);
+ }
+
+ /**
+ * Reads a workflow from a file path, inferring the format from the file extension.
+ *
+ * @param path the path to the workflow file
+ * @return the parsed {@link Workflow}
+ * @throws IOException if an I/O error occurs
+ */
+ public static Workflow readWorkflow(Path path) throws IOException {
+ return readWorkflow(path, WorkflowFormat.fromPath(path), defaultReader());
+ }
+
+ /**
+ * Reads a workflow from a file path using the specified format.
+ *
+ * @param path the path to the workflow file
+ * @param format the workflow format
+ * @return the parsed {@link Workflow}
+ * @throws IOException if an I/O error occurs
+ */
+ public static Workflow readWorkflow(Path path, WorkflowFormat format) throws IOException {
+ return readWorkflow(path, format, defaultReader());
+ }
+
+ /**
+ * Reads a workflow from a string using the specified format.
+ *
+ * @param input the string containing the workflow definition
+ * @param format the workflow format
+ * @return the parsed {@link Workflow}
+ * @throws IOException if an I/O error occurs
+ */
+ public static Workflow readWorkflowFromString(String input, WorkflowFormat format)
+ throws IOException {
+ return defaultReader().read(input, format);
+ }
+
+ /**
+ * Reads a workflow from the classpath, inferring the format from the file name.
+ *
+ * @param classpath the classpath location of the workflow file
+ * @return the parsed {@link Workflow}
+ * @throws IOException if an I/O error occurs
+ */
+ public static Workflow readWorkflowFromClasspath(String classpath) throws IOException {
+ return readWorkflowFromClasspath(classpath, defaultReader());
+ }
+
+ /**
+ * Reads a workflow from the classpath using the specified class loader and format.
+ *
+ * @param classpath the classpath location of the workflow file
+ * @param cl the class loader to use
+ * @param format the workflow format
+ * @return the parsed {@link Workflow}
+ * @throws IOException if an I/O error occurs
+ */
+ public static Workflow readWorkflowFromClasspath(
+ String classpath, ClassLoader cl, WorkflowFormat format) throws IOException {
+ return readWorkflowFromClasspath(classpath, defaultReader());
+ }
+
+ /**
+ * Reads a workflow from a file path using a custom reader.
+ *
+ * @param path the path to the workflow file
+ * @param reader the custom {@link WorkflowReaderOperations}
+ * @return the parsed {@link Workflow}
+ * @throws IOException if an I/O error occurs
+ */
+ public static Workflow readWorkflow(Path path, WorkflowReaderOperations reader)
+ throws IOException {
+ return readWorkflow(path, WorkflowFormat.fromPath(path), reader);
+ }
+
+ /**
+ * Reads a workflow from a file path using the specified format and custom reader.
+ *
+ * @param path the path to the workflow file
+ * @param format the workflow format
+ * @param reader the custom {@link WorkflowReaderOperations}
+ * @return the parsed {@link Workflow}
+ * @throws IOException if an I/O error occurs
+ */
+ public static Workflow readWorkflow(
+ Path path, WorkflowFormat format, WorkflowReaderOperations reader) throws IOException {
+ return reader.read(Files.readAllBytes(path), format);
+ }
+
+ /**
+ * Reads a workflow from the classpath using a custom reader.
+ *
+ * @param classpath the classpath location of the workflow file
+ * @param reader the custom {@link WorkflowReaderOperations}
+ * @return the parsed {@link Workflow}
+ * @throws IOException if an I/O error occurs
+ */
+ public static Workflow readWorkflowFromClasspath(
+ String classpath, WorkflowReaderOperations reader) throws IOException {
+ return readWorkflowFromClasspath(
+ classpath,
+ Thread.currentThread().getContextClassLoader(),
+ WorkflowFormat.fromFileName(classpath),
+ reader);
+ }
+
+ /**
+ * Reads a workflow from the classpath using the specified class loader, format, and custom
+ * reader.
+ *
+ * @param classpath the classpath location of the workflow file
+ * @param cl the class loader to use
+ * @param format the workflow format
+ * @param reader the custom {@link WorkflowReaderOperations}
+ * @return the parsed {@link Workflow}
+ * @throws IOException if an I/O error occurs or the resource is not found
+ */
+ public static Workflow readWorkflowFromClasspath(
+ String classpath, ClassLoader cl, WorkflowFormat format, WorkflowReaderOperations reader)
+ throws IOException {
+ try (InputStream in = cl.getResourceAsStream(classpath)) {
+ if (in == null) {
+ throw new FileNotFoundException(classpath);
+ }
+ return reader.read(in, format);
+ }
+ }
+
+ /**
+ * Returns a {@link WorkflowReaderOperations} instance that performs no validation.
+ *
+ * @return a no-validation reader
+ */
+ public static WorkflowReaderOperations noValidation() {
+ return NoValidationHolder.instance;
+ }
+
+ /**
+ * Returns a {@link WorkflowReaderOperations} instance that performs validation.
+ *
+ * @return a validation reader
+ */
+ public static WorkflowReaderOperations validation() {
+ return ValidationHolder.instance;
+ }
+
+ private static class NoValidationHolder {
+ private static final WorkflowReaderOperations instance = new DirectReader();
+ }
+
+ private static class ValidationHolder {
+ private static final WorkflowReaderOperations instance = new ValidationReader();
+ }
+
+ /**
+ * Returns the default {@link WorkflowReaderOperations} instance (no validation).
+ *
+ * @return the default reader
+ */
+ private static WorkflowReaderOperations defaultReader() {
+ return NoValidationHolder.instance;
+ }
+
+ private WorkflowReader() {}
+}
diff --git a/api/src/main/java/io/serverlessworkflow/api/interfaces/WorkflowValidator.java b/api/src/main/java/io/serverlessworkflow/api/WorkflowReaderOperations.java
similarity index 55%
rename from api/src/main/java/io/serverlessworkflow/api/interfaces/WorkflowValidator.java
rename to api/src/main/java/io/serverlessworkflow/api/WorkflowReaderOperations.java
index 0e0e8955..7049aba0 100644
--- a/api/src/main/java/io/serverlessworkflow/api/interfaces/WorkflowValidator.java
+++ b/api/src/main/java/io/serverlessworkflow/api/WorkflowReaderOperations.java
@@ -1,37 +1,31 @@
/*
* Copyright 2020-Present The Serverless Workflow Specification Authors
- *
+ *
* 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 io.serverlessworkflow.api.interfaces;
-
-import io.serverlessworkflow.api.Workflow;
-import io.serverlessworkflow.api.validation.ValidationError;
-
-import java.util.List;
-
-public interface WorkflowValidator {
-
- WorkflowValidator setWorkflow(Workflow workflow);
+package io.serverlessworkflow.api;
- WorkflowValidator setSource(String source);
+import io.serverlessworkflow.api.types.Workflow;
+import java.io.IOException;
+import java.io.InputStream;
+import java.io.Reader;
- List This class provides static methods to serialize {@link Workflow} objects to files, streams,
+ * writers, byte arrays, or strings in either JSON or YAML format. The format is determined by the
+ * {@link WorkflowFormat} parameter or inferred from file extensions.
+ */
+public class WorkflowWriter {
+
+ /**
+ * Writes a {@link Workflow} to the given {@link OutputStream} in the specified format.
+ *
+ * @param output the output stream to write the workflow to
+ * @param workflow the workflow object to serialize
+ * @param format the format to use (JSON or YAML)
+ * @throws IOException if an I/O error occurs during writing
+ */
+ public static void writeWorkflow(OutputStream output, Workflow workflow, WorkflowFormat format)
+ throws IOException {
+ format.mapper().writeValue(output, workflow);
+ }
+
+ /**
+ * Writes a {@link Workflow} to the given {@link Writer} in the specified format.
+ *
+ * @param output the writer to write the workflow to
+ * @param workflow the workflow object to serialize
+ * @param format the format to use (JSON or YAML)
+ * @throws IOException if an I/O error occurs during writing
+ */
+ public static void writeWorkflow(Writer output, Workflow workflow, WorkflowFormat format)
+ throws IOException {
+ format.mapper().writeValue(output, workflow);
+ }
+
+ /**
+ * Writes a {@link Workflow} to the specified file path, inferring the format from the file
+ * extension.
+ *
+ * @param output the file path to write the workflow to
+ * @param workflow the workflow object to serialize
+ * @throws IOException if an I/O error occurs during writing
+ */
+ public static void writeWorkflow(Path output, Workflow workflow) throws IOException {
+ writeWorkflow(output, workflow, WorkflowFormat.fromPath(output));
+ }
+
+ /**
+ * Writes a {@link Workflow} to the specified file path in the given format.
+ *
+ * @param output the file path to write the workflow to
+ * @param workflow the workflow object to serialize
+ * @param format the format to use (JSON or YAML)
+ * @throws IOException if an I/O error occurs during writing
+ */
+ public static void writeWorkflow(Path output, Workflow workflow, WorkflowFormat format)
+ throws IOException {
+ try (OutputStream out = Files.newOutputStream(output)) {
+ writeWorkflow(out, workflow, format);
+ }
+ }
+
+ /**
+ * Serializes a {@link Workflow} to a string in the specified format.
+ *
+ * @param workflow the workflow object to serialize
+ * @param format the format to use (JSON or YAML)
+ * @return the serialized workflow as a string
+ * @throws IOException if an error occurs during serialization
+ */
+ public static String workflowAsString(Workflow workflow, WorkflowFormat format)
+ throws IOException {
+ return format.mapper().writeValueAsString(workflow);
+ }
+
+ /**
+ * Serializes a {@link Workflow} to a byte array in the specified format.
+ *
+ * @param workflow the workflow object to serialize
+ * @param format the format to use (JSON or YAML)
+ * @return the serialized workflow as a byte array
+ * @throws IOException if an error occurs during serialization
+ */
+ public static byte[] workflowAsBytes(Workflow workflow, WorkflowFormat format)
+ throws IOException {
+ try (ByteArrayOutputStream out = new ByteArrayOutputStream()) {
+ writeWorkflow(out, workflow, format);
+ return out.toByteArray();
+ }
+ }
+
+ // Private constructor to prevent instantiation
+ private WorkflowWriter() {}
+}
diff --git a/api/src/main/java/io/serverlessworkflow/api/deserializers/CronDeserializer.java b/api/src/main/java/io/serverlessworkflow/api/deserializers/CronDeserializer.java
deleted file mode 100644
index 18a81ff6..00000000
--- a/api/src/main/java/io/serverlessworkflow/api/deserializers/CronDeserializer.java
+++ /dev/null
@@ -1,72 +0,0 @@
-/*
- * Copyright 2020-Present The Serverless Workflow Specification Authors
- *
- * 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 io.serverlessworkflow.api.deserializers;
-
-import com.fasterxml.jackson.core.JsonParser;
-import com.fasterxml.jackson.databind.DeserializationContext;
-import com.fasterxml.jackson.databind.JsonNode;
-import com.fasterxml.jackson.databind.deser.std.StdDeserializer;
-import io.serverlessworkflow.api.cron.Cron;
-import io.serverlessworkflow.api.interfaces.WorkflowPropertySource;
-
-import java.io.IOException;
-
-public class CronDeserializer extends StdDeserializer
- * 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 io.serverlessworkflow.api.deserializers;
-
-import com.fasterxml.jackson.core.JsonParser;
-import com.fasterxml.jackson.databind.DeserializationContext;
-import com.fasterxml.jackson.databind.JsonNode;
-import com.fasterxml.jackson.databind.deser.std.StdDeserializer;
-import io.serverlessworkflow.api.datainputschema.DataInputSchema;
-import io.serverlessworkflow.api.interfaces.WorkflowPropertySource;
-import java.io.IOException;
-
-public class DataInputSchemaDeserializer extends StdDeserializer
- * 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 io.serverlessworkflow.api.deserializers;
-
-import com.fasterxml.jackson.core.JsonParser;
-import com.fasterxml.jackson.databind.DeserializationContext;
-import com.fasterxml.jackson.databind.deser.std.StdDeserializer;
-import io.serverlessworkflow.api.interfaces.WorkflowPropertySource;
-import io.serverlessworkflow.api.states.DefaultState;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-
-import java.io.IOException;
-
-public class DefaultStateTypeDeserializer extends StdDeserializer
- * 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 io.serverlessworkflow.api.deserializers;
-
-import com.fasterxml.jackson.core.JsonParser;
-import com.fasterxml.jackson.databind.DeserializationContext;
-import com.fasterxml.jackson.databind.JsonNode;
-import com.fasterxml.jackson.databind.ObjectMapper;
-import com.fasterxml.jackson.databind.deser.std.StdDeserializer;
-import io.serverlessworkflow.api.end.End;
-import io.serverlessworkflow.api.interfaces.WorkflowPropertySource;
-import io.serverlessworkflow.api.produce.ProduceEvent;
-import io.serverlessworkflow.api.start.Start;
-
-import java.io.IOException;
-import java.util.ArrayList;
-import java.util.List;
-
-public class EndDefinitionDeserializer extends StdDeserializer
- * 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 io.serverlessworkflow.api.deserializers;
-
-import com.fasterxml.jackson.core.JsonParser;
-import com.fasterxml.jackson.databind.DeserializationContext;
-import com.fasterxml.jackson.databind.deser.std.StdDeserializer;
-import io.serverlessworkflow.api.events.EventDefinition;
-import io.serverlessworkflow.api.interfaces.WorkflowPropertySource;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-
-import java.io.IOException;
-
-public class EventDefinitionKindDeserializer extends StdDeserializer
- * 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 io.serverlessworkflow.api.deserializers;
-
-import com.fasterxml.jackson.core.JsonParser;
-import com.fasterxml.jackson.databind.DeserializationContext;
-import com.fasterxml.jackson.databind.JsonNode;
-import com.fasterxml.jackson.databind.ObjectMapper;
-import com.fasterxml.jackson.databind.deser.std.StdDeserializer;
-import com.fasterxml.jackson.dataformat.yaml.YAMLFactory;
-import io.serverlessworkflow.api.events.EventDefinition;
-import io.serverlessworkflow.api.interfaces.WorkflowPropertySource;
-import io.serverlessworkflow.api.utils.Utils;
-import io.serverlessworkflow.api.workflow.Events;
-import org.json.JSONObject;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-
-import java.io.IOException;
-import java.util.ArrayList;
-import java.util.List;
-
-public class EventsDeserializer extends StdDeserializer
- * 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 io.serverlessworkflow.api.deserializers;
-
-import com.fasterxml.jackson.core.JsonParser;
-import com.fasterxml.jackson.databind.DeserializationContext;
-import com.fasterxml.jackson.databind.JsonNode;
-import com.fasterxml.jackson.databind.ObjectMapper;
-import com.fasterxml.jackson.databind.deser.std.StdDeserializer;
-import io.serverlessworkflow.api.interfaces.Extension;
-import io.serverlessworkflow.api.interfaces.WorkflowPropertySource;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-
-import java.io.IOException;
-import java.util.HashMap;
-import java.util.Map;
-
-public class ExtensionDeserializer extends StdDeserializer
- * 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 io.serverlessworkflow.api.deserializers;
-
-import com.fasterxml.jackson.core.JsonParser;
-import com.fasterxml.jackson.databind.DeserializationContext;
-import com.fasterxml.jackson.databind.deser.std.StdDeserializer;
-import io.serverlessworkflow.api.functions.FunctionDefinition;
-import io.serverlessworkflow.api.interfaces.WorkflowPropertySource;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-
-import java.io.IOException;
-
-public class FunctionDefinitionTypeDeserializer extends StdDeserializer
- * 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 io.serverlessworkflow.api.deserializers;
-
-import com.fasterxml.jackson.core.JsonParser;
-import com.fasterxml.jackson.databind.DeserializationContext;
-import com.fasterxml.jackson.databind.JsonNode;
-import com.fasterxml.jackson.databind.ObjectMapper;
-import com.fasterxml.jackson.databind.deser.std.StdDeserializer;
-import io.serverlessworkflow.api.functions.FunctionRef;
-import io.serverlessworkflow.api.interfaces.WorkflowPropertySource;
-
-import java.io.IOException;
-
-public class FunctionRefDeserializer extends StdDeserializer
- * 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 io.serverlessworkflow.api.deserializers;
-
-import com.fasterxml.jackson.core.JsonParser;
-import com.fasterxml.jackson.databind.DeserializationContext;
-import com.fasterxml.jackson.databind.JsonNode;
-import com.fasterxml.jackson.databind.ObjectMapper;
-import com.fasterxml.jackson.databind.deser.std.StdDeserializer;
-import com.fasterxml.jackson.dataformat.yaml.YAMLFactory;
-import io.serverlessworkflow.api.functions.FunctionDefinition;
-import io.serverlessworkflow.api.interfaces.WorkflowPropertySource;
-import io.serverlessworkflow.api.utils.Utils;
-import io.serverlessworkflow.api.workflow.Functions;
-import org.json.JSONObject;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-
-import java.io.IOException;
-import java.util.ArrayList;
-import java.util.List;
-
-public class FunctionsDeserializer extends StdDeserializer
- * 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 io.serverlessworkflow.api.deserializers;
-
-import com.fasterxml.jackson.core.JsonParser;
-import com.fasterxml.jackson.databind.DeserializationContext;
-import com.fasterxml.jackson.databind.deser.std.StdDeserializer;
-import io.serverlessworkflow.api.events.OnEvents;
-import io.serverlessworkflow.api.interfaces.WorkflowPropertySource;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-
-import java.io.IOException;
-
-public class OnEventsActionModeDeserializer extends StdDeserializer
- * 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 io.serverlessworkflow.api.deserializers;
-
-import com.fasterxml.jackson.core.JsonParser;
-import com.fasterxml.jackson.databind.DeserializationContext;
-import com.fasterxml.jackson.databind.deser.std.StdDeserializer;
-import io.serverlessworkflow.api.interfaces.WorkflowPropertySource;
-import io.serverlessworkflow.api.states.OperationState;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-
-import java.io.IOException;
-
-public class OperationStateActionModeDeserializer extends StdDeserializer
- * 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 io.serverlessworkflow.api.deserializers;
-
-import com.fasterxml.jackson.core.JsonParser;
-import com.fasterxml.jackson.databind.DeserializationContext;
-import com.fasterxml.jackson.databind.deser.std.StdDeserializer;
-import io.serverlessworkflow.api.interfaces.WorkflowPropertySource;
-import io.serverlessworkflow.api.states.ParallelState;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-
-import java.io.IOException;
-
-public class ParallelStateCompletionTypeDeserializer extends StdDeserializer
- * 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 io.serverlessworkflow.api.deserializers;
-
-import com.fasterxml.jackson.core.JsonParser;
-import com.fasterxml.jackson.databind.DeserializationContext;
-import com.fasterxml.jackson.databind.JsonNode;
-import com.fasterxml.jackson.databind.ObjectMapper;
-import com.fasterxml.jackson.databind.deser.std.StdDeserializer;
-import com.fasterxml.jackson.dataformat.yaml.YAMLFactory;
-import io.serverlessworkflow.api.interfaces.WorkflowPropertySource;
-import io.serverlessworkflow.api.retry.RetryDefinition;
-import io.serverlessworkflow.api.utils.Utils;
-import io.serverlessworkflow.api.workflow.Retries;
-import org.json.JSONObject;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-
-import java.io.IOException;
-import java.util.ArrayList;
-import java.util.List;
-
-public class RetriesDeserializer extends StdDeserializer
- * 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 io.serverlessworkflow.api.deserializers;
-
-import com.fasterxml.jackson.core.JsonParser;
-import com.fasterxml.jackson.databind.DeserializationContext;
-import com.fasterxml.jackson.databind.JsonNode;
-import com.fasterxml.jackson.databind.ObjectMapper;
-import com.fasterxml.jackson.databind.deser.std.StdDeserializer;
-import io.serverlessworkflow.api.cron.Cron;
-import io.serverlessworkflow.api.interfaces.WorkflowPropertySource;
-import io.serverlessworkflow.api.schedule.Schedule;
-
-import java.io.IOException;
-
-public class ScheduleDeserializer extends StdDeserializer
- * 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 io.serverlessworkflow.api.deserializers;
-
-import com.fasterxml.jackson.core.JsonParser;
-import com.fasterxml.jackson.databind.DeserializationContext;
-import com.fasterxml.jackson.databind.JsonNode;
-import com.fasterxml.jackson.databind.ObjectMapper;
-import com.fasterxml.jackson.databind.deser.std.StdDeserializer;
-import io.serverlessworkflow.api.interfaces.WorkflowPropertySource;
-import io.serverlessworkflow.api.schedule.Schedule;
-import io.serverlessworkflow.api.start.Start;
-
-import java.io.IOException;
-
-public class StartDefinitionDeserializer extends StdDeserializer
- * 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 io.serverlessworkflow.api.deserializers;
-
-import com.fasterxml.jackson.core.JsonParser;
-import com.fasterxml.jackson.databind.DeserializationContext;
-import com.fasterxml.jackson.databind.JsonNode;
-import com.fasterxml.jackson.databind.ObjectMapper;
-import com.fasterxml.jackson.databind.deser.std.StdDeserializer;
-import io.serverlessworkflow.api.interfaces.State;
-import io.serverlessworkflow.api.interfaces.WorkflowPropertySource;
-import io.serverlessworkflow.api.states.*;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-
-import java.io.IOException;
-
-public class StateDeserializer extends StdDeserializer
- * 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 io.serverlessworkflow.api.deserializers;
-
-import com.fasterxml.jackson.core.JsonParser;
-import com.fasterxml.jackson.databind.DeserializationContext;
-import com.fasterxml.jackson.databind.deser.std.StdDeserializer;
-import io.serverlessworkflow.api.interfaces.WorkflowPropertySource;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-
-import java.io.IOException;
-
-public class StringValueDeserializer extends StdDeserializer
- * 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 io.serverlessworkflow.api.deserializers;
-
-import com.fasterxml.jackson.core.JsonParser;
-import com.fasterxml.jackson.databind.DeserializationContext;
-import com.fasterxml.jackson.databind.JsonNode;
-import com.fasterxml.jackson.databind.ObjectMapper;
-import com.fasterxml.jackson.databind.deser.std.StdDeserializer;
-import io.serverlessworkflow.api.interfaces.WorkflowPropertySource;
-import io.serverlessworkflow.api.produce.ProduceEvent;
-import io.serverlessworkflow.api.transitions.Transition;
-
-import java.io.IOException;
-import java.util.ArrayList;
-import java.util.Arrays;
-
-public class TransitionDeserializer extends StdDeserializer
- * 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 io.serverlessworkflow.api.interfaces;
-
-import io.serverlessworkflow.api.end.End;
-import io.serverlessworkflow.api.error.Error;
-import io.serverlessworkflow.api.filters.StateDataFilter;
-import io.serverlessworkflow.api.start.Start;
-import io.serverlessworkflow.api.states.DefaultState.Type;
-import io.serverlessworkflow.api.transitions.Transition;
-
-import java.util.List;
-import java.util.Map;
-
-public interface State {
-
- String getId();
-
- String getName();
-
- Type getType();
-
- End getEnd();
-
- StateDataFilter getStateDataFilter();
-
- Transition getTransition();
-
- List
- * 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 io.serverlessworkflow.api.mapper;
-
-import com.fasterxml.jackson.core.JsonFactory;
-import com.fasterxml.jackson.databind.ObjectMapper;
-import com.fasterxml.jackson.databind.SerializationFeature;
-import io.serverlessworkflow.api.interfaces.WorkflowPropertySource;
-
-public class BaseObjectMapper extends ObjectMapper {
-
- private WorkflowModule workflowModule;
-
- public BaseObjectMapper(JsonFactory factory,
- WorkflowPropertySource workflowPropertySource) {
- super(factory);
-
- workflowModule = new WorkflowModule(workflowPropertySource);
-
- configure(SerializationFeature.INDENT_OUTPUT,
- true);
- registerModule(workflowModule);
- }
-
- public WorkflowModule getWorkflowModule() {
- return workflowModule;
- }
-}
\ No newline at end of file
diff --git a/api/src/main/java/io/serverlessworkflow/api/mapper/WorkflowModule.java b/api/src/main/java/io/serverlessworkflow/api/mapper/WorkflowModule.java
deleted file mode 100644
index 5d1c64bb..00000000
--- a/api/src/main/java/io/serverlessworkflow/api/mapper/WorkflowModule.java
+++ /dev/null
@@ -1,117 +0,0 @@
-/*
- * Copyright 2020-Present The Serverless Workflow Specification Authors
- *
- * 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 io.serverlessworkflow.api.mapper;
-
-import com.fasterxml.jackson.databind.module.SimpleModule;
-import io.serverlessworkflow.api.cron.Cron;
-import io.serverlessworkflow.api.datainputschema.DataInputSchema;
-import io.serverlessworkflow.api.deserializers.*;
-import io.serverlessworkflow.api.end.End;
-import io.serverlessworkflow.api.events.EventDefinition;
-import io.serverlessworkflow.api.events.OnEvents;
-import io.serverlessworkflow.api.functions.FunctionDefinition;
-import io.serverlessworkflow.api.functions.FunctionRef;
-import io.serverlessworkflow.api.interfaces.Extension;
-import io.serverlessworkflow.api.interfaces.State;
-import io.serverlessworkflow.api.interfaces.WorkflowPropertySource;
-import io.serverlessworkflow.api.schedule.Schedule;
-import io.serverlessworkflow.api.serializers.*;
-import io.serverlessworkflow.api.start.Start;
-import io.serverlessworkflow.api.states.DefaultState;
-import io.serverlessworkflow.api.states.OperationState;
-import io.serverlessworkflow.api.states.ParallelState;
-import io.serverlessworkflow.api.transitions.Transition;
-import io.serverlessworkflow.api.workflow.Events;
-import io.serverlessworkflow.api.workflow.Functions;
-import io.serverlessworkflow.api.workflow.Retries;
-
-public class WorkflowModule extends SimpleModule {
-
- private static final long serialVersionUID = 510l;
-
- private WorkflowPropertySource workflowPropertySource;
- private ExtensionSerializer extensionSerializer;
- private ExtensionDeserializer extensionDeserializer;
-
- public WorkflowModule() {
- this(null);
- }
-
- public WorkflowModule(WorkflowPropertySource workflowPropertySource) {
- super("workflow-module");
- this.workflowPropertySource = workflowPropertySource;
- extensionSerializer = new ExtensionSerializer();
- extensionDeserializer = new ExtensionDeserializer(workflowPropertySource);
- addDefaultSerializers();
- addDefaultDeserializers();
- }
-
- private void addDefaultSerializers() {
- addSerializer(new WorkflowSerializer());
- addSerializer(new EventStateSerializer());
- addSerializer(new DelayStateSerializer());
- addSerializer(new OperationStateSerializer());
- addSerializer(new ParallelStateSerializer());
- addSerializer(new SwitchStateSerializer());
- addSerializer(new SubflowStateSerializer());
- addSerializer(new InjectStateSerializer());
- addSerializer(new ForEachStateSerializer());
- addSerializer(new CallbackStateSerializer());
- addSerializer(new StartDefinitionSerializer());
- addSerializer(new EndDefinitionSerializer());
- addSerializer(new TransitionSerializer());
- addSerializer(new FunctionRefSerializer());
- addSerializer(new CronSerializer());
- addSerializer(new ScheduleSerializer());
- addSerializer(extensionSerializer);
- }
-
- private void addDefaultDeserializers() {
- addDeserializer(State.class,
- new StateDeserializer(workflowPropertySource));
- addDeserializer(String.class,
- new StringValueDeserializer(workflowPropertySource));
- addDeserializer(OnEvents.ActionMode.class,
- new OnEventsActionModeDeserializer(workflowPropertySource));
- addDeserializer(OperationState.ActionMode.class,
- new OperationStateActionModeDeserializer(workflowPropertySource));
- addDeserializer(DefaultState.Type.class,
- new DefaultStateTypeDeserializer(workflowPropertySource));
- addDeserializer(EventDefinition.Kind.class, new EventDefinitionKindDeserializer(workflowPropertySource));
- addDeserializer(ParallelState.CompletionType.class, new ParallelStateCompletionTypeDeserializer(workflowPropertySource));
- addDeserializer(Retries.class, new RetriesDeserializer(workflowPropertySource));
- addDeserializer(Functions.class, new FunctionsDeserializer(workflowPropertySource));
- addDeserializer(Events.class, new EventsDeserializer(workflowPropertySource));
- addDeserializer(Start.class, new StartDefinitionDeserializer(workflowPropertySource));
- addDeserializer(End.class, new EndDefinitionDeserializer(workflowPropertySource));
- addDeserializer(Extension.class, extensionDeserializer);
- addDeserializer(FunctionDefinition.Type.class, new FunctionDefinitionTypeDeserializer(workflowPropertySource));
- addDeserializer(Transition.class, new TransitionDeserializer(workflowPropertySource));
- addDeserializer(FunctionRef.class, new FunctionRefDeserializer(workflowPropertySource));
- addDeserializer(Cron.class, new CronDeserializer(workflowPropertySource));
- addDeserializer(Schedule.class, new ScheduleDeserializer(workflowPropertySource));
- addDeserializer(DataInputSchema.class, new DataInputSchemaDeserializer(workflowPropertySource));
- }
-
- public ExtensionSerializer getExtensionSerializer() {
- return extensionSerializer;
- }
-
- public ExtensionDeserializer getExtensionDeserializer() {
- return extensionDeserializer;
- }
-}
\ No newline at end of file
diff --git a/api/src/main/java/io/serverlessworkflow/api/schemaclient/ResourceSchemaClient.java b/api/src/main/java/io/serverlessworkflow/api/schemaclient/ResourceSchemaClient.java
deleted file mode 100644
index cb5510c7..00000000
--- a/api/src/main/java/io/serverlessworkflow/api/schemaclient/ResourceSchemaClient.java
+++ /dev/null
@@ -1,40 +0,0 @@
-/*
- * Copyright 2020-Present The Serverless Workflow Specification Authors
- *
- * 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 io.serverlessworkflow.api.schemaclient;
-
-import org.everit.json.schema.loader.SchemaClient;
-
-import java.io.InputStream;
-import java.util.Objects;
-
-public class ResourceSchemaClient implements SchemaClient {
-
- @SuppressWarnings("unused")
- private final SchemaClient fallbackClient;
- private final String baseResourcePath = "/schema/";
-
- public ResourceSchemaClient(SchemaClient fallbackClient) {
- this.fallbackClient = Objects.requireNonNull(fallbackClient,
- "fallbackClient cannot be null");
- }
-
- @Override
- public InputStream get(String path) {
- path = path.substring("https://wg-serverless.org/".length());
- return this.getClass().getResourceAsStream(baseResourcePath + path);
- }
-}
diff --git a/api/src/main/java/io/serverlessworkflow/api/serializers/CallbackStateSerializer.java b/api/src/main/java/io/serverlessworkflow/api/serializers/CallbackStateSerializer.java
deleted file mode 100644
index 15b1f67a..00000000
--- a/api/src/main/java/io/serverlessworkflow/api/serializers/CallbackStateSerializer.java
+++ /dev/null
@@ -1,53 +0,0 @@
-/*
- * Copyright 2020-Present The Serverless Workflow Specification Authors
- *
- * 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 io.serverlessworkflow.api.serializers;
-
-import com.fasterxml.jackson.core.JsonGenerator;
-import com.fasterxml.jackson.databind.SerializerProvider;
-import com.fasterxml.jackson.databind.ser.BeanSerializerFactory;
-import com.fasterxml.jackson.databind.ser.std.StdSerializer;
-import com.fasterxml.jackson.databind.type.TypeFactory;
-import io.serverlessworkflow.api.states.CallbackState;
-import io.serverlessworkflow.api.states.DefaultState;
-
-import java.io.IOException;
-
-public class CallbackStateSerializer extends StdSerializer
- * 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 io.serverlessworkflow.api.serializers;
-
-import com.fasterxml.jackson.core.JsonGenerator;
-import com.fasterxml.jackson.databind.SerializerProvider;
-import com.fasterxml.jackson.databind.ser.std.StdSerializer;
-import io.serverlessworkflow.api.cron.Cron;
-
-import java.io.IOException;
-
-public class CronSerializer extends StdSerializer
- * 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 io.serverlessworkflow.api.serializers;
-
-import com.fasterxml.jackson.core.JsonGenerator;
-import com.fasterxml.jackson.databind.SerializerProvider;
-import com.fasterxml.jackson.databind.ser.BeanSerializerFactory;
-import com.fasterxml.jackson.databind.ser.std.StdSerializer;
-import com.fasterxml.jackson.databind.type.TypeFactory;
-import io.serverlessworkflow.api.states.DefaultState;
-import io.serverlessworkflow.api.states.DelayState;
-
-import java.io.IOException;
-
-public class DelayStateSerializer extends StdSerializer
- * 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 io.serverlessworkflow.api.serializers;
-
-import com.fasterxml.jackson.core.JsonGenerator;
-import com.fasterxml.jackson.databind.SerializerProvider;
-import com.fasterxml.jackson.databind.ser.std.StdSerializer;
-import io.serverlessworkflow.api.end.End;
-import io.serverlessworkflow.api.produce.ProduceEvent;
-
-import java.io.IOException;
-
-public class EndDefinitionSerializer extends StdSerializer
- * 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 io.serverlessworkflow.api.serializers;
-
-import com.fasterxml.jackson.core.JsonGenerator;
-import com.fasterxml.jackson.databind.SerializerProvider;
-import com.fasterxml.jackson.databind.ser.BeanSerializerFactory;
-import com.fasterxml.jackson.databind.ser.std.StdSerializer;
-import com.fasterxml.jackson.databind.type.TypeFactory;
-import io.serverlessworkflow.api.events.EventDefinition;
-
-import java.io.IOException;
-
-public class EventDefinitionSerializer extends StdSerializer
- * 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 io.serverlessworkflow.api.serializers;
-
-import com.fasterxml.jackson.core.JsonGenerator;
-import com.fasterxml.jackson.databind.SerializerProvider;
-import com.fasterxml.jackson.databind.ser.BeanSerializerFactory;
-import com.fasterxml.jackson.databind.ser.std.StdSerializer;
-import com.fasterxml.jackson.databind.type.TypeFactory;
-import io.serverlessworkflow.api.states.DefaultState;
-import io.serverlessworkflow.api.states.EventState;
-
-import java.io.IOException;
-
-public class EventStateSerializer extends StdSerializer
- * 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 io.serverlessworkflow.api.serializers;
-
-import com.fasterxml.jackson.core.JsonGenerator;
-import com.fasterxml.jackson.databind.SerializerProvider;
-import com.fasterxml.jackson.databind.ser.BeanSerializerFactory;
-import com.fasterxml.jackson.databind.ser.std.StdSerializer;
-import com.fasterxml.jackson.databind.type.TypeFactory;
-import io.serverlessworkflow.api.interfaces.Extension;
-
-import java.io.IOException;
-import java.util.HashMap;
-import java.util.Map;
-
-public class ExtensionSerializer extends StdSerializer
- * 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 io.serverlessworkflow.api.serializers;
-
-import com.fasterxml.jackson.core.JsonGenerator;
-import com.fasterxml.jackson.databind.SerializerProvider;
-import com.fasterxml.jackson.databind.ser.BeanSerializerFactory;
-import com.fasterxml.jackson.databind.ser.std.StdSerializer;
-import com.fasterxml.jackson.databind.type.TypeFactory;
-import io.serverlessworkflow.api.states.DefaultState;
-import io.serverlessworkflow.api.states.ForEachState;
-
-import java.io.IOException;
-
-public class ForEachStateSerializer extends StdSerializer
- * 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 io.serverlessworkflow.api.serializers;
-
-import com.fasterxml.jackson.core.JsonGenerator;
-import com.fasterxml.jackson.databind.SerializerProvider;
-import com.fasterxml.jackson.databind.ser.std.StdSerializer;
-import io.serverlessworkflow.api.functions.FunctionRef;
-
-import java.io.IOException;
-
-public class FunctionRefSerializer extends StdSerializer
- * 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 io.serverlessworkflow.api.serializers;
-
-import com.fasterxml.jackson.core.JsonGenerator;
-import com.fasterxml.jackson.databind.SerializerProvider;
-import com.fasterxml.jackson.databind.ser.BeanSerializerFactory;
-import com.fasterxml.jackson.databind.ser.std.StdSerializer;
-import com.fasterxml.jackson.databind.type.TypeFactory;
-import io.serverlessworkflow.api.states.DefaultState;
-import io.serverlessworkflow.api.states.InjectState;
-
-import java.io.IOException;
-
-public class InjectStateSerializer extends StdSerializer
- * 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 io.serverlessworkflow.api.serializers;
-
-import com.fasterxml.jackson.core.JsonGenerator;
-import com.fasterxml.jackson.databind.SerializerProvider;
-import com.fasterxml.jackson.databind.ser.BeanSerializerFactory;
-import com.fasterxml.jackson.databind.ser.std.StdSerializer;
-import com.fasterxml.jackson.databind.type.TypeFactory;
-import io.serverlessworkflow.api.states.DefaultState;
-import io.serverlessworkflow.api.states.OperationState;
-
-import java.io.IOException;
-
-public class OperationStateSerializer extends StdSerializer
- * 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 io.serverlessworkflow.api.serializers;
-
-import com.fasterxml.jackson.core.JsonGenerator;
-import com.fasterxml.jackson.databind.SerializerProvider;
-import com.fasterxml.jackson.databind.ser.BeanSerializerFactory;
-import com.fasterxml.jackson.databind.ser.std.StdSerializer;
-import com.fasterxml.jackson.databind.type.TypeFactory;
-import io.serverlessworkflow.api.states.DefaultState;
-import io.serverlessworkflow.api.states.ParallelState;
-
-import java.io.IOException;
-
-public class ParallelStateSerializer extends StdSerializer
- * 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 io.serverlessworkflow.api.serializers;
-
-import com.fasterxml.jackson.core.JsonGenerator;
-import com.fasterxml.jackson.databind.SerializerProvider;
-import com.fasterxml.jackson.databind.ser.std.StdSerializer;
-import io.serverlessworkflow.api.schedule.Schedule;
-
-import java.io.IOException;
-
-public class ScheduleSerializer extends StdSerializer
- * 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 io.serverlessworkflow.api.serializers;
-
-import com.fasterxml.jackson.core.JsonGenerator;
-import com.fasterxml.jackson.databind.SerializerProvider;
-import com.fasterxml.jackson.databind.ser.std.StdSerializer;
-import io.serverlessworkflow.api.start.Start;
-
-import java.io.IOException;
-
-public class StartDefinitionSerializer extends StdSerializer
- * 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 io.serverlessworkflow.api.serializers;
-
-import com.fasterxml.jackson.core.JsonGenerator;
-import com.fasterxml.jackson.databind.SerializerProvider;
-import com.fasterxml.jackson.databind.ser.BeanSerializerFactory;
-import com.fasterxml.jackson.databind.ser.std.StdSerializer;
-import com.fasterxml.jackson.databind.type.TypeFactory;
-import io.serverlessworkflow.api.states.DefaultState;
-import io.serverlessworkflow.api.states.SubflowState;
-
-import java.io.IOException;
-
-public class SubflowStateSerializer extends StdSerializer
- * 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 io.serverlessworkflow.api.serializers;
-
-import com.fasterxml.jackson.core.JsonGenerator;
-import com.fasterxml.jackson.databind.SerializerProvider;
-import com.fasterxml.jackson.databind.ser.BeanSerializerFactory;
-import com.fasterxml.jackson.databind.ser.std.StdSerializer;
-import com.fasterxml.jackson.databind.type.TypeFactory;
-import io.serverlessworkflow.api.states.DefaultState;
-import io.serverlessworkflow.api.states.SwitchState;
-
-import java.io.IOException;
-
-public class SwitchStateSerializer extends StdSerializer
- * 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 io.serverlessworkflow.api.serializers;
-
-import com.fasterxml.jackson.core.JsonGenerator;
-import com.fasterxml.jackson.databind.SerializerProvider;
-import com.fasterxml.jackson.databind.ser.std.StdSerializer;
-import io.serverlessworkflow.api.produce.ProduceEvent;
-import io.serverlessworkflow.api.transitions.Transition;
-
-import java.io.IOException;
-
-public class TransitionSerializer extends StdSerializer
- * 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 io.serverlessworkflow.api.serializers;
-
-import com.fasterxml.jackson.core.JsonGenerator;
-import com.fasterxml.jackson.databind.SerializerProvider;
-import com.fasterxml.jackson.databind.ser.std.StdSerializer;
-import io.serverlessworkflow.api.Workflow;
-import io.serverlessworkflow.api.events.EventDefinition;
-import io.serverlessworkflow.api.functions.FunctionDefinition;
-import io.serverlessworkflow.api.interfaces.Extension;
-import io.serverlessworkflow.api.interfaces.State;
-import io.serverlessworkflow.api.retry.RetryDefinition;
-
-import java.io.IOException;
-import java.security.MessageDigest;
-import java.util.UUID;
-
-public class WorkflowSerializer extends StdSerializer
- * 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 io.serverlessworkflow.api.utils;
-
-import java.io.BufferedReader;
-import java.io.IOException;
-import java.io.InputStream;
-import java.io.InputStreamReader;
-import java.util.stream.Collectors;
-
-public class Utils {
-
- @SuppressWarnings("DefaultCharset")
- public static String getResourceFileAsString(String fileName) throws IOException {
- ClassLoader classLoader = ClassLoader.getSystemClassLoader();
- try (InputStream is = classLoader.getResourceAsStream(fileName)) {
- if (is == null) return null;
- try (InputStreamReader isr = new InputStreamReader(is);
- BufferedReader reader = new BufferedReader(isr)) {
- return reader.lines().collect(Collectors.joining(System.lineSeparator()));
- }
- }
- }
-}
diff --git a/api/src/main/java/io/serverlessworkflow/api/validation/ValidationError.java b/api/src/main/java/io/serverlessworkflow/api/validation/ValidationError.java
deleted file mode 100644
index 363310e5..00000000
--- a/api/src/main/java/io/serverlessworkflow/api/validation/ValidationError.java
+++ /dev/null
@@ -1,49 +0,0 @@
-/*
- * Copyright 2020-Present The Serverless Workflow Specification Authors
- *
- * 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 io.serverlessworkflow.api.validation;
-
-public class ValidationError {
- private static final String MSG_FORMAT = "%s:%s";
- public static final String SCHEMA_VALIDATION = "schemavalidation";
- public static final String WORKFLOW_VALIDATION = "workflowvalidation";
-
- private String message;
- private String type;
-
- public String getMessage() {
- return message;
- }
-
- public void setMessage(String message) {
- this.message = message;
- }
-
- public String getType() {
- return type;
- }
-
- public void setType(String type) {
- this.type = type;
- }
-
- @Override
- public String toString() {
- return String.format(MSG_FORMAT,
- type,
- message);
- }
-}
diff --git a/api/src/main/java/io/serverlessworkflow/api/validation/WorkflowSchemaLoader.java b/api/src/main/java/io/serverlessworkflow/api/validation/WorkflowSchemaLoader.java
deleted file mode 100644
index 1a35a45e..00000000
--- a/api/src/main/java/io/serverlessworkflow/api/validation/WorkflowSchemaLoader.java
+++ /dev/null
@@ -1,39 +0,0 @@
-/*
- * Copyright 2020-Present The Serverless Workflow Specification Authors
- *
- * 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 io.serverlessworkflow.api.validation;
-
-import io.serverlessworkflow.api.schemaclient.ResourceSchemaClient;
-import org.everit.json.schema.Schema;
-import org.everit.json.schema.loader.SchemaLoader;
-import org.everit.json.schema.loader.internal.DefaultSchemaClient;
-import org.json.JSONObject;
-import org.json.JSONTokener;
-
-public class WorkflowSchemaLoader {
- private static final JSONObject workflowSchema = new JSONObject(new JSONTokener(
- WorkflowSchemaLoader.class.getResourceAsStream("/schema/workflow.json")));
-
- public static Schema getWorkflowSchema() {
- SchemaLoader schemaLoader = SchemaLoader.builder()
- .schemaClient(new ResourceSchemaClient(new DefaultSchemaClient()))
- .schemaJson(workflowSchema)
- .resolutionScope("classpath:schema")
- .draftV7Support()
- .build();
- return schemaLoader.load().build();
- }
-}
diff --git a/api/src/main/java/io/serverlessworkflow/api/workflow/BaseWorkflow.java b/api/src/main/java/io/serverlessworkflow/api/workflow/BaseWorkflow.java
deleted file mode 100644
index fb4a094f..00000000
--- a/api/src/main/java/io/serverlessworkflow/api/workflow/BaseWorkflow.java
+++ /dev/null
@@ -1,78 +0,0 @@
-/*
- * Copyright 2020-Present The Serverless Workflow Specification Authors
- *
- * 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 io.serverlessworkflow.api.workflow;
-
-import com.fasterxml.jackson.core.JsonProcessingException;
-import com.fasterxml.jackson.databind.JsonNode;
-import com.fasterxml.jackson.dataformat.yaml.YAMLFactory;
-import com.fasterxml.jackson.dataformat.yaml.YAMLGenerator;
-import com.fasterxml.jackson.dataformat.yaml.YAMLMapper;
-import io.serverlessworkflow.api.Workflow;
-import io.serverlessworkflow.api.mapper.JsonObjectMapper;
-import io.serverlessworkflow.api.mapper.YamlObjectMapper;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-
-/**
- * Base Workflow provides some extra functionality for the Workflow types
- */
-public class BaseWorkflow {
-
- private static JsonObjectMapper jsonObjectMapper = new JsonObjectMapper();
- private static YamlObjectMapper yamlObjectMapper = new YamlObjectMapper();
-
- private static Logger logger = LoggerFactory.getLogger(BaseWorkflow.class);
-
- public static Workflow fromSource(String source) {
- // try it as json markup first, if fails try yaml
- try {
- return jsonObjectMapper.readValue(source,
- Workflow.class);
- } catch (Exception e) {
- logger.info("Unable to convert as json markup, trying as yaml");
- try {
- return yamlObjectMapper.readValue(source,
- Workflow.class);
- } catch (Exception ee) {
- throw new IllegalArgumentException("Could not convert markup to Workflow: " + ee.getMessage());
- }
- }
- }
-
- public static String toJson(Workflow workflow) {
- try {
- return jsonObjectMapper.writeValueAsString(workflow);
- } catch (JsonProcessingException e) {
- logger.error("Error mapping to json: " + e.getMessage());
- return null;
- }
- }
-
- public static String toYaml(Workflow workflow) {
- try {
- String jsonString = jsonObjectMapper.writeValueAsString(workflow);
- JsonNode jsonNode = jsonObjectMapper.readTree(jsonString);
- YAMLFactory yamlFactory = new YAMLFactory()
- .disable(YAMLGenerator.Feature.MINIMIZE_QUOTES)
- .disable(YAMLGenerator.Feature.WRITE_DOC_START_MARKER);
- return new YAMLMapper(yamlFactory).writeValueAsString(jsonNode);
- } catch (Exception e) {
- logger.error("Error mapping to yaml: " + e.getMessage());
- return null;
- }
- }
-}
diff --git a/api/src/main/java/io/serverlessworkflow/api/workflow/Events.java b/api/src/main/java/io/serverlessworkflow/api/workflow/Events.java
deleted file mode 100644
index 2e0443f9..00000000
--- a/api/src/main/java/io/serverlessworkflow/api/workflow/Events.java
+++ /dev/null
@@ -1,52 +0,0 @@
-/*
- * Copyright 2020-Present The Serverless Workflow Specification Authors
- *
- * 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 io.serverlessworkflow.api.workflow;
-
-import io.serverlessworkflow.api.events.EventDefinition;
-
-import java.util.List;
-
-public class Events {
- private String refValue;
- private List
- * 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 io.serverlessworkflow.api.workflow;
-
-import io.serverlessworkflow.api.functions.FunctionDefinition;
-
-import java.util.List;
-
-public class Functions {
- private String refValue;
- private List
- * 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 io.serverlessworkflow.api.workflow;
-
-import io.serverlessworkflow.api.retry.RetryDefinition;
-
-import java.util.List;
-
-public class Retries {
- private String refValue;
- private List
- * 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 io.serverlessworkflow.api.test;
-
-import com.fasterxml.jackson.databind.JsonNode;
-import io.serverlessworkflow.api.Workflow;
-import io.serverlessworkflow.api.actions.Action;
-import io.serverlessworkflow.api.datainputschema.DataInputSchema;
-import io.serverlessworkflow.api.defaultdef.DefaultDefinition;
-import io.serverlessworkflow.api.exectimeout.ExecTimeout;
-import io.serverlessworkflow.api.functions.FunctionDefinition;
-import io.serverlessworkflow.api.functions.FunctionRef;
-import io.serverlessworkflow.api.interfaces.State;
-import io.serverlessworkflow.api.retry.RetryDefinition;
-import io.serverlessworkflow.api.states.EventState;
-import io.serverlessworkflow.api.states.OperationState;
-import io.serverlessworkflow.api.states.SubflowState;
-import io.serverlessworkflow.api.states.SwitchState;
-import io.serverlessworkflow.api.switchconditions.DataCondition;
-import io.serverlessworkflow.api.test.utils.WorkflowTestUtils;
-import io.serverlessworkflow.api.workflow.Retries;
-import org.junit.jupiter.params.ParameterizedTest;
-import org.junit.jupiter.params.provider.ValueSource;
-
-import java.util.List;
-
-import static org.junit.jupiter.api.Assertions.*;
-
-public class MarkupToWorkflowTest {
-
- @ParameterizedTest
- @ValueSource(strings = {"/examples/applicantrequest.json", "/examples/applicantrequest.yml",
- "/examples/carauctionbids.json", "/examples/carauctionbids.yml",
- "/examples/creditcheck.json", "/examples/creditcheck.yml",
- "/examples/eventbasedgreeting.json", "/examples/eventbasedgreeting.yml",
- "/examples/finalizecollegeapplication.json", "/examples/finalizecollegeapplication.yml",
- "/examples/greeting.json", "/examples/greeting.yml",
- "/examples/helloworld.json", "/examples/helloworld.yml",
- "/examples/jobmonitoring.json", "/examples/jobmonitoring.yml",
- "/examples/monitorpatient.json", "/examples/monitorpatient.yml",
- "/examples/parallel.json", "/examples/parallel.yml",
- "/examples/provisionorder.json", "/examples/provisionorder.yml",
- "/examples/sendcloudevent.json", "/examples/sendcloudevent.yml",
- "/examples/solvemathproblems.json", "/examples/solvemathproblems.yml",
- "/examples/foreachstatewithactions.json", "/examples/foreachstatewithactions.yml",
- "/examples/periodicinboxcheck.json", "/examples/periodicinboxcheck.yml",
- "/examples/vetappointmentservice.json", "/examples/vetappointmentservice.yml",
- "/examples/eventbasedtransition.json", "/examples/eventbasedtransition.yml",
- "/examples/roomreadings.json", "/examples/roomreadings.yml",
- "/examples/checkcarvitals.json", "/examples/checkcarvitals.yml",
- "/examples/booklending.json", "/examples/booklending.yml"
- })
- public void testSpecExamplesParsing(String workflowLocation) {
- Workflow workflow = Workflow.fromSource(WorkflowTestUtils.readWorkflowFile(workflowLocation));
-
- assertNotNull(workflow);
- assertNotNull(workflow.getId());
- assertNotNull(workflow.getName());
- assertNotNull(workflow.getStates());
- assertTrue(workflow.getStates().size() > 0);
- }
-
- @ParameterizedTest
- @ValueSource(strings = {"/features/applicantrequest.json", "/features/applicantrequest.yml"})
- public void testSpecFreatureFunctionRef(String workflowLocation) {
- Workflow workflow = Workflow.fromSource(WorkflowTestUtils.readWorkflowFile(workflowLocation));
-
- assertNotNull(workflow);
- assertNotNull(workflow.getId());
- assertNotNull(workflow.getName());
- assertNotNull(workflow.getStates());
- assertTrue(workflow.getStates().size() > 0);
-
- assertNotNull(workflow.getFunctions());
- assertEquals(1, workflow.getFunctions().getFunctionDefs().size());
-
- assertNotNull(workflow.getRetries());
- assertEquals(1, workflow.getRetries().getRetryDefs().size());
- }
-
- @ParameterizedTest
- @ValueSource(strings = {"/features/vetappointment.json", "/features/vetappointment.yml"})
- public void testSpecFreatureEventRef(String workflowLocation) {
- Workflow workflow = Workflow.fromSource(WorkflowTestUtils.readWorkflowFile(workflowLocation));
-
- assertNotNull(workflow);
- assertNotNull(workflow.getId());
- assertNotNull(workflow.getName());
- assertNotNull(workflow.getStates());
- assertTrue(workflow.getStates().size() > 0);
-
- assertNotNull(workflow.getEvents());
- assertEquals(2, workflow.getEvents().getEventDefs().size());
-
- assertNotNull(workflow.getRetries());
- assertEquals(1, workflow.getRetries().getRetryDefs().size());
- }
-
- @ParameterizedTest
- @ValueSource(strings = {"/features/compensationworkflow.json", "/features/compensationworkflow.yml"})
- public void testSpecFreatureCompensation(String workflowLocation) {
- Workflow workflow = Workflow.fromSource(WorkflowTestUtils.readWorkflowFile(workflowLocation));
-
- assertNotNull(workflow);
- assertNotNull(workflow.getId());
- assertNotNull(workflow.getName());
- assertNotNull(workflow.getStates());
-
- assertNotNull(workflow.getStates());
- assertEquals(2, workflow.getStates().size());
-
- State firstState = workflow.getStates().get(0);
- assertTrue(firstState instanceof EventState);
- assertNotNull(firstState.getCompensatedBy());
- assertEquals("CancelPurchase", firstState.getCompensatedBy());
-
- State secondState = workflow.getStates().get(1);
- assertTrue(secondState instanceof OperationState);
- OperationState operationState = (OperationState) secondState;
-
- assertTrue(operationState.isUsedForCompensation());
- }
-
- @ParameterizedTest
- @ValueSource(strings = {"/features/functiontypes.json", "/features/functiontypes.yml"})
- public void testFunctionTypes(String workflowLocation) {
- Workflow workflow = Workflow.fromSource(WorkflowTestUtils.readWorkflowFile(workflowLocation));
-
- assertNotNull(workflow);
- assertNotNull(workflow.getId());
- assertNotNull(workflow.getName());
- assertNotNull(workflow.getStates());
-
- assertNotNull(workflow.getStates());
- assertEquals(1, workflow.getStates().size());
-
- State state = workflow.getStates().get(0);
- assertTrue(state instanceof OperationState);
-
- List
- * 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 io.serverlessworkflow.api.test;
-
-import io.serverlessworkflow.api.Workflow;
-import io.serverlessworkflow.api.end.End;
-import io.serverlessworkflow.api.events.EventDefinition;
-import io.serverlessworkflow.api.functions.FunctionDefinition;
-import io.serverlessworkflow.api.interfaces.State;
-import io.serverlessworkflow.api.produce.ProduceEvent;
-import io.serverlessworkflow.api.schedule.Schedule;
-import io.serverlessworkflow.api.start.Start;
-import io.serverlessworkflow.api.states.DelayState;
-import io.serverlessworkflow.api.workflow.Events;
-import io.serverlessworkflow.api.workflow.Functions;
-import org.junit.jupiter.api.Test;
-
-import java.util.Arrays;
-
-import static io.serverlessworkflow.api.states.DefaultState.Type.DELAY;
-import static org.junit.jupiter.api.Assertions.*;
-
-public class WorkflowToMarkupTest {
- @Test
- public void testSingleState() {
-
- Workflow workflow = new Workflow().withId("test-workflow").withName("test-workflow-name").withVersion("1.0")
- .withStart(new Start().withSchedule(
- new Schedule().withInterval("PT1S")
- ))
- .withStates(Arrays.asList(
- new DelayState().withName("delayState").withType(DELAY)
- .withEnd(
- new End().withTerminate(true).withCompensate(true)
- .withProduceEvents(Arrays.asList(
- new ProduceEvent().withEventRef("someEvent")
- ))
- )
- .withTimeDelay("PT1M")
- )
- );
-
- assertNotNull(workflow);
- assertNotNull(workflow.getStart());
- assertEquals(1, workflow.getStates().size());
- State state = workflow.getStates().get(0);
- assertTrue(state instanceof DelayState);
- assertNotNull(state.getEnd());
-
- assertNotNull(Workflow.toJson(workflow));
- assertNotNull(Workflow.toYaml(workflow));
- }
-
- @Test
- public void testSingleFunction() {
-
- Workflow workflow = new Workflow().withId("test-workflow").withName("test-workflow-name").withVersion("1.0")
- .withStart(
- new Start()
- )
- .withFunctions(new Functions(Arrays.asList(
- new FunctionDefinition().withName("testFunction")
- .withOperation("testSwaggerDef#testOperationId")))
- )
- .withStates(Arrays.asList(
- new DelayState().withName("delayState").withType(DELAY)
- .withEnd(
- new End()
- )
- .withTimeDelay("PT1M")
- )
- );
-
- assertNotNull(workflow);
- assertNotNull(workflow.getStart());
- assertEquals(1, workflow.getStates().size());
- State state = workflow.getStates().get(0);
- assertTrue(state instanceof DelayState);
- assertNotNull(workflow.getFunctions());
- assertEquals(1, workflow.getFunctions().getFunctionDefs().size());
- assertEquals("testFunction", workflow.getFunctions().getFunctionDefs().get(0).getName());
-
- assertNotNull(Workflow.toJson(workflow));
- assertNotNull(Workflow.toYaml(workflow));
- }
-
- @Test
- public void testSingleEvent() {
-
- Workflow workflow = new Workflow().withId("test-workflow").withName("test-workflow-name").withVersion("1.0")
- .withStart(
- new Start()
- )
- .withEvents(new Events(Arrays.asList(
- new EventDefinition().withName("testEvent").withSource("testSource").withType("testType")
- .withKind(EventDefinition.Kind.PRODUCED)))
- )
- .withFunctions(new Functions(Arrays.asList(
- new FunctionDefinition().withName("testFunction")
- .withOperation("testSwaggerDef#testOperationId")))
- )
- .withStates(Arrays.asList(
- new DelayState().withName("delayState").withType(DELAY)
- .withEnd(
- new End()
- )
- .withTimeDelay("PT1M")
- )
- );
-
- assertNotNull(workflow);
- assertNotNull(workflow.getStart());
- assertEquals(1, workflow.getStates().size());
- State state = workflow.getStates().get(0);
- assertTrue(state instanceof DelayState);
- assertNotNull(workflow.getFunctions());
- assertEquals(1, workflow.getFunctions().getFunctionDefs().size());
- assertEquals("testFunction", workflow.getFunctions().getFunctionDefs().get(0).getName());
- assertNotNull(workflow.getEvents());
- assertEquals(1, workflow.getEvents().getEventDefs().size());
- assertEquals("testEvent", workflow.getEvents().getEventDefs().get(0).getName());
- assertEquals(EventDefinition.Kind.PRODUCED, workflow.getEvents().getEventDefs().get(0).getKind());
-
- assertNotNull(Workflow.toJson(workflow));
- assertNotNull(Workflow.toYaml(workflow));
- }
-}
diff --git a/api/src/test/java/io/serverlessworkflow/api/test/utils/WorkflowTestUtils.java b/api/src/test/java/io/serverlessworkflow/api/test/utils/WorkflowTestUtils.java
deleted file mode 100644
index 31451d80..00000000
--- a/api/src/test/java/io/serverlessworkflow/api/test/utils/WorkflowTestUtils.java
+++ /dev/null
@@ -1,71 +0,0 @@
-/*
- * Copyright 2020-Present The Serverless Workflow Specification Authors
- *
- * 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 io.serverlessworkflow.api.test.utils;
-
-import io.serverlessworkflow.api.mapper.JsonObjectMapper;
-import io.serverlessworkflow.api.mapper.YamlObjectMapper;
-
-import java.io.*;
-import java.nio.file.Files;
-import java.nio.file.Path;
-import java.nio.file.Paths;
-
-public class WorkflowTestUtils {
- private static JsonObjectMapper jsonObjectMapper = new JsonObjectMapper();
- private static YamlObjectMapper yamlObjectMapper = new YamlObjectMapper();
-
- public static final Path resourceDirectory = Paths.get("src",
- "test",
- "resources");
- public static final String absolutePath = resourceDirectory.toFile().getAbsolutePath();
-
- public static Path getResourcePath(String file) {
- return Paths.get(absolutePath + File.separator + file);
- }
-
- public static InputStream getInputStreamFromPath(Path path) throws Exception {
- return Files.newInputStream(path);
- }
-
- public static String readWorkflowFile(String location) {
- return readFileAsString(classpathResourceReader(location));
- }
-
- public static Reader classpathResourceReader(String location) {
- return new InputStreamReader(WorkflowTestUtils.class.getResourceAsStream(location));
- }
-
- public static String readFileAsString(Reader reader) {
- try {
- StringBuilder fileData = new StringBuilder(1000);
- char[] buf = new char[1024];
- int numRead;
- while ((numRead = reader.read(buf)) != -1) {
- String readData = String.valueOf(buf,
- 0,
- numRead);
- fileData.append(readData);
- buf = new char[1024];
- }
- reader.close();
- return fileData.toString();
- } catch (IOException e) {
- throw new RuntimeException(e);
- }
- }
-
-}
diff --git a/api/src/test/resources/examples/applicantrequest.json b/api/src/test/resources/examples/applicantrequest.json
deleted file mode 100644
index b330bdeb..00000000
--- a/api/src/test/resources/examples/applicantrequest.json
+++ /dev/null
@@ -1,54 +0,0 @@
-{
- "id": "applicantrequest",
- "version": "1.0",
- "name": "Applicant Request Decision Workflow",
- "description": "Determine if applicant request is valid",
- "start": "CheckApplication",
- "functions": [
- {
- "name": "sendRejectionEmailFunction",
- "operation": "http://myapis.org/applicationapi.json#emailRejection"
- }
- ],
- "states":[
- {
- "name":"CheckApplication",
- "type":"switch",
- "dataConditions": [
- {
- "condition": "${ .applicants | .age >= 18 }",
- "transition": "StartApplication"
- },
- {
- "condition": "${ .applicants | .age < 18 }",
- "transition": "RejectApplication"
- }
- ],
- "default": {
- "transition": "RejectApplication"
- }
- },
- {
- "name": "StartApplication",
- "type": "subflow",
- "workflowId": "startApplicationWorkflowId",
- "end": true
- },
- {
- "name":"RejectApplication",
- "type":"operation",
- "actionMode":"sequential",
- "actions":[
- {
- "functionRef": {
- "refName": "sendRejectionEmailFunction",
- "arguments": {
- "applicant": "${ .applicant }"
- }
- }
- }
- ],
- "end": true
- }
- ]
-}
\ No newline at end of file
diff --git a/api/src/test/resources/examples/applicantrequest.yml b/api/src/test/resources/examples/applicantrequest.yml
deleted file mode 100644
index d75d400f..00000000
--- a/api/src/test/resources/examples/applicantrequest.yml
+++ /dev/null
@@ -1,31 +0,0 @@
-id: applicantrequest
-version: '1.0'
-name: Applicant Request Decision Workflow
-description: Determine if applicant request is valid
-start: CheckApplication
-functions:
- - name: sendRejectionEmailFunction
- operation: http://myapis.org/applicationapi.json#emailRejection
-states:
- - name: CheckApplication
- type: switch
- dataConditions:
- - condition: "${ .applicants | .age >= 18 }"
- transition: StartApplication
- - condition: "${ .applicants | .age < 18 }"
- transition: RejectApplication
- default:
- transition: RejectApplication
- - name: StartApplication
- type: subflow
- workflowId: startApplicationWorkflowId
- end: true
- - name: RejectApplication
- type: operation
- actionMode: sequential
- actions:
- - functionRef:
- refName: sendRejectionEmailFunction
- arguments:
- applicant: "${ .applicant }"
- end: true
\ No newline at end of file
diff --git a/api/src/test/resources/examples/booklending.json b/api/src/test/resources/examples/booklending.json
deleted file mode 100644
index 6260ae8b..00000000
--- a/api/src/test/resources/examples/booklending.json
+++ /dev/null
@@ -1,129 +0,0 @@
-{
- "id": "booklending",
- "name": "Book Lending Workflow",
- "version": "1.0",
- "start": "Book Lending Request",
- "states": [
- {
- "name": "Book Lending Request",
- "type": "event",
- "onEvents": [
- {
- "eventRefs": ["Book Lending Request Event"]
- }
- ],
- "transition": "Get Book Status"
- },
- {
- "name": "Get Book Status",
- "type": "operation",
- "actions": [
- {
- "functionRef": {
- "refName": "Get status for book",
- "arguments": {
- "bookid": "${ .book.id }"
- }
- }
- }
- ],
- "transition": "Book Status Decision"
- },
- {
- "name": "Book Status Decision",
- "type": "switch",
- "dataConditions": [
- {
- "name": "Book is on loan",
- "condition": "${ .book.status == \"onloan\" }",
- "transition": "Report Status To Lender"
- },
- {
- "name": "Check is available",
- "condition": "${ .book.status == \"available\" }",
- "transition": "Check Out Book"
- }
- ]
- },
- {
- "name": "Report Status To Lender",
- "type": "operation",
- "actions": [
- {
- "functionRef": {
- "refName": "Send status to lender",
- "arguments": {
- "bookid": "${ .book.id }",
- "message": "Book ${ .book.title } is already on loan"
- }
- }
- }
- ],
- "transition": "Wait for Lender response"
- },
- {
- "name": "Wait for Lender response",
- "type": "switch",
- "eventConditions": [
- {
- "name": "Hold Book",
- "eventRef": "Hold Book Event",
- "transition": "Request Hold"
- },
- {
- "name": "Decline Book Hold",
- "eventRef": "Decline Hold Event",
- "transition": "Cancel Request"
- }
- ]
- },
- {
- "name": "Request Hold",
- "type": "operation",
- "actions": [
- {
- "functionRef": {
- "refName": "Request hold for lender",
- "arguments": {
- "bookid": "${ .book.id }",
- "lender": "${ .lender }"
- }
- }
- }
- ],
- "transition": "Wait two weeks"
- },
- {
- "name": "Wait two weeks",
- "type": "delay",
- "timeDelay": "P2W",
- "transition": "Get Book Status"
- },
- {
- "name": "Check Out Book",
- "type": "operation",
- "actions": [
- {
- "functionRef": {
- "refName": "Check out book with id",
- "arguments": {
- "bookid": "${ .book.id }"
- }
- }
- },
- {
- "functionRef": {
- "refName": "Notify Lender for checkout",
- "arguments": {
- "bookid": "${ .book.id }",
- "lender": "${ .lender }"
- }
- }
- }
- ],
- "end": true
- }
- ],
- "functions": "file://books/lending/functions.json",
- "events": "file://books/lending/events.json"
-}
\ No newline at end of file
diff --git a/api/src/test/resources/examples/booklending.yml b/api/src/test/resources/examples/booklending.yml
deleted file mode 100644
index e7e3e525..00000000
--- a/api/src/test/resources/examples/booklending.yml
+++ /dev/null
@@ -1,74 +0,0 @@
-id: booklending
-name: Book Lending Workflow
-version: '1.0'
-start: Book Lending Request
-states:
- - name: Book Lending Request
- type: event
- onEvents:
- - eventRefs:
- - Book Lending Request Event
- transition: Get Book Status
- - name: Get Book Status
- type: operation
- actions:
- - functionRef:
- refName: Get status for book
- arguments:
- bookid: "${ .book.id }"
- transition: Book Status Decision
- - name: Book Status Decision
- type: switch
- dataConditions:
- - name: Book is on loan
- condition: ${ .book.status == "onloan" }
- transition: Report Status To Lender
- - name: Check is available
- condition: ${ .book.status == "available" }
- transition: Check Out Book
- - name: Report Status To Lender
- type: operation
- actions:
- - functionRef:
- refName: Send status to lender
- arguments:
- bookid: "${ .book.id }"
- message: Book ${ .book.title } is already on loan
- transition: Wait for Lender response
- - name: Wait for Lender response
- type: switch
- eventConditions:
- - name: Hold Book
- eventRef: Hold Book Event
- transition: Request Hold
- - name: Decline Book Hold
- eventRef: Decline Hold Event
- transition: Cancel Request
- - name: Request Hold
- type: operation
- actions:
- - functionRef:
- refName: Request fold for lender
- arguments:
- bookid: "${ .book.id }"
- lender: "${ .lender }"
- transition: Wait two weeks
- - name: Wait two weeks
- type: delay
- timeDelay: P2W
- transition: Get Book Status
- - name: Check Out Book
- type: operation
- actions:
- - functionRef:
- refName: Check out book with id
- arguments:
- bookid: "${ .book.id }"
- - functionRef:
- refName: Notify Lender for checkout
- arguments:
- bookid: "${ .book.id }"
- lender: "${ .lender }"
- end: true
-functions: file://books/lending/functions.json
-events: file://books/lending/events.json
\ No newline at end of file
diff --git a/api/src/test/resources/examples/carauctionbids.json b/api/src/test/resources/examples/carauctionbids.json
deleted file mode 100644
index 8c2fde11..00000000
--- a/api/src/test/resources/examples/carauctionbids.json
+++ /dev/null
@@ -1,44 +0,0 @@
-{
- "id": "handleCarAuctionBid",
- "version": "1.0",
- "name": "Car Auction Bidding Workflow",
- "description": "Store a single bid whole the car auction is active",
- "start": {
- "stateName": "StoreCarAuctionBid",
- "schedule": "2020-03-20T09:00:00Z/2020-03-20T15:00:00Z"
- },
- "functions": [
- {
- "name": "StoreBidFunction",
- "operation": "http://myapis.org/carauctionapi.json#storeBid"
- }
- ],
- "events": [
- {
- "name": "CarBidEvent",
- "type": "carBidMadeType",
- "source": "carBidEventSource"
- }
- ],
- "states": [
- {
- "name": "StoreCarAuctionBid",
- "type": "event",
- "exclusive": true,
- "onEvents": [
- {
- "eventRefs": ["CarBidEvent"],
- "actions": [{
- "functionRef": {
- "refName": "StoreBidFunction",
- "arguments": {
- "bid": "${ .bid }"
- }
- }
- }]
- }
- ],
- "end": true
- }
- ]
-}
\ No newline at end of file
diff --git a/api/src/test/resources/examples/carauctionbids.yml b/api/src/test/resources/examples/carauctionbids.yml
deleted file mode 100644
index f943f52f..00000000
--- a/api/src/test/resources/examples/carauctionbids.yml
+++ /dev/null
@@ -1,27 +0,0 @@
-id: handleCarAuctionBid
-version: '1.0'
-name: Car Auction Bidding Workflow
-description: Store a single bid whole the car auction is active
-start:
- stateName: StoreCarAuctionBid
- schedule: 2020-03-20T09:00:00Z/2020-03-20T15:00:00Z
-functions:
- - name: StoreBidFunction
- operation: http://myapis.org/carauctionapi.json#storeBid
-events:
- - name: CarBidEvent
- type: carBidMadeType
- source: carBidEventSource
-states:
- - name: StoreCarAuctionBid
- type: event
- exclusive: true
- onEvents:
- - eventRefs:
- - CarBidEvent
- actions:
- - functionRef:
- refName: StoreBidFunction
- arguments:
- bid: "${ .bid }"
- end: true
\ No newline at end of file
diff --git a/api/src/test/resources/examples/checkcarvitals.json b/api/src/test/resources/examples/checkcarvitals.json
deleted file mode 100644
index 504235d2..00000000
--- a/api/src/test/resources/examples/checkcarvitals.json
+++ /dev/null
@@ -1,39 +0,0 @@
-{
- "id": "checkcarvitals",
- "name": "Check Car Vitals Workflow",
- "version": "1.0",
- "start": "WhenCarIsOn",
- "states": [
- {
- "name": "WhenCarIsOn",
- "type": "event",
- "onEvents": [
- {
- "eventRefs": ["CarTurnedOnEvent"]
- }
- ],
- "transition": "DoCarVitalsChecks"
- },
- {
- "name": "DoCarVitalsChecks",
- "type": "subflow",
- "workflowId": "vitalscheck",
- "repeat": {
- "stopOnEvents": ["CarTurnedOffEvent"]
- },
- "end": true
- }
- ],
- "events": [
- {
- "name": "CarTurnedOnEvent",
- "type": "car.events",
- "source": "my/car/start"
- },
- {
- "name": "CarTurnedOffEvent",
- "type": "car.events",
- "source": "my/car/start"
- }
- ]
-}
\ No newline at end of file
diff --git a/api/src/test/resources/examples/checkcarvitals.yml b/api/src/test/resources/examples/checkcarvitals.yml
deleted file mode 100644
index d17d73ce..00000000
--- a/api/src/test/resources/examples/checkcarvitals.yml
+++ /dev/null
@@ -1,25 +0,0 @@
-id: checkcarvitals
-name: Check Car Vitals Workflow
-version: '1.0'
-start: WhenCarIsOn
-states:
- - name: WhenCarIsOn
- type: event
- onEvents:
- - eventRefs:
- - CarTurnedOnEvent
- transition: DoCarVitalsChecks
- - name: DoCarVitalsChecks
- type: subflow
- workflowId: vitalscheck
- repeat:
- stopOnEvents:
- - CarTurnedOffEvent
- end: true
-events:
- - name: CarTurnedOnEvent
- type: car.events
- source: my/car/start
- - name: CarTurnedOffEvent
- type: car.events
- source: my/car/start
\ No newline at end of file
diff --git a/api/src/test/resources/examples/creditcheck.json b/api/src/test/resources/examples/creditcheck.json
deleted file mode 100644
index e6bfd9b6..00000000
--- a/api/src/test/resources/examples/creditcheck.json
+++ /dev/null
@@ -1,85 +0,0 @@
-{
- "id": "customercreditcheck",
- "version": "1.0",
- "name": "Customer Credit Check Workflow",
- "description": "Perform Customer Credit Check",
- "start": "CheckCredit",
- "functions": [
- {
- "name": "creditCheckFunction",
- "operation": "http://myapis.org/creditcheckapi.json#doCreditCheck"
- },
- {
- "name": "sendRejectionEmailFunction",
- "operation": "http://myapis.org/creditcheckapi.json#rejectionEmail"
- }
- ],
- "events": [
- {
- "name": "CreditCheckCompletedEvent",
- "type": "creditCheckCompleteType",
- "source": "creditCheckSource",
- "correlation": [
- {
- "contextAttributeName": "customerId"
- }
- ]
- }
- ],
- "states": [
- {
- "name": "CheckCredit",
- "type": "callback",
- "action": {
- "functionRef": {
- "refName": "callCreditCheckMicroservice",
- "arguments": {
- "customer": "${ .customer }"
- }
- }
- },
- "eventRef": "CreditCheckCompletedEvent",
- "timeout": "PT15M",
- "transition": "EvaluateDecision"
- },
- {
- "name": "EvaluateDecision",
- "type": "switch",
- "dataConditions": [
- {
- "condition": "${ .creditCheck | .decision == \"Approved\" }",
- "transition": "StartApplication'"
- },
- {
- "condition": "${ .creditCheck | .decision == \"Denied\" }",
- "transition": "RejectApplication"
- }
- ],
- "default": {
- "transition": "RejectApplication"
- }
- },
- {
- "name": "StartApplication",
- "type": "subflow",
- "workflowId": "startApplicationWorkflowId",
- "end": true
- },
- {
- "name": "RejectApplication",
- "type": "operation",
- "actionMode": "sequential",
- "actions": [
- {
- "functionRef": {
- "refName": "sendRejectionEmailFunction",
- "arguments": {
- "applicant": "${ .customer }"
- }
- }
- }
- ],
- "end": true
- }
- ]
-}
\ No newline at end of file
diff --git a/api/src/test/resources/examples/creditcheck.yml b/api/src/test/resources/examples/creditcheck.yml
deleted file mode 100644
index c4e5eb4a..00000000
--- a/api/src/test/resources/examples/creditcheck.yml
+++ /dev/null
@@ -1,49 +0,0 @@
-id: customercreditcheck
-version: '1.0'
-name: Customer Credit Check Workflow
-description: Perform Customer Credit Check
-start: CheckCredit
-functions:
- - name: creditCheckFunction
- operation: http://myapis.org/creditcheckapi.json#doCreditCheck
- - name: sendRejectionEmailFunction
- operation: http://myapis.org/creditcheckapi.json#rejectionEmail
-events:
- - name: CreditCheckCompletedEvent
- type: creditCheckCompleteType
- source: creditCheckSource
- correlation:
- - contextAttributeName: customerId
-states:
- - name: CheckCredit
- type: callback
- action:
- functionRef:
- refName: callCreditCheckMicroservice
- arguments:
- customer: "${ .customer }"
- eventRef: CreditCheckCompletedEvent
- timeout: PT15M
- transition: EvaluateDecision
- - name: EvaluateDecision
- type: switch
- dataConditions:
- - condition: "${ .creditCheck | .decision == \"Approved\" }"
- transition: StartApplication
- - condition: "${ .creditCheck | .decision == \"Denied\" }"
- transition: RejectApplication
- default:
- transition: RejectApplication
- - name: StartApplication
- type: subflow
- workflowId: startApplicationWorkflowId
- end: true
- - name: RejectApplication
- type: operation
- actionMode: sequential
- actions:
- - functionRef:
- refName: sendRejectionEmailFunction
- arguments:
- applicant: "${ .customer }"
- end: true
\ No newline at end of file
diff --git a/api/src/test/resources/examples/eventbasedgreeting.json b/api/src/test/resources/examples/eventbasedgreeting.json
deleted file mode 100644
index aa80a3b4..00000000
--- a/api/src/test/resources/examples/eventbasedgreeting.json
+++ /dev/null
@@ -1,46 +0,0 @@
-{
- "id": "eventbasedgreeting",
- "version": "1.0",
- "name": "Event Based Greeting Workflow",
- "description": "Event Based Greeting",
- "start": "Greet",
- "events": [
- {
- "name": "GreetingEvent",
- "type": "greetingEventType",
- "source": "greetingEventSource"
- }
- ],
- "functions": [
- {
- "name": "greetingFunction",
- "operation": "file://myapis/greetingapis.json#greeting"
- }
- ],
- "states":[
- {
- "name":"Greet",
- "type":"event",
- "onEvents": [{
- "eventRefs": ["GreetingEvent"],
- "eventDataFilter": {
- "data": "${ .data.greet }"
- },
- "actions":[
- {
- "functionRef": {
- "refName": "greetingFunction",
- "arguments": {
- "name": "${ .greet.name }"
- }
- }
- }
- ]
- }],
- "stateDataFilter": {
- "output": "${ .payload.greeting }"
- },
- "end": true
- }
- ]
-}
\ No newline at end of file
diff --git a/api/src/test/resources/examples/eventbasedgreeting.yml b/api/src/test/resources/examples/eventbasedgreeting.yml
deleted file mode 100644
index ec22bec3..00000000
--- a/api/src/test/resources/examples/eventbasedgreeting.yml
+++ /dev/null
@@ -1,28 +0,0 @@
-id: eventbasedgreeting
-version: '1.0'
-name: Event Based Greeting Workflow
-description: Event Based Greeting
-start: Greet
-events:
- - name: GreetingEvent
- type: greetingEventType
- source: greetingEventSource
-functions:
- - name: greetingFunction
- operation: file://myapis/greetingapis.json#greeting
-states:
- - name: Greet
- type: event
- onEvents:
- - eventRefs:
- - GreetingEvent
- eventDataFilter:
- data: "${ .data.greet }"
- actions:
- - functionRef:
- refName: greetingFunction
- arguments:
- name: "${ .greet.name }"
- stateDataFilter:
- output: "${ .payload.greeting }"
- end: true
\ No newline at end of file
diff --git a/api/src/test/resources/examples/eventbasedtransition.json b/api/src/test/resources/examples/eventbasedtransition.json
deleted file mode 100644
index 29ee0271..00000000
--- a/api/src/test/resources/examples/eventbasedtransition.json
+++ /dev/null
@@ -1,57 +0,0 @@
-{
- "id": "eventbasedswitch",
- "version": "1.0",
- "name": "Event Based Switch Transitions",
- "description": "Event Based Switch Transitions",
- "start": "CheckVisaStatus",
- "events": [
- {
- "name": "visaApprovedEvent",
- "type": "VisaApproved",
- "source": "visaCheckSource"
- },
- {
- "name": "visaRejectedEvent",
- "type": "VisaRejected",
- "source": "visaCheckSource"
- }
- ],
- "states":[
- {
- "name":"CheckVisaStatus",
- "type":"switch",
- "eventConditions": [
- {
- "eventRef": "visaApprovedEvent",
- "transition": "HandleApprovedVisa"
- },
- {
- "eventRef": "visaRejectedEvent",
- "transition": "HandleRejectedVisa"
- }
- ],
- "eventTimeout": "PT1H",
- "default": {
- "transition": "HandleNoVisaDecision"
- }
- },
- {
- "name": "HandleApprovedVisa",
- "type": "subflow",
- "workflowId": "handleApprovedVisaWorkflowID",
- "end": true
- },
- {
- "name": "HandleRejectedVisa",
- "type": "subflow",
- "workflowId": "handleRejectedVisaWorkflowID",
- "end": true
- },
- {
- "name": "HandleNoVisaDecision",
- "type": "subflow",
- "workflowId": "handleNoVisaDecisionWorkfowId",
- "end": true
- }
- ]
-}
\ No newline at end of file
diff --git a/api/src/test/resources/examples/eventbasedtransition.yml b/api/src/test/resources/examples/eventbasedtransition.yml
deleted file mode 100644
index c00eef5d..00000000
--- a/api/src/test/resources/examples/eventbasedtransition.yml
+++ /dev/null
@@ -1,35 +0,0 @@
-id: eventbasedswitch
-version: '1.0'
-name: Event Based Switch Transitions
-description: Event Based Switch Transitions
-start: CheckVisaStatus
-events:
- - name: visaApprovedEvent
- type: VisaApproved
- source: visaCheckSource
- - name: visaRejectedEvent
- type: VisaRejected
- source: visaCheckSource
-states:
- - name: CheckVisaStatus
- type: switch
- eventConditions:
- - eventRef: visaApprovedEvent
- transition: HandleApprovedVisa
- - eventRef: visaRejectedEvent
- transition: HandleRejectedVisa
- eventTimeout: PT1H
- default:
- transition: HandleNoVisaDecision
- - name: HandleApprovedVisa
- type: subflow
- workflowId: handleApprovedVisaWorkflowID
- end: true
- - name: HandleRejectedVisa
- type: subflow
- workflowId: handleRejectedVisaWorkflowID
- end: true
- - name: HandleNoVisaDecision
- type: subflow
- workflowId: handleNoVisaDecisionWorkfowId
- end: true
\ No newline at end of file
diff --git a/api/src/test/resources/examples/finalizecollegeapplication.json b/api/src/test/resources/examples/finalizecollegeapplication.json
deleted file mode 100644
index 4df99b15..00000000
--- a/api/src/test/resources/examples/finalizecollegeapplication.json
+++ /dev/null
@@ -1,73 +0,0 @@
-{
- "id": "finalizeCollegeApplication",
- "name": "Finalize College Application",
- "version": "1.0",
- "start": "FinalizeApplication",
- "events": [
- {
- "name": "ApplicationSubmitted",
- "type": "org.application.submitted",
- "source": "applicationsource",
- "correlation": [
- {
- "contextAttributeName": "applicantId"
- }
- ]
- },
- {
- "name": "SATScoresReceived",
- "type": "org.application.satscores",
- "source": "applicationsource",
- "correlation": [
- {
- "contextAttributeName": "applicantId"
- }
- ]
- },
- {
- "name": "RecommendationLetterReceived",
- "type": "org.application.recommendationLetter",
- "source": "applicationsource",
- "correlation": [
- {
- "contextAttributeName": "applicantId"
- }
- ]
- }
- ],
- "functions": [
- {
- "name": "finalizeApplicationFunction",
- "operation": "http://myapis.org/collegeapplicationapi.json#finalize"
- }
- ],
- "states": [
- {
- "name": "FinalizeApplication",
- "type": "event",
- "exclusive": false,
- "onEvents": [
- {
- "eventRefs": [
- "ApplicationSubmitted",
- "SATScoresReceived",
- "RecommendationLetterReceived"
- ],
- "actions": [
- {
- "functionRef": {
- "refName": "finalizeApplicationFunction",
- "arguments": {
- "student": "${ .applicantId }"
- }
- }
- }
- ]
- }
- ],
- "end": {
- "terminate": true
- }
- }
- ]
-}
\ No newline at end of file
diff --git a/api/src/test/resources/examples/finalizecollegeapplication.yml b/api/src/test/resources/examples/finalizecollegeapplication.yml
deleted file mode 100644
index d84690ca..00000000
--- a/api/src/test/resources/examples/finalizecollegeapplication.yml
+++ /dev/null
@@ -1,39 +0,0 @@
-id: finalizeCollegeApplication
-name: Finalize College Application
-version: '1.0'
-start: FinalizeApplication
-events:
- - name: ApplicationSubmitted
- type: org.application.submitted
- source: applicationsource
- correlation:
- - contextAttributeName: applicantId
- - name: SATScoresReceived
- type: org.application.satscores
- source: applicationsource
- correlation:
- - contextAttributeName: applicantId
- - name: RecommendationLetterReceived
- type: org.application.recommendationLetter
- source: applicationsource
- correlation:
- - contextAttributeName: applicantId
-functions:
- - name: finalizeApplicationFunction
- operation: http://myapis.org/collegeapplicationapi.json#finalize
-states:
- - name: FinalizeApplication
- type: event
- exclusive: false
- onEvents:
- - eventRefs:
- - ApplicationSubmitted
- - SATScoresReceived
- - RecommendationLetterReceived
- actions:
- - functionRef:
- refName: finalizeApplicationFunction
- arguments:
- student: "${ .applicantId }"
- end:
- terminate: true
\ No newline at end of file
diff --git a/api/src/test/resources/examples/foreachstatewithactions.json b/api/src/test/resources/examples/foreachstatewithactions.json
deleted file mode 100644
index dca06385..00000000
--- a/api/src/test/resources/examples/foreachstatewithactions.json
+++ /dev/null
@@ -1,31 +0,0 @@
-{
- "id": "foreachstatewithactions",
- "name": "ForEach State With Actions",
- "description": "ForEach State With Actions",
- "version": "1.0",
- "functions": [
- {
- "name": "sendConfirmationFunction",
- "operation": "http://myapis.org/confirmationapi.json#sendConfirmation"
- }
- ],
- "states": [
- {
- "name":"SendConfirmationForEachCompletedhOrder",
- "type":"foreach",
- "inputCollection": "${ .orders[?(@.completed == true)] }",
- "iterationParam": "${ .completedorder }",
- "actions":[
- {
- "functionRef": {
- "refName": "sendConfirmationFunction",
- "arguments": {
- "orderNumber": "${ .completedorder.orderNumber }",
- "email": "${ .completedorder.email }"
- }
- }
- }],
- "end": true
- }
- ]
-}
\ No newline at end of file
diff --git a/api/src/test/resources/examples/foreachstatewithactions.yml b/api/src/test/resources/examples/foreachstatewithactions.yml
deleted file mode 100644
index 5dddc96a..00000000
--- a/api/src/test/resources/examples/foreachstatewithactions.yml
+++ /dev/null
@@ -1,20 +0,0 @@
----
-id: foreachstatewithactions
-name: ForEach State With Actions
-description: ForEach State With Actions
-version: '1.0'
-functions:
- - name: sendConfirmationFunction
- operation: http://myapis.org/confirmationapi.json#sendConfirmation
-states:
- - name: SendConfirmationForEachCompletedhOrder
- type: foreach
- inputCollection: "${ .orders[?(@.completed == true)] }"
- iterationParam: "${ .completedorder }"
- actions:
- - functionRef:
- refName: sendConfirmationFunction
- arguments:
- orderNumber: "${ .completedorder.orderNumber }"
- email: "${ .completedorder.email }"
- end: true
diff --git a/api/src/test/resources/examples/greeting.json b/api/src/test/resources/examples/greeting.json
deleted file mode 100644
index 3540cb6d..00000000
--- a/api/src/test/resources/examples/greeting.json
+++ /dev/null
@@ -1,33 +0,0 @@
-{
- "id": "greeting",
- "version": "1.0",
- "name": "Greeting Workflow",
- "description": "Greet Someone",
- "start": "Greet",
- "functions": [
- {
- "name": "greetingFunction",
- "operation": "file://myapis/greetingapis.json#greeting"
- }
- ],
- "states":[
- {
- "name":"Greet",
- "type":"operation",
- "actions":[
- {
- "functionRef": {
- "refName": "greetingFunction",
- "arguments": {
- "name": "${ .person.name }"
- }
- },
- "actionDataFilter": {
- "results": "${ .greeting }"
- }
- }
- ],
- "end": true
- }
- ]
-}
\ No newline at end of file
diff --git a/api/src/test/resources/examples/greeting.yml b/api/src/test/resources/examples/greeting.yml
deleted file mode 100644
index 8bbc8b4d..00000000
--- a/api/src/test/resources/examples/greeting.yml
+++ /dev/null
@@ -1,19 +0,0 @@
-id: greeting
-version: '1.0'
-name: Greeting Workflow
-description: Greet Someone
-start: Greet
-functions:
- - name: greetingFunction
- operation: file://myapis/greetingapis.json#greeting
-states:
- - name: Greet
- type: operation
- actions:
- - functionRef:
- refName: greetingFunction
- arguments:
- name: "${ .person.name }"
- actionDataFilter:
- results: "${ .greeting }"
- end: true
\ No newline at end of file
diff --git a/api/src/test/resources/examples/helloworld.json b/api/src/test/resources/examples/helloworld.json
deleted file mode 100644
index c1864a6d..00000000
--- a/api/src/test/resources/examples/helloworld.json
+++ /dev/null
@@ -1,17 +0,0 @@
-{
- "id": "helloworld",
- "version": "1.0",
- "name": "Hello World Workflow",
- "description": "Inject Hello World",
- "start": "Hello State",
- "states":[
- {
- "name":"Hello State",
- "type":"inject",
- "data": {
- "result": "Hello World!"
- },
- "end": true
- }
- ]
-}
\ No newline at end of file
diff --git a/api/src/test/resources/examples/helloworld.yml b/api/src/test/resources/examples/helloworld.yml
deleted file mode 100644
index 0d537603..00000000
--- a/api/src/test/resources/examples/helloworld.yml
+++ /dev/null
@@ -1,11 +0,0 @@
-id: helloworld
-version: '1.0'
-name: Hello World Workflow
-description: Inject Hello World
-start: Hello State
-states:
- - name: Hello State
- type: inject
- data:
- result: Hello World!
- end: true
\ No newline at end of file
diff --git a/api/src/test/resources/examples/jobmonitoring.json b/api/src/test/resources/examples/jobmonitoring.json
deleted file mode 100644
index 1eeba8a0..00000000
--- a/api/src/test/resources/examples/jobmonitoring.json
+++ /dev/null
@@ -1,138 +0,0 @@
-{
- "id": "jobmonitoring",
- "version": "1.0",
- "name": "Job Monitoring",
- "description": "Monitor finished execution of a submitted job",
- "start": "SubmitJob",
- "functions": [
- {
- "name": "submitJob",
- "operation": "http://myapis.org/monitorapi.json#doSubmit"
- },
- {
- "name": "checkJobStatus",
- "operation": "http://myapis.org/monitorapi.json#checkStatus"
- },
- {
- "name": "reportJobSuceeded",
- "operation": "http://myapis.org/monitorapi.json#reportSucceeded"
- },
- {
- "name": "reportJobFailed",
- "operation": "http://myapis.org/monitorapi.json#reportFailure"
- }
- ],
- "states":[
- {
- "name":"SubmitJob",
- "type":"operation",
- "actionMode":"sequential",
- "actions":[
- {
- "functionRef": {
- "refName": "submitJob",
- "arguments": {
- "name": "${ .job.name }"
- }
- },
- "actionDataFilter": {
- "results": "${ .jobuid }"
- }
- }
- ],
- "onErrors": [
- {
- "error": "*",
- "transition": "SubmitError"
- }
- ],
- "stateDataFilter": {
- "output": "${ .jobuid }"
- },
- "transition": "WaitForCompletion"
- },
- {
- "name": "SubmitError",
- "type": "subflow",
- "workflowId": "handleJobSubmissionErrorWorkflow",
- "end": true
- },
- {
- "name": "WaitForCompletion",
- "type": "delay",
- "timeDelay": "PT5S",
- "transition": "GetJobStatus"
- },
- {
- "name":"GetJobStatus",
- "type":"operation",
- "actionMode":"sequential",
- "actions":[
- {
- "functionRef": {
- "refName": "checkJobStatus",
- "arguments": {
- "name": "${ .jobuid }"
- }
- },
- "actionDataFilter": {
- "results": "${ .jobstatus }"
- }
- }
- ],
- "stateDataFilter": {
- "output": "${ .jobstatus }"
- },
- "transition": "DetermineCompletion"
- },
- {
- "name":"DetermineCompletion",
- "type":"switch",
- "dataConditions": [
- {
- "condition": "${ .jobStatus == \"SUCCEEDED\" }",
- "transition": "JobSucceeded"
- },
- {
- "condition": "${ .jobStatus == \"FAILED\" }",
- "transition": "JobFailed"
- }
- ],
- "default": {
- "transition": "WaitForCompletion"
- }
- },
- {
- "name":"JobSucceeded",
- "type":"operation",
- "actionMode":"sequential",
- "actions":[
- {
- "functionRef": {
- "refName": "reportJobSuceeded",
- "arguments": {
- "name": "${ .jobuid }"
- }
- }
- }
- ],
- "end": true
- },
- {
- "name":"JobFailed",
- "type":"operation",
- "actionMode":"sequential",
- "actions":[
- {
- "functionRef": {
- "refName": "reportJobFailed",
- "arguments": {
- "name": "${ .jobuid }"
- }
- }
- }
- ],
- "end": true
- }
- ]
-}
\ No newline at end of file
diff --git a/api/src/test/resources/examples/jobmonitoring.yml b/api/src/test/resources/examples/jobmonitoring.yml
deleted file mode 100644
index 5f30b08e..00000000
--- a/api/src/test/resources/examples/jobmonitoring.yml
+++ /dev/null
@@ -1,79 +0,0 @@
-id: jobmonitoring
-version: '1.0'
-name: Job Monitoring
-description: Monitor finished execution of a submitted job
-start: SubmitJob
-functions:
- - name: submitJob
- operation: http://myapis.org/monitorapi.json#doSubmit
- - name: checkJobStatus
- operation: http://myapis.org/monitorapi.json#checkStatus
- - name: reportJobSuceeded
- operation: http://myapis.org/monitorapi.json#reportSucceeded
- - name: reportJobFailed
- operation: http://myapis.org/monitorapi.json#reportFailure
-states:
- - name: SubmitJob
- type: operation
- actionMode: sequential
- actions:
- - functionRef:
- refName: submitJob
- arguments:
- name: "${ .job.name }"
- actionDataFilter:
- results: "${ .jobuid }"
- onErrors:
- - error: "*"
- transition: SubmitError
- stateDataFilter:
- output: "${ .jobuid }"
- transition: WaitForCompletion
- - name: SubmitError
- type: subflow
- workflowId: handleJobSubmissionErrorWorkflow
- end: true
- - name: WaitForCompletion
- type: delay
- timeDelay: PT5S
- transition: GetJobStatus
- - name: GetJobStatus
- type: operation
- actionMode: sequential
- actions:
- - functionRef:
- refName: checkJobStatus
- arguments:
- name: "${ .jobuid }"
- actionDataFilter:
- results: "${ .jobstatus }"
- stateDataFilter:
- output: "${ .jobstatus }"
- transition: DetermineCompletion
- - name: DetermineCompletion
- type: switch
- dataConditions:
- - condition: "${ .jobstatus == \"SUCCEEDED\" }"
- transition: JobSucceeded
- - condition: "${ .jobstatus == \"FAILED\" }"
- transition: JobFailed
- default:
- transition: WaitForCompletion
- - name: JobSucceeded
- type: operation
- actionMode: sequential
- actions:
- - functionRef:
- refName: reportJobSuceeded
- arguments:
- name: "${ .jobuid }"
- end: true
- - name: JobFailed
- type: operation
- actionMode: sequential
- actions:
- - functionRef:
- refName: reportJobFailed
- arguments:
- name: "${ .jobuid }"
- end: true
\ No newline at end of file
diff --git a/api/src/test/resources/examples/monitorpatient.json b/api/src/test/resources/examples/monitorpatient.json
deleted file mode 100644
index ab216b60..00000000
--- a/api/src/test/resources/examples/monitorpatient.json
+++ /dev/null
@@ -1,95 +0,0 @@
-{
- "id": "patientVitalsWorkflow",
- "name": "Monitor Patient Vitals",
- "version": "1.0",
- "start": "MonitorVitals",
- "events": [
- {
- "name": "HighBodyTemperature",
- "type": "org.monitor.highBodyTemp",
- "source": "monitoringSource",
- "correlation": [
- {
- "contextAttributeName": "patientId"
- }
- ]
- },
- {
- "name": "HighBloodPressure",
- "type": "org.monitor.highBloodPressure",
- "source": "monitoringSource",
- "correlation": [
- {
- "contextAttributeName": "patientId"
- }
- ]
- },
- {
- "name": "HighRespirationRate",
- "type": "org.monitor.highRespirationRate",
- "source": "monitoringSource",
- "correlation": [
- {
- "contextAttributeName": "patientId"
- }
- ]
- }
- ],
- "functions": [
- {
- "name": "callPulmonologist",
- "operation": "http://myapis.org/patientapis.json#callPulmonologist"
- },
- {
- "name": "sendTylenolOrder",
- "operation": "http://myapis.org/patientapis.json#tylenolOrder"
- },
- {
- "name": "callNurse",
- "operation": "http://myapis.org/patientapis.json#callNurse"
- }
- ],
- "states": [
- {
- "name": "MonitorVitals",
- "type": "event",
- "exclusive": true,
- "onEvents": [{
- "eventRefs": ["HighBodyTemperature"],
- "actions": [{
- "functionRef": {
- "refName": "sendTylenolOrder",
- "arguments": {
- "patientid": "${ .patientId }"
- }
- }
- }]
- },
- {
- "eventRefs": ["HighBloodPressure"],
- "actions": [{
- "functionRef": {
- "refName": "callNurse",
- "arguments": {
- "patientid": "${ .patientId }"
- }
- }
- }]
- },
- {
- "eventRefs": ["HighRespirationRate"],
- "actions": [{
- "functionRef": {
- "refName": "callPulmonologist",
- "arguments": {
- "patientid": "${ .patientId }"
- }
- }
- }]
- }
- ],
- "end": {
- "terminate": true
- }
- }]
-}
\ No newline at end of file
diff --git a/api/src/test/resources/examples/monitorpatient.yml b/api/src/test/resources/examples/monitorpatient.yml
deleted file mode 100644
index 0db0aff8..00000000
--- a/api/src/test/resources/examples/monitorpatient.yml
+++ /dev/null
@@ -1,55 +0,0 @@
-id: patientVitalsWorkflow
-name: Monitor Patient Vitals
-version: '1.0'
-start: Monitor Vitals
-events:
- - name: HighBodyTemperature
- type: org.monitor.highBodyTemp
- source: monitoringSource
- correlation:
- - contextAttributeName: patientId
- - name: HighBloodPressure
- type: org.monitor.highBloodPressure
- source: monitoringSource
- correlation:
- - contextAttributeName: patientId
- - name: HighRespirationRate
- type: org.monitor.highRespirationRate
- source: monitoringSource
- correlation:
- - contextAttributeName: patientId
-functions:
- - name: callPulmonologist
- operation: http://myapis.org/patientapis.json#callPulmonologist
- - name: sendTylenolOrder
- operation: http://myapis.org/patientapis.json#tylenolOrder
- - name: callNurse
- operation: http://myapis.org/patientapis.json#callNurse
-states:
- - name: MonitorVitals
- type: event
- exclusive: true
- onEvents:
- - eventRefs:
- - HighBodyTemperature
- actions:
- - functionRef:
- refName: sendTylenolOrder
- arguments:
- patientid: "${ .patientId }"
- - eventRefs:
- - HighBloodPressure
- actions:
- - functionRef:
- refName: callNurse
- arguments:
- patientid: "${ .patientId }"
- - eventRefs:
- - HighRespirationRate
- actions:
- - functionRef:
- refName: callPulmonologist
- arguments:
- patientid: "${ .patientId }"
- end:
- terminate: true
\ No newline at end of file
diff --git a/api/src/test/resources/examples/parallel.json b/api/src/test/resources/examples/parallel.json
deleted file mode 100644
index cb50c8fc..00000000
--- a/api/src/test/resources/examples/parallel.json
+++ /dev/null
@@ -1,25 +0,0 @@
-{
- "id": "parallelexec",
- "version": "1.0",
- "name": "Parallel Execution Workflow",
- "description": "Executes two branches in parallel",
- "start": "ParallelExec",
- "states":[
- {
- "name": "ParallelExec",
- "type": "parallel",
- "completionType": "and",
- "branches": [
- {
- "name": "ShortDelayBranch",
- "workflowId": "shortdelayworkflowid"
- },
- {
- "name": "LongDelayBranch",
- "workflowId": "longdelayworkflowid"
- }
- ],
- "end": true
- }
- ]
-}
\ No newline at end of file
diff --git a/api/src/test/resources/examples/parallel.yml b/api/src/test/resources/examples/parallel.yml
deleted file mode 100644
index 49536973..00000000
--- a/api/src/test/resources/examples/parallel.yml
+++ /dev/null
@@ -1,15 +0,0 @@
-id: parallelexec
-version: '1.0'
-name: Parallel Execution Workflow
-description: Executes two branches in parallel
-start: ParallelExec
-states:
- - name: ParallelExec
- type: parallel
- completionType: and
- branches:
- - name: ShortDelayBranch
- workflowId: shortdelayworkflowid
- - name: LongDelayBranch
- workflowId: longdelayworkflowid
- end: true
\ No newline at end of file
diff --git a/api/src/test/resources/examples/periodicinboxcheck.json b/api/src/test/resources/examples/periodicinboxcheck.json
deleted file mode 100644
index 5e20c30e..00000000
--- a/api/src/test/resources/examples/periodicinboxcheck.json
+++ /dev/null
@@ -1,52 +0,0 @@
-{
- "id": "checkInbox",
- "name": "Check Inbox Workflow",
- "description": "Periodically Check Inbox",
- "start": {
- "stateName": "CheckInbox",
- "schedule": {
- "cron": "0 0/15 * * * ?"
- }
- },
- "version": "1.0",
- "functions": [
- {
- "name": "checkInboxFunction",
- "operation": "http://myapis.org/inboxapi.json#checkNewMessages"
- },
- {
- "name": "sendTextFunction",
- "operation": "http://myapis.org/inboxapi.json#sendText"
- }
- ],
- "states": [
- {
- "name": "CheckInbox",
- "type": "operation",
- "actionMode": "sequential",
- "actions": [
- {
- "functionRef": "checkInboxFunction"
- }
- ],
- "transition": "SendTextForHighPriority"
- },
- {
- "name": "SendTextForHighPriority",
- "type": "foreach",
- "inputCollection": "${ .messages }",
- "iterationParam": "singlemessage",
- "actions": [
- {
- "functionRef": {
- "refName": "sendTextFunction",
- "arguments": {
- "message": "${ .singlemessage }"
- }
- }
- }
- ],
- "end": true
- }
- ]
-}
\ No newline at end of file
diff --git a/api/src/test/resources/examples/periodicinboxcheck.yml b/api/src/test/resources/examples/periodicinboxcheck.yml
deleted file mode 100644
index 1d7de0bb..00000000
--- a/api/src/test/resources/examples/periodicinboxcheck.yml
+++ /dev/null
@@ -1,30 +0,0 @@
-id: checkInbox
-name: Check Inbox Workflow
-description: Periodically Check Inbox
-start:
- stateName: CheckInbox
- schedule:
- cron: 0 0/15 * * * ?
-version: '1.0'
-functions:
- - name: checkInboxFunction
- operation: http://myapis.org/inboxapi.json#checkNewMessages
- - name: sendTextFunction
- operation: http://myapis.org/inboxapi.json#sendText
-states:
- - name: CheckInbox
- type: operation
- actionMode: sequential
- actions:
- - functionRef: checkInboxFunction
- transition: SendTextForHighPriority
- - name: SendTextForHighPriority
- type: foreach
- inputCollection: "${ .messages }"
- iterationParam: singlemessage
- actions:
- - functionRef:
- refName: sendTextFunction
- arguments:
- message: "${ .singlemessage }"
- end: true
\ No newline at end of file
diff --git a/api/src/test/resources/examples/provisionorder.json b/api/src/test/resources/examples/provisionorder.json
deleted file mode 100644
index 1fb59102..00000000
--- a/api/src/test/resources/examples/provisionorder.json
+++ /dev/null
@@ -1,72 +0,0 @@
-{
- "id": "provisionorders",
- "version": "1.0",
- "name": "Provision Orders",
- "description": "Provision Orders and handle errors thrown",
- "start": "ProvisionOrder",
- "functions": [
- {
- "name": "provisionOrderFunction",
- "operation": "http://myapis.org/provisioningapi.json#doProvision"
- }
- ],
- "states":[
- {
- "name":"ProvisionOrder",
- "type":"operation",
- "actionMode":"sequential",
- "actions":[
- {
- "functionRef": {
- "refName": "provisionOrderFunction",
- "arguments": {
- "order": "${ .order }"
- }
- }
- }
- ],
- "stateDataFilter": {
- "output": "${ .exceptions }"
- },
- "transition": "ApplyOrder",
- "onErrors": [
- {
- "error": "Missing order id",
- "transition": "MissingId"
- },
- {
- "error": "Missing order item",
- "transition": "MissingItem"
- },
- {
- "error": "Missing order quantity",
- "transition": "MissingQuantity"
- }
- ]
- },
- {
- "name": "MissingId",
- "type": "subflow",
- "workflowId": "handleMissingIdExceptionWorkflow",
- "end": true
- },
- {
- "name": "MissingItem",
- "type": "subflow",
- "workflowId": "handleMissingItemExceptionWorkflow",
- "end": true
- },
- {
- "name": "MissingQuantity",
- "type": "subflow",
- "workflowId": "handleMissingQuantityExceptionWorkflow",
- "end": true
- },
- {
- "name": "ApplyOrder",
- "type": "subflow",
- "workflowId": "applyOrderWorkflowId",
- "end": true
- }
- ]
-}
\ No newline at end of file
diff --git a/api/src/test/resources/examples/provisionorder.yml b/api/src/test/resources/examples/provisionorder.yml
deleted file mode 100644
index b8eff2be..00000000
--- a/api/src/test/resources/examples/provisionorder.yml
+++ /dev/null
@@ -1,43 +0,0 @@
-id: provisionorders
-version: '1.0'
-name: Provision Orders
-description: Provision Orders and handle errors thrown
-start: ProvisionOrder
-functions:
- - name: provisionOrderFunction
- operation: http://myapis.org/provisioningapi.json#doProvision
-states:
- - name: ProvisionOrder
- type: operation
- actionMode: sequential
- actions:
- - functionRef:
- refName: provisionOrderFunction
- arguments:
- order: "${ .order }"
- stateDataFilter:
- output: "${ .exceptions }"
- transition: ApplyOrder
- onErrors:
- - error: Missing order id
- transition: MissingId
- - error: Missing order item
- transition: MissingItem
- - error: Missing order quantity
- transition: MissingQuantity
- - name: MissingId
- type: subflow
- workflowId: handleMissingIdExceptionWorkflow
- end: true
- - name: MissingItem
- type: subflow
- workflowId: handleMissingItemExceptionWorkflow
- end: true
- - name: MissingQuantity
- type: subflow
- workflowId: handleMissingQuantityExceptionWorkflow
- end: true
- - name: ApplyOrder
- type: subflow
- workflowId: applyOrderWorkflowId
- end: true
\ No newline at end of file
diff --git a/api/src/test/resources/examples/roomreadings.json b/api/src/test/resources/examples/roomreadings.json
deleted file mode 100644
index aab4f25d..00000000
--- a/api/src/test/resources/examples/roomreadings.json
+++ /dev/null
@@ -1,82 +0,0 @@
-{
- "id": "roomreadings",
- "name": "Room Temp and Humidity Workflow",
- "version": "1.0",
- "start": "ConsumeReading",
- "execTimeout": {
- "duration": "PT1H",
- "runBefore": "GenerateReport"
- },
- "keepActive": true,
- "states": [
- {
- "name": "ConsumeReading",
- "type": "event",
- "onEvents": [
- {
- "eventRefs": ["TemperatureEvent", "HumidityEvent"],
- "actions": [
- {
- "functionRef": {
- "refName": "LogReading"
- }
- }
- ],
- "eventDataFilter": {
- "data": "${ .readings }"
- }
- }
- ],
- "end": true
- },
- {
- "name": "GenerateReport",
- "type": "operation",
- "actions": [
- {
- "functionRef": {
- "refName": "ProduceReport",
- "arguments": {
- "data": "${ .readings }"
- }
- }
- }
- ],
- "end": {
- "terminate": true
- }
- }
- ],
- "events": [
- {
- "name": "TemperatureEvent",
- "type": "my.home.sensors",
- "source": "/home/rooms/+",
- "correlation": [
- {
- "contextAttributeName": "roomId"
- }
- ]
- },
- {
- "name": "HumidityEvent",
- "type": "my.home.sensors",
- "source": "/home/rooms/+",
- "correlation": [
- {
- "contextAttributeName": "roomId"
- }
- ]
- }
- ],
- "functions": [
- {
- "name": "LogReading",
- "operation": "http.myorg.io/ordersservices.json#logreading"
- },
- {
- "name": "ProduceReport",
- "operation": "http.myorg.io/ordersservices.json#produceReport"
- }
- ]
-}
\ No newline at end of file
diff --git a/api/src/test/resources/examples/roomreadings.yml b/api/src/test/resources/examples/roomreadings.yml
deleted file mode 100644
index cfbf2e82..00000000
--- a/api/src/test/resources/examples/roomreadings.yml
+++ /dev/null
@@ -1,46 +0,0 @@
-id: roomreadings
-name: Room Temp and Humidity Workflow
-version: '1.0'
-start: ConsumeReading
-execTimeout:
- duration: PT1H
- runBefore: GenerateReport
-keepActive: true
-states:
- - name: ConsumeReading
- type: event
- onEvents:
- - eventRefs:
- - TemperatureEvent
- - HumidityEvent
- actions:
- - functionRef:
- refName: LogReading
- eventDataFilter:
- data: "${ .readings }"
- end: true
- - name: GenerateReport
- type: operation
- actions:
- - functionRef:
- refName: ProduceReport
- arguments:
- data: "${ .readings }"
- end:
- terminate: true
-events:
- - name: TemperatureEvent
- type: my.home.sensors
- source: "/home/rooms/+"
- correlation:
- - contextAttributeName: roomId
- - name: HumidityEvent
- type: my.home.sensors
- source: "/home/rooms/+"
- correlation:
- - contextAttributeName: roomId
-functions:
- - name: LogReading
- operation: http.myorg.io/ordersservices.json#logreading
- - name: ProduceReport
- operation: http.myorg.io/ordersservices.json#produceReport
\ No newline at end of file
diff --git a/api/src/test/resources/examples/sendcloudevent.json b/api/src/test/resources/examples/sendcloudevent.json
deleted file mode 100644
index 5b94fc11..00000000
--- a/api/src/test/resources/examples/sendcloudevent.json
+++ /dev/null
@@ -1,44 +0,0 @@
-{
- "id": "sendcloudeventonprovision",
- "version": "1.0",
- "name": "Send CloudEvent on provision completion",
- "start": "ProvisionOrdersState",
- "events": [
- {
- "name": "provisioningCompleteEvent",
- "type": "provisionCompleteType",
- "kind": "produced"
- }
- ],
- "functions": [
- {
- "name": "provisionOrderFunction",
- "operation": "http://myapis.org/provisioning.json#doProvision"
- }
- ],
- "states": [
- {
- "name": "ProvisionOrdersState",
- "type": "foreach",
- "inputCollection": "${ .orders }",
- "iterationParam": "singleorder",
- "outputCollection": "${ .provisionedOrders }",
- "actions": [
- {
- "functionRef": {
- "refName": "provisionOrderFunction",
- "arguments": {
- "order": "${ .singleorder }"
- }
- }
- }
- ],
- "end": {
- "produceEvents": [{
- "eventRef": "provisioningCompleteEvent",
- "data": "${ .provisionedOrders }"
- }]
- }
- }
- ]
-}
\ No newline at end of file
diff --git a/api/src/test/resources/examples/sendcloudevent.yml b/api/src/test/resources/examples/sendcloudevent.yml
deleted file mode 100644
index 1359fb10..00000000
--- a/api/src/test/resources/examples/sendcloudevent.yml
+++ /dev/null
@@ -1,26 +0,0 @@
-id: sendcloudeventonprovision
-version: '1.0'
-name: Send CloudEvent on provision completion
-start: ProvisionOrdersState
-events:
- - name: provisioningCompleteEvent
- type: provisionCompleteType
- kind: produced
-functions:
- - name: provisionOrderFunction
- operation: http://myapis.org/provisioning.json#doProvision
-states:
- - name: ProvisionOrdersState
- type: foreach
- inputCollection: "${ .orders }"
- iterationParam: singleorder
- outputCollection: "${ .provisionedOrders }"
- actions:
- - functionRef:
- refName: provisionOrderFunction
- arguments:
- order: "${ .singleorder }"
- end:
- produceEvents:
- - eventRef: provisioningCompleteEvent
- data: "${ .provisionedOrders }"
\ No newline at end of file
diff --git a/api/src/test/resources/examples/solvemathproblems.json b/api/src/test/resources/examples/solvemathproblems.json
deleted file mode 100644
index 25e00e33..00000000
--- a/api/src/test/resources/examples/solvemathproblems.json
+++ /dev/null
@@ -1,36 +0,0 @@
-{
- "id": "solvemathproblems",
- "version": "1.0",
- "name": "Solve Math Problems Workflow",
- "description": "Solve math problems",
- "start": "Solve",
- "functions": [
- {
- "name": "solveMathExpressionFunction",
- "operation": "http://myapis.org/mapthapis.json#solveExpression"
- }
- ],
- "states":[
- {
- "name":"Solve",
- "type":"foreach",
- "inputCollection": "${ .expressions }",
- "iterationParam": "singleexpression",
- "outputCollection": "${ .results }",
- "actions":[
- {
- "functionRef": {
- "refName": "solveMathExpressionFunction",
- "arguments": {
- "expression": "${ .singleexpression }"
- }
- }
- }
- ],
- "stateDataFilter": {
- "output": "${ .results }"
- },
- "end": true
- }
- ]
-}
\ No newline at end of file
diff --git a/api/src/test/resources/examples/solvemathproblems.yml b/api/src/test/resources/examples/solvemathproblems.yml
deleted file mode 100644
index b7bd1e27..00000000
--- a/api/src/test/resources/examples/solvemathproblems.yml
+++ /dev/null
@@ -1,22 +0,0 @@
-id: solvemathproblems
-version: '1.0'
-name: Solve Math Problems Workflow
-description: Solve math problems
-start: Solve
-functions:
- - name: solveMathExpressionFunction
- operation: http://myapis.org/mapthapis.json#solveExpression
-states:
- - name: Solve
- type: foreach
- inputCollection: "${ .expressions }"
- iterationParam: singleexpression
- outputCollection: "${ .results }"
- actions:
- - functionRef:
- refName: solveMathExpressionFunction
- arguments:
- expression: "${ .singleexpression }"
- stateDataFilter:
- output: "${ .results }"
- end: true
\ No newline at end of file
diff --git a/api/src/test/resources/examples/vetappointmentservice.json b/api/src/test/resources/examples/vetappointmentservice.json
deleted file mode 100644
index 230e0f73..00000000
--- a/api/src/test/resources/examples/vetappointmentservice.json
+++ /dev/null
@@ -1,40 +0,0 @@
-{
- "id": "VetAppointmentWorkflow",
- "name": "Vet Appointment Workflow",
- "description": "Vet service call via events",
- "version": "1.0",
- "start": "MakeVetAppointmentState",
- "events": [
- {
- "name": "MakeVetAppointment",
- "source": "VetServiceSoure",
- "kind": "produced"
- },
- {
- "name": "VetAppointmentInfo",
- "source": "VetServiceSource",
- "kind": "consumed"
- }
- ],
- "states": [
- {
- "name": "MakeVetAppointmentState",
- "type": "operation",
- "actions": [
- {
- "name": "MakeAppointmentAction",
- "eventRef": {
- "triggerEventRef": "MakeVetAppointment",
- "data": "${ .patientInfo }",
- "resultEventRef": "VetAppointmentInfo"
- },
- "actionDataFilter": {
- "results": "${ .appointmentInfo }"
- },
- "timeout": "PT15M"
- }
- ],
- "end": true
- }
- ]
-}
\ No newline at end of file
diff --git a/api/src/test/resources/examples/vetappointmentservice.yml b/api/src/test/resources/examples/vetappointmentservice.yml
deleted file mode 100644
index d976067e..00000000
--- a/api/src/test/resources/examples/vetappointmentservice.yml
+++ /dev/null
@@ -1,25 +0,0 @@
-id: VetAppointmentWorkflow
-name: Vet Appointment Workflow
-description: Vet service call via events
-version: '1.0'
-start: MakeVetAppointmentState
-events:
- - name: MakeVetAppointment
- source: VetServiceSoure
- kind: produced
- - name: VetAppointmentInfo
- source: VetServiceSource
- kind: consumed
-states:
- - name: MakeVetAppointmentState
- type: operation
- actions:
- - name: MakeAppointmentAction
- eventRef:
- triggerEventRef: MakeVetAppointment
- data: "${ .patientInfo }"
- resultEventRef: VetAppointmentInfo
- actionDataFilter:
- results: "${ .appointmentInfo }"
- timeout: PT15M
- end: true
\ No newline at end of file
diff --git a/api/src/test/resources/features/applicantrequest.json b/api/src/test/resources/features/applicantrequest.json
deleted file mode 100644
index 653667ef..00000000
--- a/api/src/test/resources/features/applicantrequest.json
+++ /dev/null
@@ -1,58 +0,0 @@
-{
- "id": "applicantrequest",
- "version": "1.0",
- "name": "Applicant Request Decision Workflow",
- "start": "CheckApplication",
- "description": "Determine if applicant request is valid",
- "functions": "features/applicantrequestfunctions.json",
- "retries": "features/applicantrequestretries.json",
- "states":[
- {
- "name":"CheckApplication",
- "type":"switch",
- "dataConditions": [
- {
- "condition": "${ .applicants[?(@.age >= 18)] }",
- "transition": "StartApplication"
- },
- {
- "condition": "${ .applicants[?(@.age < 18)] }",
- "transition": "RejectApplication"
- }
- ],
- "default": {
- "transition": "RejectApplication"
- }
- },
- {
- "name": "StartApplication",
- "type": "subflow",
- "workflowId": "startApplicationWorkflowId",
- "end": true
- },
- {
- "name":"RejectApplication",
- "type":"operation",
- "actionMode":"sequential",
- "actions":[
- {
- "functionRef": {
- "refName": "sendRejectionEmailFunction",
- "arguments": {
- "applicant": "${ .applicant }"
- }
- }
- }
- ],
- "onErrors": [
- {
- "error": "TimeoutError",
- "code": "500",
- "retryRef": "TimeoutRetryStrategy",
- "end": true
- }
- ],
- "end": true
- }
- ]
-}
\ No newline at end of file
diff --git a/api/src/test/resources/features/applicantrequest.yml b/api/src/test/resources/features/applicantrequest.yml
deleted file mode 100644
index 35f2b59f..00000000
--- a/api/src/test/resources/features/applicantrequest.yml
+++ /dev/null
@@ -1,35 +0,0 @@
-id: applicantrequest
-version: '1.0'
-start: CheckApplication
-name: Applicant Request Decision Workflow
-description: Determine if applicant request is valid
-functions: features/applicantrequestfunctions.yml
-retries: features/applicantrequestretries.yml
-states:
- - name: CheckApplication
- type: switch
- dataConditions:
- - condition: "${ .applicants[?(@.age >= 18)] }"
- transition: StartApplication
- - condition: "${ .applicants[?(@.age < 18)] }"
- transition: RejectApplication
- default:
- transition: RejectApplication
- - name: StartApplication
- type: subflow
- workflowId: startApplicationWorkflowId
- end: true
- - name: RejectApplication
- type: operation
- actionMode: sequential
- actions:
- - functionRef:
- refName: sendRejectionEmailFunction
- arguments:
- applicant: "${ .applicant }"
- onErrors:
- - error: TimeoutError
- code: '500'
- retryRef: TimeoutRetryStrategy
- end: true
- end: true
diff --git a/api/src/test/resources/features/applicantrequestfunctions.json b/api/src/test/resources/features/applicantrequestfunctions.json
deleted file mode 100644
index bafc861b..00000000
--- a/api/src/test/resources/features/applicantrequestfunctions.json
+++ /dev/null
@@ -1,8 +0,0 @@
-{
- "functions": [
- {
- "name": "sendRejectionEmailFunction",
- "operation": "http://myapis.org/application.json#emailRejection"
- }
- ]
-}
\ No newline at end of file
diff --git a/api/src/test/resources/features/applicantrequestfunctions.yml b/api/src/test/resources/features/applicantrequestfunctions.yml
deleted file mode 100644
index a1e90f93..00000000
--- a/api/src/test/resources/features/applicantrequestfunctions.yml
+++ /dev/null
@@ -1,3 +0,0 @@
-functions:
- - name: sendRejectionEmailFunction
- operation: http://myapis.org/application.json#emailRejection
diff --git a/api/src/test/resources/features/applicantrequestretries.json b/api/src/test/resources/features/applicantrequestretries.json
deleted file mode 100644
index 40f83b55..00000000
--- a/api/src/test/resources/features/applicantrequestretries.json
+++ /dev/null
@@ -1,9 +0,0 @@
-{
- "retries": [
- {
- "name": "TimeoutRetryStrategy",
- "delay": "PT1M",
- "maxAttempts": "5"
- }
- ]
-}
\ No newline at end of file
diff --git a/api/src/test/resources/features/applicantrequestretries.yml b/api/src/test/resources/features/applicantrequestretries.yml
deleted file mode 100644
index fa4c810d..00000000
--- a/api/src/test/resources/features/applicantrequestretries.yml
+++ /dev/null
@@ -1,4 +0,0 @@
-retries:
- - name: TimeoutRetryStrategy
- delay: PT1M
- maxAttempts: '5'
diff --git a/api/src/test/resources/features/authentication-bearer-uri-format.yaml b/api/src/test/resources/features/authentication-bearer-uri-format.yaml
new file mode 100644
index 00000000..b0019fbb
--- /dev/null
+++ b/api/src/test/resources/features/authentication-bearer-uri-format.yaml
@@ -0,0 +1,15 @@
+document:
+ dsl: '1.0.0-alpha5'
+ namespace: examples
+ name: bearer-auth
+ version: '0.1.0'
+do:
+ - getPet:
+ call: http
+ with:
+ method: get
+ endpoint:
+ uri: https://petstore.swagger.io/v2/pet/{petId}
+ authentication:
+ bearer:
+ token: ${ .token }
diff --git a/api/src/test/resources/features/authentication-bearer.yaml b/api/src/test/resources/features/authentication-bearer.yaml
new file mode 100644
index 00000000..f0c42741
--- /dev/null
+++ b/api/src/test/resources/features/authentication-bearer.yaml
@@ -0,0 +1,15 @@
+document:
+ dsl: '1.0.0-alpha5'
+ namespace: examples
+ name: bearer-auth-uri-format
+ version: '0.1.0'
+do:
+ - getPet:
+ call: http
+ with:
+ method: get
+ endpoint:
+ uri: https://petstore.swagger.io/v2/pet/1
+ authentication:
+ bearer:
+ token: ${ .token }
\ No newline at end of file
diff --git a/api/src/test/resources/features/authentication-oauth2-secret.yaml b/api/src/test/resources/features/authentication-oauth2-secret.yaml
new file mode 100644
index 00000000..635076ab
--- /dev/null
+++ b/api/src/test/resources/features/authentication-oauth2-secret.yaml
@@ -0,0 +1,18 @@
+document:
+ dsl: 1.0.0-alpha1
+ namespace: examples
+ name: oauth2-authentication
+ version: 1.0.0-alpha1
+use:
+ secrets:
+ - mySecret
+do:
+ - getPet:
+ call: http
+ with:
+ method: get
+ endpoint:
+ uri: https://petstore.swagger.io/v2/pet/{petId}
+ authentication:
+ oauth2:
+ use: mySecret
\ No newline at end of file
diff --git a/api/src/test/resources/features/authentication-oauth2.yaml b/api/src/test/resources/features/authentication-oauth2.yaml
new file mode 100644
index 00000000..625a1e2c
--- /dev/null
+++ b/api/src/test/resources/features/authentication-oauth2.yaml
@@ -0,0 +1,22 @@
+document:
+ dsl: '1.0.0-alpha5'
+ namespace: examples
+ name: oauth2-authentication
+ version: '0.1.0'
+do:
+ - getPet:
+ call: http
+ with:
+ method: get
+ endpoint:
+ uri: https://petstore.swagger.io/v2/pet/{petId}
+ authentication:
+ oauth2:
+ authority: http://keycloak/realms/fake-authority
+ endpoints: #optional
+ token: /auth/token #defaults to /oauth2/token
+ introspection: /auth/introspect #defaults to /oauth2/introspect
+ grant: client_credentials
+ client:
+ id: workflow-runtime-id
+ secret: workflow-runtime-secret
\ No newline at end of file
diff --git a/api/src/test/resources/features/authentication-oidc-secret.yaml b/api/src/test/resources/features/authentication-oidc-secret.yaml
new file mode 100644
index 00000000..19c387c1
--- /dev/null
+++ b/api/src/test/resources/features/authentication-oidc-secret.yaml
@@ -0,0 +1,18 @@
+document:
+ dsl: 1.0.0-alpha1
+ namespace: examples
+ name: oidc-authentication
+ version: 1.0.0-alpha1
+use:
+ secrets:
+ - mySecret
+do:
+ - getPet:
+ call: http
+ with:
+ method: get
+ endpoint:
+ uri: https://petstore.swagger.io/v2/pet/{petId}
+ authentication:
+ oidc:
+ use: mySecret
\ No newline at end of file
diff --git a/api/src/test/resources/features/authentication-oidc.yaml b/api/src/test/resources/features/authentication-oidc.yaml
new file mode 100644
index 00000000..18aec74d
--- /dev/null
+++ b/api/src/test/resources/features/authentication-oidc.yaml
@@ -0,0 +1,19 @@
+document:
+ dsl: '1.0.0-alpha5'
+ namespace: examples
+ name: oidc-authentication
+ version: '0.1.0'
+do:
+ - getPet:
+ call: http
+ with:
+ method: get
+ endpoint:
+ uri: https://petstore.swagger.io/v2/pet/{petId}
+ authentication:
+ oidc:
+ authority: http://keycloak/realms/fake-authority #endpoints are resolved using the OIDC configuration located at '/.well-known/openid-configuration'
+ grant: client_credentials
+ client:
+ id: workflow-runtime-id
+ secret: workflow-runtime-secret
\ No newline at end of file
diff --git a/api/src/test/resources/features/authentication-reusable.yaml b/api/src/test/resources/features/authentication-reusable.yaml
new file mode 100644
index 00000000..a5da803d
--- /dev/null
+++ b/api/src/test/resources/features/authentication-reusable.yaml
@@ -0,0 +1,19 @@
+document:
+ dsl: '1.0.0-alpha5'
+ namespace: examples
+ name: bearer-auth
+ version: '0.1.0'
+use:
+ authentications:
+ petStoreAuth:
+ bearer:
+ token: ${ .token }
+do:
+ - getPet:
+ call: http
+ with:
+ method: get
+ endpoint:
+ uri: https://petstore.swagger.io/v2/pet/{petId}
+ authentication:
+ use: petStoreAuth
diff --git a/api/src/test/resources/features/call-http-query-parameters.yaml b/api/src/test/resources/features/call-http-query-parameters.yaml
new file mode 100644
index 00000000..95934315
--- /dev/null
+++ b/api/src/test/resources/features/call-http-query-parameters.yaml
@@ -0,0 +1,24 @@
+document:
+ dsl: 1.0.0-alpha2
+ namespace: examples
+ name: http-query-params
+ version: 1.0.0-alpha2
+input:
+ schema:
+ format: json
+ document:
+ type: object
+ required:
+ - searchQuery
+ properties:
+ searchQuery:
+ type: string
+do:
+ - searchStarWarsCharacters:
+ call: http
+ with:
+ method: get
+ endpoint: https://swapi.dev/api/people/
+ query:
+ search: ${.searchQuery}
+
diff --git a/api/src/test/resources/features/callCustomFunction.yaml b/api/src/test/resources/features/callCustomFunction.yaml
new file mode 100644
index 00000000..fbb636b4
--- /dev/null
+++ b/api/src/test/resources/features/callCustomFunction.yaml
@@ -0,0 +1,25 @@
+document:
+ dsl: '1.0.0-alpha5'
+ namespace: samples
+ name: call-custom-function-inline
+ version: '0.1.0'
+use:
+ functions:
+ getPetById:
+ input:
+ schema:
+ document:
+ type: object
+ properties:
+ petId:
+ type: string
+ required: [ petId ]
+ call: http
+ with:
+ method: get
+ endpoint: https://petstore.swagger.io/v2/pet/{petId}
+do:
+ - getPet:
+ call: getPetById
+ with:
+ petId: 69
\ No newline at end of file
diff --git a/api/src/test/resources/features/callFunction.yaml b/api/src/test/resources/features/callFunction.yaml
new file mode 100644
index 00000000..95a3a987
--- /dev/null
+++ b/api/src/test/resources/features/callFunction.yaml
@@ -0,0 +1,19 @@
+document:
+ dsl: 1.0.0-alpha1
+ namespace: default
+ name: http-call-with-response-output
+ version: 1.0.0
+
+use:
+ functions:
+ getPet:
+ call: http
+ with:
+ method: get
+ endpoint:
+ uri: https://petstore.swagger.io/v2/pet/{petId}
+ output: response
+
+do:
+ - getPetFunctionCall:
+ call: getPet
\ No newline at end of file
diff --git a/api/src/test/resources/features/callHttp.yaml b/api/src/test/resources/features/callHttp.yaml
new file mode 100644
index 00000000..4022e38a
--- /dev/null
+++ b/api/src/test/resources/features/callHttp.yaml
@@ -0,0 +1,13 @@
+document:
+ dsl: 1.0.0-alpha1
+ namespace: default
+ name: http-call-with-response-output
+ version: 1.0.0
+do:
+ - getPet:
+ call: http
+ with:
+ method: get
+ endpoint:
+ uri: https://petstore.swagger.io/v2/pet/{petId}
+ output: response
\ No newline at end of file
diff --git a/api/src/test/resources/features/callOpenAPI.yaml b/api/src/test/resources/features/callOpenAPI.yaml
new file mode 100644
index 00000000..82843c5d
--- /dev/null
+++ b/api/src/test/resources/features/callOpenAPI.yaml
@@ -0,0 +1,16 @@
+document:
+ dsl: 1.0.0-alpha1
+ namespace: default
+ name: openapi-call-with-content-output
+ version: 1.0.0
+do:
+ - findPet:
+ call: openapi
+ with:
+ document:
+ endpoint: "https://petstore.swagger.io/v2/swagger.json"
+ operationId: findPetsByStatus
+ parameters:
+ status: ${ .status }
+ output:
+ as: . | length
\ No newline at end of file
diff --git a/api/src/test/resources/features/checkcarvitals.json b/api/src/test/resources/features/checkcarvitals.json
deleted file mode 100644
index 063d51a2..00000000
--- a/api/src/test/resources/features/checkcarvitals.json
+++ /dev/null
@@ -1,41 +0,0 @@
-{
- "id": "checkcarvitals",
- "name": "Check Car Vitals Workflow",
- "version": "1.0",
- "start": "WhenCarIsOn",
- "states": [
- {
- "name": "WhenCarIsOn",
- "type": "event",
- "onEvents": [
- {
- "eventRefs": ["CarTurnedOnEvent"]
- }
- ],
- "transition": "DoCarVitalsChecks"
- },
- {
- "name": "DoCarVitalsChecks",
- "type": "subflow",
- "workflowId": "vitalscheck",
- "repeat": {
- "max": 10,
- "continueOnError": true,
- "stopOnEvents": ["CarTurnedOffEvent"]
- },
- "end": true
- }
- ],
- "events": [
- {
- "name": "CarTurnedOnEvent",
- "type": "car.events",
- "source": "my/car/start"
- },
- {
- "name": "CarTurnedOffEvent",
- "type": "car.events",
- "source": "my/car/start"
- }
- ]
-}
\ No newline at end of file
diff --git a/api/src/test/resources/features/checkcarvitals.yml b/api/src/test/resources/features/checkcarvitals.yml
deleted file mode 100644
index cc1bfb87..00000000
--- a/api/src/test/resources/features/checkcarvitals.yml
+++ /dev/null
@@ -1,28 +0,0 @@
----
-id: checkcarvitals
-name: Check Car Vitals Workflow
-version: '1.0'
-start: WhenCarIsOn
-states:
- - name: WhenCarIsOn
- type: event
- onEvents:
- - eventRefs:
- - CarTurnedOnEvent
- transition: DoCarVitalsChecks
- - name: DoCarVitalsChecks
- type: subflow
- workflowId: vitalscheck
- repeat:
- max: 10
- continueOnError: true
- stopOnEvents:
- - CarTurnedOffEvent
- end: true
-events:
- - name: CarTurnedOnEvent
- type: car.events
- source: my/car/start
- - name: CarTurnedOffEvent
- type: car.events
- source: my/car/start
diff --git a/api/src/test/resources/features/compensationworkflow.json b/api/src/test/resources/features/compensationworkflow.json
deleted file mode 100644
index 7376cd28..00000000
--- a/api/src/test/resources/features/compensationworkflow.json
+++ /dev/null
@@ -1,84 +0,0 @@
-{
- "id": "CompensationWorkflow",
- "name": "Compensation Workflow",
- "version": "1.0",
- "states": [
- {
- "name": "NewItemPurchase",
- "type": "event",
- "onEvents": [
- {
- "eventRefs": [
- "NewPurchase"
- ],
- "actions": [
- {
- "functionRef": {
- "refName": "DebitCustomerFunction",
- "arguments": {
- "customerid": "${ .purchase.customerid }",
- "amount": "${ .purchase.amount }"
- }
- }
- },
- {
- "functionRef": {
- "refName": "SendPurchaseConfirmationEmailFunction",
- "arguments": {
- "customerid": "${ .purchase.customerid }"
- }
- }
- }
- ]
- }
- ],
- "compensatedBy": "CancelPurchase",
- "transition": "SomeNextWorkflowState"
- },
- {
- "name": "CancelPurchase",
- "type": "operation",
- "usedForCompensation": true,
- "actions": [
- {
- "functionRef": {
- "refName": "CreditCustomerFunction",
- "arguments": {
- "customerid": "${ .purchase.customerid }",
- "amount": "${ .purchase.amount }"
- }
- }
- },
- {
- "functionRef": {
- "refName": "SendPurchaseCancellationEmailFunction",
- "arguments": {
- "customerid": "${ .purchase.customerid }"
- }
- }
- }
- ]
- }
- ],
- "events": [
- {
- "name": "NewItemPurchase",
- "source": "purchasesource",
- "type": "org.purchases"
- }
- ],
- "functions": [
- {
- "name": "DebitCustomerFunction",
- "operation": "http://myapis.org/application.json#debit"
- },
- {
- "name": "SendPurchaseConfirmationEmailFunction",
- "operation": "http://myapis.org/application.json#confirmationemail"
- },
- {
- "name": "SendPurchaseCancellationEmailFunction",
- "operation": "http://myapis.org/application.json#cancellationemail"
- }
- ]
-}
\ No newline at end of file
diff --git a/api/src/test/resources/features/compensationworkflow.yml b/api/src/test/resources/features/compensationworkflow.yml
deleted file mode 100644
index 13bca0d5..00000000
--- a/api/src/test/resources/features/compensationworkflow.yml
+++ /dev/null
@@ -1,45 +0,0 @@
-id: CompensationWorkflow
-name: Compensation Workflow
-version: '1.0'
-states:
- - name: NewItemPurchase
- type: event
- onEvents:
- - eventRefs:
- - NewPurchase
- actions:
- - functionRef:
- refName: DebitCustomerFunction
- arguments:
- customerid: "${ .purchase.customerid }"
- amount: "${ .purchase.amount }"
- - functionRef:
- refName: SendPurchaseConfirmationEmailFunction
- arguments:
- customerid: "${ .purchase.customerid }"
- compensatedBy: CancelPurchase
- transition: SomeNextWorkflowState
- - name: CancelPurchase
- type: operation
- usedForCompensation: true
- actions:
- - functionRef:
- refName: CreditCustomerFunction
- arguments:
- customerid: "${ .purchase.customerid }"
- amount: "${ .purchase.amount }"
- - functionRef:
- refName: SendPurchaseCancellationEmailFunction
- arguments:
- customerid: "${ .purchase.customerid }"
-events:
- - name: NewItemPurchase
- source: purchasesource
- type: org.purchases
-functions:
- - name: DebitCustomerFunction
- operation: http://myapis.org/application.json#debit
- - name: SendPurchaseConfirmationEmailFunction
- operation: http://myapis.org/application.json#confirmationemail
- - name: SendPurchaseCancellationEmailFunction
- operation: http://myapis.org/application.json#cancellationemail
diff --git a/api/src/test/resources/features/composite.yaml b/api/src/test/resources/features/composite.yaml
new file mode 100644
index 00000000..515cda25
--- /dev/null
+++ b/api/src/test/resources/features/composite.yaml
@@ -0,0 +1,17 @@
+document:
+ dsl: 1.0.0-alpha1
+ namespace: default
+ name: do
+ version: 1.0.0
+do:
+ - compositeExample:
+ do:
+ - setRed:
+ set:
+ colors: ${ .colors + ["red"] }
+ - setGreen:
+ set:
+ colors: ${ .colors + ["green"] }
+ - setBlue:
+ set:
+ colors: ${ .colors + ["blue"] }
\ No newline at end of file
diff --git a/api/src/test/resources/features/data-flow.yaml b/api/src/test/resources/features/data-flow.yaml
new file mode 100644
index 00000000..bebb2123
--- /dev/null
+++ b/api/src/test/resources/features/data-flow.yaml
@@ -0,0 +1,14 @@
+document:
+ dsl: 1.0.0-alpha1
+ namespace: default
+ name: output-filtering
+ version: 1.0.0
+do:
+ - getPet:
+ call: http
+ with:
+ method: get
+ endpoint:
+ uri: https://petstore.swagger.io/v2/pet/{petId} #simple interpolation, only possible with top level variables
+ output:
+ as: .id #filters the output of the http call, using only the id of the returned object
diff --git a/api/src/test/resources/features/datainputschemaobj.json b/api/src/test/resources/features/datainputschemaobj.json
deleted file mode 100644
index dd9298b2..00000000
--- a/api/src/test/resources/features/datainputschemaobj.json
+++ /dev/null
@@ -1,31 +0,0 @@
-{
- "id": "datainputschemaobj",
- "version": "1.0",
- "name": "Data Input Schema test",
- "dataInputSchema": {
- "schema": "somejsonschema.json",
- "failOnValidationErrors": false
- },
- "start": "TestFunctionRefs",
- "states": [
- {
- "name": "TestFunctionRefs",
- "type": "operation",
- "actionMode": "sequential",
- "actions": [
- {
- "functionRef": "creditCheckFunction"
- },
- {
- "functionRef": {
- "refName": "sendRejectionEmailFunction",
- "arguments": {
- "applicant": "${ .customer }"
- }
- }
- }
- ],
- "end": true
- }
- ]
-}
\ No newline at end of file
diff --git a/api/src/test/resources/features/datainputschemaobj.yml b/api/src/test/resources/features/datainputschemaobj.yml
deleted file mode 100644
index 547eb1c3..00000000
--- a/api/src/test/resources/features/datainputschemaobj.yml
+++ /dev/null
@@ -1,18 +0,0 @@
-id: datainputschemaobj
-version: '1.0'
-name: Data Input Schema test
-dataInputSchema:
- schema: somejsonschema.json
- failOnValidationErrors: false
-start: TestFunctionRefs
-states:
- - name: TestFunctionRefs
- type: operation
- actionMode: sequential
- actions:
- - functionRef: creditCheckFunction
- - functionRef:
- refName: sendRejectionEmailFunction
- arguments:
- applicant: "${ .customer }"
- end: true
diff --git a/api/src/test/resources/features/datainputschemastring.json b/api/src/test/resources/features/datainputschemastring.json
deleted file mode 100644
index 159e715d..00000000
--- a/api/src/test/resources/features/datainputschemastring.json
+++ /dev/null
@@ -1,28 +0,0 @@
-{
- "id": "datainputschemaobj",
- "version": "1.0",
- "name": "Data Input Schema test",
- "dataInputSchema": "somejsonschema.json",
- "start": "TestFunctionRefs",
- "states": [
- {
- "name": "TestFunctionRefs",
- "type": "operation",
- "actionMode": "sequential",
- "actions": [
- {
- "functionRef": "creditCheckFunction"
- },
- {
- "functionRef": {
- "refName": "sendRejectionEmailFunction",
- "arguments": {
- "applicant": "${ .customer }"
- }
- }
- }
- ],
- "end": true
- }
- ]
-}
\ No newline at end of file
diff --git a/api/src/test/resources/features/datainputschemastring.yml b/api/src/test/resources/features/datainputschemastring.yml
deleted file mode 100644
index ac9f3556..00000000
--- a/api/src/test/resources/features/datainputschemastring.yml
+++ /dev/null
@@ -1,16 +0,0 @@
-id: datainputschemaobj
-version: '1.0'
-name: Data Input Schema test
-dataInputSchema: somejsonschema.json
-start: TestFunctionRefs
-states:
- - name: TestFunctionRefs
- type: operation
- actionMode: sequential
- actions:
- - functionRef: creditCheckFunction
- - functionRef:
- refName: sendRejectionEmailFunction
- arguments:
- applicant: "${ .customer }"
- end: true
diff --git a/api/src/test/resources/features/emit.yaml b/api/src/test/resources/features/emit.yaml
new file mode 100644
index 00000000..983407d9
--- /dev/null
+++ b/api/src/test/resources/features/emit.yaml
@@ -0,0 +1,14 @@
+document:
+ dsl: 1.0.0-alpha1
+ namespace: default
+ name: emit
+ version: 1.0.0
+do:
+ - emitEvent:
+ emit:
+ event:
+ with:
+ source: https://fake-source.com
+ type: com.fake-source.user.greeted.v1
+ data:
+ greetings: ${ "Hello \(.user.firstName) \(.user.lastName)!" }
\ No newline at end of file
diff --git a/api/src/test/resources/features/expressionlang.json b/api/src/test/resources/features/expressionlang.json
deleted file mode 100644
index 682f74e1..00000000
--- a/api/src/test/resources/features/expressionlang.json
+++ /dev/null
@@ -1,28 +0,0 @@
-{
- "id": "expressionlang",
- "version": "1.0",
- "name": "Custom expression lang",
- "expressionLang": "abc",
- "start": "TestFunctionRefs",
- "states": [
- {
- "name": "TestFunctionRefs",
- "type": "operation",
- "actionMode": "sequential",
- "actions": [
- {
- "functionRef": "creditCheckFunction"
- },
- {
- "functionRef": {
- "refName": "sendRejectionEmailFunction",
- "arguments": {
- "applicant": "${ .customer }"
- }
- }
- }
- ],
- "end": true
- }
- ]
-}
\ No newline at end of file
diff --git a/api/src/test/resources/features/expressionlang.yml b/api/src/test/resources/features/expressionlang.yml
deleted file mode 100644
index a6c84803..00000000
--- a/api/src/test/resources/features/expressionlang.yml
+++ /dev/null
@@ -1,16 +0,0 @@
-id: expressionlang
-version: '1.0'
-name: Custom expression lang
-expressionLang: abc
-start: TestFunctionRefs
-states:
- - name: TestFunctionRefs
- type: operation
- actionMode: sequential
- actions:
- - functionRef: creditCheckFunction
- - functionRef:
- refName: sendRejectionEmailFunction
- arguments:
- applicant: "${ .customer }"
- end: true
\ No newline at end of file
diff --git a/api/src/test/resources/features/flow.yaml b/api/src/test/resources/features/flow.yaml
new file mode 100644
index 00000000..6bd8a6e7
--- /dev/null
+++ b/api/src/test/resources/features/flow.yaml
@@ -0,0 +1,15 @@
+document:
+ dsl: 1.0.0-alpha1
+ namespace: default
+ name: implicit-sequence
+ version: 1.0.0
+do:
+ - setRed:
+ set:
+ colors: '${ .colors + [ "red" ] }'
+ - setGreen:
+ set:
+ colors: '${ .colors + [ "green" ] }'
+ - setBlue:
+ set:
+ colors: '${ .colors + [ "blue" ] }'
diff --git a/api/src/test/resources/features/for.yaml b/api/src/test/resources/features/for.yaml
new file mode 100644
index 00000000..662dff91
--- /dev/null
+++ b/api/src/test/resources/features/for.yaml
@@ -0,0 +1,14 @@
+document:
+ dsl: 1.0.0-alpha1
+ namespace: default
+ name: for
+ version: 1.0.0
+do:
+ - loopColors:
+ for:
+ each: color
+ in: '.colors'
+ do:
+ - markProcessed:
+ set:
+ processed: '${ { colors: (.processed.colors + [ $color ]), indexes: (.processed.indexes + [ $index ])} }'
\ No newline at end of file
diff --git a/api/src/test/resources/features/functionrefjsonparams.json b/api/src/test/resources/features/functionrefjsonparams.json
deleted file mode 100644
index b872ab81..00000000
--- a/api/src/test/resources/features/functionrefjsonparams.json
+++ /dev/null
@@ -1,29 +0,0 @@
-{
- "id": "functionrefparams",
- "version": "1.0",
- "name": "Function Ref Params Test",
- "start": "AddPluto",
- "states": [
- {
- "name": "AddPluto",
- "type": "operation",
- "actions": [
- {
- "functionRef": {
- "refName": "addPet",
- "arguments": {
- "body": {
- "name": "Pluto",
- "tag": "${ .pet.tagnumber }"
- },
- "id": 123,
- "address": "My Address, 123 MyCity, MyCountry",
- "owner": "${ .owner.name }"
- }
- }
- }
- ],
- "end": true
- }
- ]
-}
\ No newline at end of file
diff --git a/api/src/test/resources/features/functionrefjsonparams.yml b/api/src/test/resources/features/functionrefjsonparams.yml
deleted file mode 100644
index 9df672e1..00000000
--- a/api/src/test/resources/features/functionrefjsonparams.yml
+++ /dev/null
@@ -1,18 +0,0 @@
-id: functionrefparams
-version: '1.0'
-name: Function Ref Params Test
-start: AddPluto
-states:
- - name: AddPluto
- type: operation
- actions:
- - functionRef:
- refName: addPet
- arguments:
- body:
- name: Pluto
- tag: "${ .pet.tagnumber }"
- id: 123
- address: My Address, 123 MyCity, MyCountry
- owner: "${ .owner.name }"
- end: true
diff --git a/api/src/test/resources/features/functionrefnoparams.json b/api/src/test/resources/features/functionrefnoparams.json
deleted file mode 100644
index de4ddf88..00000000
--- a/api/src/test/resources/features/functionrefnoparams.json
+++ /dev/null
@@ -1,23 +0,0 @@
-{
- "id": "functionrefparams",
- "version": "1.0",
- "name": "Function Ref Params Test",
- "start": "AddPluto",
- "states": [
- {
- "name": "AddPluto",
- "type": "operation",
- "actions": [
- {
- "functionRef": {
- "refName": "addPet"
- }
- },
- {
- "functionRef": "addPet"
- }
- ],
- "end": true
- }
- ]
-}
\ No newline at end of file
diff --git a/api/src/test/resources/features/functionrefnoparams.yml b/api/src/test/resources/features/functionrefnoparams.yml
deleted file mode 100644
index 1e88798b..00000000
--- a/api/src/test/resources/features/functionrefnoparams.yml
+++ /dev/null
@@ -1,12 +0,0 @@
-id: functionrefparams
-version: '1.0'
-name: Function Ref Params Test
-start: AddPluto
-states:
- - name: AddPluto
- type: operation
- actions:
- - functionRef:
- refName: addPet
- - functionRef: addPet
- end: true
\ No newline at end of file
diff --git a/api/src/test/resources/features/functionrefs.json b/api/src/test/resources/features/functionrefs.json
deleted file mode 100644
index 9125bc78..00000000
--- a/api/src/test/resources/features/functionrefs.json
+++ /dev/null
@@ -1,38 +0,0 @@
-{
- "id": "functionrefs",
- "version": "1.0",
- "name": "Customer Credit Check Workflow",
- "description": "Perform Customer Credit Check",
- "start": "TestFunctionRef",
- "functions": [
- {
- "name": "creditCheckFunction",
- "operation": "http://myapis.org/creditcheckapi.json#doCreditCheck"
- },
- {
- "name": "sendRejectionEmailFunction",
- "operation": "http://myapis.org/creditcheckapi.json#rejectionEmail"
- }
- ],
- "states": [
- {
- "name": "TestFunctionRefs",
- "type": "operation",
- "actionMode": "sequential",
- "actions": [
- {
- "functionRef": "creditCheckFunction"
- },
- {
- "functionRef": {
- "refName": "sendRejectionEmailFunction",
- "arguments": {
- "applicant": "${ .customer }"
- }
- }
- }
- ],
- "end": true
- }
- ]
-}
\ No newline at end of file
diff --git a/api/src/test/resources/features/functionrefs.yml b/api/src/test/resources/features/functionrefs.yml
deleted file mode 100644
index 2f435ccd..00000000
--- a/api/src/test/resources/features/functionrefs.yml
+++ /dev/null
@@ -1,21 +0,0 @@
-id: functionrefs
-version: '1.0'
-name: Customer Credit Check Workflow
-description: Perform Customer Credit Check
-start: TestFunctionRefs
-functions:
- - name: creditCheckFunction
- operation: http://myapis.org/creditcheckapi.json#doCreditCheck
- - name: sendRejectionEmailFunction
- operation: http://myapis.org/creditcheckapi.json#rejectionEmail
-states:
- - name: TestFunctionRefs
- type: operation
- actionMode: sequential
- actions:
- - functionRef: creditCheckFunction
- - functionRef:
- refName: sendRejectionEmailFunction
- arguments:
- applicant: "${ .customer }"
- end: true
\ No newline at end of file
diff --git a/api/src/test/resources/features/functiontypes.json b/api/src/test/resources/features/functiontypes.json
deleted file mode 100644
index 712b94f1..00000000
--- a/api/src/test/resources/features/functiontypes.json
+++ /dev/null
@@ -1,35 +0,0 @@
-{
- "id": "functiontypes",
- "version": "1.0",
- "name": "Function Types Workflow",
- "description": "Determine if applicant request is valid",
- "start": "CheckFunctions",
- "functions": [
- {
- "name": "restFunction",
- "operation": "http://myapis.org/applicationapi.json#emailRejection"
- },
- {
- "name": "expressionFunction",
- "operation": ".my.data",
- "type" : "expression"
- }
- ],
- "states":[
- {
- "name":"CheckFunctions",
- "type":"operation",
- "actions":[
- {
- "functionRef": {
- "refName": "restFunction",
- "arguments": {
- "data": "${ fn(expressionFunction) }"
- }
- }
- }
- ],
- "end": true
- }
- ]
-}
\ No newline at end of file
diff --git a/api/src/test/resources/features/functiontypes.yml b/api/src/test/resources/features/functiontypes.yml
deleted file mode 100644
index b771c226..00000000
--- a/api/src/test/resources/features/functiontypes.yml
+++ /dev/null
@@ -1,20 +0,0 @@
-id: functiontypes
-version: '1.0'
-name: Function Types Workflow
-description: Determine if applicant request is valid
-start: CheckFunctions
-functions:
- - name: restFunction
- operation: http://myapis.org/applicationapi.json#emailRejection
- - name: expressionFunction
- operation: ".my.data"
- type: expression
-states:
- - name: CheckFunctions
- type: operation
- actions:
- - functionRef:
- refName: restFunction
- arguments:
- data: "${ fn(expressionFunction) }"
- end: true
\ No newline at end of file
diff --git a/api/src/test/resources/features/keepactiveexectimeout.json b/api/src/test/resources/features/keepactiveexectimeout.json
deleted file mode 100644
index 0864a0b1..00000000
--- a/api/src/test/resources/features/keepactiveexectimeout.json
+++ /dev/null
@@ -1,12 +0,0 @@
-{
- "id": "keepactiveexectimeout",
- "name": "Keep Active and Exec Timeout Test Workflow",
- "version": "1.0",
- "execTimeout": {
- "duration": "PT1H",
- "runBefore": "GenerateReport"
- },
- "keepActive": true,
- "states": [
- ]
-}
\ No newline at end of file
diff --git a/api/src/test/resources/features/keepactiveexectimeout.yml b/api/src/test/resources/features/keepactiveexectimeout.yml
deleted file mode 100644
index ca55979a..00000000
--- a/api/src/test/resources/features/keepactiveexectimeout.yml
+++ /dev/null
@@ -1,8 +0,0 @@
-id: keepactiveexectimeout
-name: Keep Active and Exec Timeout Test Workflow
-version: '1.0'
-execTimeout:
- duration: PT1H
- runBefore: GenerateReport
-keepActive: true
-states: []
\ No newline at end of file
diff --git a/api/src/test/resources/features/listen-to-any.yaml b/api/src/test/resources/features/listen-to-any.yaml
new file mode 100644
index 00000000..fa8794d3
--- /dev/null
+++ b/api/src/test/resources/features/listen-to-any.yaml
@@ -0,0 +1,16 @@
+document:
+ dsl: '1.0.0-alpha5'
+ namespace: test
+ name: listen-to-any
+ version: '0.1.0'
+do:
+ - callDoctor:
+ listen:
+ to:
+ any:
+ - with:
+ type: com.fake-hospital.vitals.measurements.temperature
+ data: ${ .temperature > 38 }
+ - with:
+ type: com.fake-hospital.vitals.measurements.bpm
+ data: ${ .bpm < 60 or .bpm > 100 }
\ No newline at end of file
diff --git a/api/src/test/resources/features/longstart.json b/api/src/test/resources/features/longstart.json
deleted file mode 100644
index 8347cbe1..00000000
--- a/api/src/test/resources/features/longstart.json
+++ /dev/null
@@ -1,32 +0,0 @@
-{
- "id": "longstart",
- "version": "1.0",
- "name": "Long start",
- "start": {
- "stateName": "TestFunctionRefs",
- "schedule": {
- "cron": "0 0/15 * * * ?"
- }
- },
- "states": [
- {
- "name": "TestFunctionRefs",
- "type": "operation",
- "actionMode": "sequential",
- "actions": [
- {
- "functionRef": "creditCheckFunction"
- },
- {
- "functionRef": {
- "refName": "sendRejectionEmailFunction",
- "arguments": {
- "applicant": "${ .customer }"
- }
- }
- }
- ],
- "end": true
- }
- ]
-}
\ No newline at end of file
diff --git a/api/src/test/resources/features/longstart.yml b/api/src/test/resources/features/longstart.yml
deleted file mode 100644
index 4c5046d8..00000000
--- a/api/src/test/resources/features/longstart.yml
+++ /dev/null
@@ -1,18 +0,0 @@
-id: longstart
-version: '1.0'
-name: Long start
-start:
- stateName: TestFunctionRefs
- schedule:
- cron: 0 0/15 * * * ?
-states:
- - name: TestFunctionRefs
- type: operation
- actionMode: sequential
- actions:
- - functionRef: creditCheckFunction
- - functionRef:
- refName: sendRejectionEmailFunction
- arguments:
- applicant: "${ .customer }"
- end: true
\ No newline at end of file
diff --git a/api/src/test/resources/features/raise.yaml b/api/src/test/resources/features/raise.yaml
new file mode 100644
index 00000000..7745162c
--- /dev/null
+++ b/api/src/test/resources/features/raise.yaml
@@ -0,0 +1,13 @@
+document:
+ dsl: 1.0.0-alpha1
+ namespace: default
+ name: raise-custom-error
+ version: 1.0.0
+do:
+ - raiseError:
+ raise:
+ error:
+ status: 400
+ type: https://serverlessworkflow.io/errors/types/compliance
+ title: Compliance Error
+ instance: raiseError
\ No newline at end of file
diff --git a/api/src/test/resources/features/retriesprops.json b/api/src/test/resources/features/retriesprops.json
deleted file mode 100644
index ade59971..00000000
--- a/api/src/test/resources/features/retriesprops.json
+++ /dev/null
@@ -1,34 +0,0 @@
-{
- "id": "TestRetriesProps",
- "name": "Retries props test",
- "version": "1.0",
- "start": "Test State",
- "retries": [
- {
- "name": "Test Retries",
- "delay": "PT1M",
- "maxDelay": "PT2M",
- "increment": "PT2S",
- "multiplier": "1.2",
- "maxAttempts": "20",
- "jitter": "0.4"
- }
- ],
- "states": [
- {
- "name": "Test States",
- "type": "operation",
- "actions": [
- ],
- "onErrors": [
- {
- "error": "TimeoutError",
- "code": "500",
- "retryRef": "Test Retries",
- "end": true
- }
- ],
- "end": true
- }
- ]
-}
\ No newline at end of file
diff --git a/api/src/test/resources/features/retriesprops.yml b/api/src/test/resources/features/retriesprops.yml
deleted file mode 100644
index 8f6c801e..00000000
--- a/api/src/test/resources/features/retriesprops.yml
+++ /dev/null
@@ -1,22 +0,0 @@
-id: TestRetriesProps
-name: Retries props test
-version: '1.0'
-start: Test State
-retries:
- - name: Test Retries
- delay: PT1M
- maxDelay: PT2M
- increment: PT2S
- multiplier: '1.2'
- maxAttempts: '20'
- jitter: '0.4'
-states:
- - name: Test States
- type: operation
- actions: []
- onErrors:
- - error: TimeoutError
- code: '500'
- retryRef: Test Retries
- end: true
- end: true
diff --git a/api/src/test/resources/features/set.yaml b/api/src/test/resources/features/set.yaml
new file mode 100644
index 00000000..dfebbf2d
--- /dev/null
+++ b/api/src/test/resources/features/set.yaml
@@ -0,0 +1,11 @@
+document:
+ dsl: 1.0.0-alpha1
+ namespace: default
+ name: set
+ version: 1.0.0
+do:
+ - setShape:
+ set:
+ shape: circle
+ size: ${ .configuration.size }
+ fill: ${ .configuration.fill }
diff --git a/api/src/test/resources/features/shortstart.json b/api/src/test/resources/features/shortstart.json
deleted file mode 100644
index 7f3adb75..00000000
--- a/api/src/test/resources/features/shortstart.json
+++ /dev/null
@@ -1,27 +0,0 @@
-{
- "id": "shortstart",
- "version": "1.0",
- "name": "Short start",
- "start": "TestFunctionRefs",
- "states": [
- {
- "name": "TestFunctionRefs",
- "type": "operation",
- "actionMode": "sequential",
- "actions": [
- {
- "functionRef": "creditCheckFunction"
- },
- {
- "functionRef": {
- "refName": "sendRejectionEmailFunction",
- "arguments": {
- "applicant": "${ .customer }"
- }
- }
- }
- ],
- "end": true
- }
- ]
-}
\ No newline at end of file
diff --git a/api/src/test/resources/features/shortstart.yml b/api/src/test/resources/features/shortstart.yml
deleted file mode 100644
index 4d3e3076..00000000
--- a/api/src/test/resources/features/shortstart.yml
+++ /dev/null
@@ -1,15 +0,0 @@
-id: shortstart
-version: '1.0'
-name: Short start
-start: TestFunctionRefs
-states:
- - name: TestFunctionRefs
- type: operation
- actionMode: sequential
- actions:
- - functionRef: creditCheckFunction
- - functionRef:
- refName: sendRejectionEmailFunction
- arguments:
- applicant: "${ .customer }"
- end: true
\ No newline at end of file
diff --git a/api/src/test/resources/features/simplecron.json b/api/src/test/resources/features/simplecron.json
deleted file mode 100644
index c2596dc6..00000000
--- a/api/src/test/resources/features/simplecron.json
+++ /dev/null
@@ -1,52 +0,0 @@
-{
- "id": "checkInbox",
- "name": "Check Inbox Workflow",
- "description": "Periodically Check Inbox",
- "version": "1.0",
- "start": {
- "stateName": "CheckInbox",
- "schedule": {
- "cron": "0 0/15 * * * ?"
- }
- },
- "functions": [
- {
- "name": "checkInboxFunction",
- "operation": "http://myapis.org/inboxapi.json#checkNewMessages"
- },
- {
- "name": "sendTextFunction",
- "operation": "http://myapis.org/inboxapi.json#sendText"
- }
- ],
- "states": [
- {
- "name": "CheckInbox",
- "type": "operation",
- "actionMode": "sequential",
- "actions": [
- {
- "functionRef": "checkInboxFunction"
- }
- ],
- "transition": "SendTextForHighPrioriry"
- },
- {
- "name": "SendTextForHighPrioriry",
- "type": "foreach",
- "inputCollection": "${ .messages }",
- "iterationParam": "singlemessage",
- "actions": [
- {
- "functionRef": {
- "refName": "sendTextFunction",
- "arguments": {
- "message": "${ .singlemessage }"
- }
- }
- }
- ],
- "end": true
- }
- ]
-}
\ No newline at end of file
diff --git a/api/src/test/resources/features/simplecron.yml b/api/src/test/resources/features/simplecron.yml
deleted file mode 100644
index 6221c5ce..00000000
--- a/api/src/test/resources/features/simplecron.yml
+++ /dev/null
@@ -1,30 +0,0 @@
-id: checkInbox
-name: Check Inbox Workflow
-description: Periodically Check Inbox
-version: '1.0'
-start:
- stateName: CheckInbox
- schedule:
- cron: 0 0/15 * * * ?
-functions:
- - name: checkInboxFunction
- operation: http://myapis.org/inboxapi.json#checkNewMessages
- - name: sendTextFunction
- operation: http://myapis.org/inboxapi.json#sendText
-states:
- - name: CheckInbox
- type: operation
- actionMode: sequential
- actions:
- - functionRef: checkInboxFunction
- transition: SendTextForHighPrioriry
- - name: SendTextForHighPrioriry
- type: foreach
- inputCollection: "${ .messages }"
- iterationParam: singlemessage
- actions:
- - functionRef:
- refName: sendTextFunction
- arguments:
- message: "${ .singlemessage }"
- end: true
\ No newline at end of file
diff --git a/api/src/test/resources/features/simpleschedule.json b/api/src/test/resources/features/simpleschedule.json
deleted file mode 100644
index 00ba0f69..00000000
--- a/api/src/test/resources/features/simpleschedule.json
+++ /dev/null
@@ -1,50 +0,0 @@
-{
- "id": "handleCarAuctionBid",
- "version": "1.0",
- "name": "Car Auction Bidding Workflow",
- "description": "Store a single bid whole the car auction is active",
- "start": {
- "stateName": "StoreCarAuctionBid",
- "schedule": "2020-03-20T09:00:00Z/2020-03-20T15:00:00Z"
- },
- "functions": [
- {
- "name": "StoreBidFunction",
- "operation": "http://myapis.org/carauctionapi.json#storeBid"
- }
- ],
- "events": [
- {
- "name": "CarBidEvent",
- "type": "carBidMadeType",
- "source": "carBidEventSource"
- }
- ],
- "states": [
- {
- "name": "StoreCarAuctionBid",
- "type": "event",
- "exclusive": true,
- "onEvents": [
- {
- "eventRefs": [
- "CarBidEvent"
- ],
- "actions": [
- {
- "functionRef": {
- "refName": "StoreBidFunction",
- "arguments": {
- "bid": "${ .bid }"
- }
- }
- }
- ]
- }
- ],
- "end": {
- "terminate": true
- }
- }
- ]
-}
\ No newline at end of file
diff --git a/api/src/test/resources/features/simpleschedule.yml b/api/src/test/resources/features/simpleschedule.yml
deleted file mode 100644
index 1eb8a495..00000000
--- a/api/src/test/resources/features/simpleschedule.yml
+++ /dev/null
@@ -1,28 +0,0 @@
-id: handleCarAuctionBid
-version: '1.0'
-name: Car Auction Bidding Workflow
-description: Store a single bid whole the car auction is active
-start:
- stateName: StoreCarAuctionBid
- schedule: 2020-03-20T09:00:00Z/2020-03-20T15:00:00Z
-functions:
- - name: StoreBidFunction
- operation: http://myapis.org/carauctionapi.json#storeBid
-events:
- - name: CarBidEvent
- type: carBidMadeType
- source: carBidEventSource
-states:
- - name: StoreCarAuctionBid
- type: event
- exclusive: true
- onEvents:
- - eventRefs:
- - CarBidEvent
- actions:
- - functionRef:
- refName: StoreBidFunction
- arguments:
- bid: "${ .bid }"
- end:
- terminate: true
\ No newline at end of file
diff --git a/api/src/test/resources/features/switch.yaml b/api/src/test/resources/features/switch.yaml
new file mode 100644
index 00000000..aa073fed
--- /dev/null
+++ b/api/src/test/resources/features/switch.yaml
@@ -0,0 +1,29 @@
+document:
+ dsl: 1.0.0-alpha1
+ namespace: default
+ name: switch-match
+ version: 1.0.0
+do:
+ - switchColor:
+ switch:
+ - red:
+ when: '.color == "red"'
+ then: setRed
+ - green:
+ when: '.color == "green"'
+ then: setGreen
+ - blue:
+ when: '.color == "blue"'
+ then: setBlue
+ - setRed:
+ set:
+ colors: '${ .colors + [ "red" ] }'
+ then: end
+ - setGreen:
+ set:
+ colors: '${ .colors + [ "green" ] }'
+ then: end
+ - setBlue:
+ set:
+ colors: '${ .colors + [ "blue" ] }'
+ then: end
diff --git a/api/src/test/resources/features/transitions.json b/api/src/test/resources/features/transitions.json
deleted file mode 100644
index fde5ee72..00000000
--- a/api/src/test/resources/features/transitions.json
+++ /dev/null
@@ -1,39 +0,0 @@
-{
- "id": "transitions",
- "version": "1.0",
- "name": "Transitions Workflow",
- "start": "DifferentTransitionsTestState",
- "description": "Transitions Workflow",
- "functions": "features/applicantrequestfunctions.json",
- "retries": "features/applicantrequestretries.json",
- "states":[
- {
- "name":"DifferentTransitionsTestState",
- "type":"switch",
- "dataConditions": [
- {
- "condition": "${ .applicants[?(@.age >= 18)] }",
- "transition": "StartApplication"
- },
- {
- "condition": "${ .applicants[?(@.age < 18)] }",
- "transition": {
- "nextState": "RejectApplication",
- "produceEvents": [
- {
- "eventRef": "provisioningCompleteEvent",
- "data": "${ .provisionedOrders }"
- }
- ]
- }
- }
- ],
- "default": {
- "transition": {
- "nextState": "RejectApplication",
- "compensate": true
- }
- }
- }
- ]
-}
\ No newline at end of file
diff --git a/api/src/test/resources/features/transitions.yml b/api/src/test/resources/features/transitions.yml
deleted file mode 100644
index b3528b1a..00000000
--- a/api/src/test/resources/features/transitions.yml
+++ /dev/null
@@ -1,23 +0,0 @@
-id: transitions
-version: '1.0'
-name: Transitions Workflow
-description: Transitions Workflow
-start: DifferentTransitionsTestState
-functions: features/applicantrequestfunctions.json
-retries: features/applicantrequestretries.json
-states:
- - name: DifferentTransitionsTestState
- type: switch
- dataConditions:
- - condition: "${ .applicants[?(@.age >= 18)] }"
- transition: StartApplication
- - condition: "${ .applicants[?(@.age < 18)] }"
- transition:
- nextState: RejectApplication
- produceEvents:
- - eventRef: provisioningCompleteEvent
- data: "${ .provisionedOrders }"
- default:
- transition:
- nextState: RejectApplication
- compensate: true
\ No newline at end of file
diff --git a/api/src/test/resources/features/try.yaml b/api/src/test/resources/features/try.yaml
new file mode 100644
index 00000000..ec19194d
--- /dev/null
+++ b/api/src/test/resources/features/try.yaml
@@ -0,0 +1,24 @@
+document:
+ dsl: 1.0.0-alpha1
+ namespace: default
+ name: try-catch-404
+ version: 1.0.0
+do:
+ - tryGetPet:
+ try:
+ - getPet:
+ call: http
+ with:
+ method: get
+ endpoint:
+ uri: https://petstore.swagger.io/v2/pet/getPetByName/{petName}
+ catch:
+ errors:
+ with:
+ type: https://serverlessworkflow.io/dsl/errors/types/communication
+ status: 404
+ as: err
+ do:
+ - setError:
+ set:
+ error: ${ $err }
diff --git a/api/src/test/resources/features/vetappointment.json b/api/src/test/resources/features/vetappointment.json
deleted file mode 100644
index bbcccaea..00000000
--- a/api/src/test/resources/features/vetappointment.json
+++ /dev/null
@@ -1,38 +0,0 @@
-{
- "id": "VetAppointmentWorkflow",
- "name": "Vet Appointment Workflow",
- "description": "Vet service call via events",
- "version": "1.0",
- "start": "MakeVetAppointmentState",
- "events": "features/vetappointmenteventrefs.json",
- "retries": "features/vetappointmentretries.json",
- "states": [
- {
- "name": "MakeVetAppointmentState",
- "type": "operation",
- "actions": [
- {
- "name": "MakeAppointmentAction",
- "eventRef": {
- "triggerEventRef": "MakeVetAppointment",
- "data": "${ .patientInfo }",
- "resultEventRef": "VetAppointmentInfo"
- },
- "actionDataFilter": {
- "results": "${ .appointmentInfo }"
- },
- "timeout": "PT15M"
- }
- ],
- "onErrors": [
- {
- "error": "TimeoutError",
- "code": "500",
- "retryRef": "TimeoutRetryStrategy",
- "end": true
- }
- ],
- "end": true
- }
- ]
-}
\ No newline at end of file
diff --git a/api/src/test/resources/features/vetappointment.yml b/api/src/test/resources/features/vetappointment.yml
deleted file mode 100644
index b137a01d..00000000
--- a/api/src/test/resources/features/vetappointment.yml
+++ /dev/null
@@ -1,25 +0,0 @@
-id: VetAppointmentWorkflow
-name: Vet Appointment Workflow
-description: Vet service call via events
-version: '1.0'
-start: MakeVetAppointmentState
-events: features/vetappointmenteventrefs.yml
-retries: features/vetappointmentretries.yml
-states:
- - name: MakeVetAppointmentState
- type: operation
- actions:
- - name: MakeAppointmentAction
- eventRef:
- triggerEventRef: MakeVetAppointment
- data: "${ .patientInfo }"
- resultEventRef: VetAppointmentInfo
- actionDataFilter:
- results: "${ .appointmentInfo }"
- timeout: PT15M
- onErrors:
- - error: TimeoutError
- code: '500'
- retryRef: TimeoutRetryStrategy
- end: true
- end: true
diff --git a/api/src/test/resources/features/vetappointmenteventrefs.json b/api/src/test/resources/features/vetappointmenteventrefs.json
deleted file mode 100644
index 6d021888..00000000
--- a/api/src/test/resources/features/vetappointmenteventrefs.json
+++ /dev/null
@@ -1,14 +0,0 @@
-{
- "events": [
- {
- "name": "MakeVetAppointment",
- "source": "VetServiceSoure",
- "kind": "produced"
- },
- {
- "name": "VetAppointmentInfo",
- "source": "VetServiceSource",
- "kind": "consumed"
- }
- ]
-}
\ No newline at end of file
diff --git a/api/src/test/resources/features/vetappointmenteventrefs.yml b/api/src/test/resources/features/vetappointmenteventrefs.yml
deleted file mode 100644
index 922e6bd7..00000000
--- a/api/src/test/resources/features/vetappointmenteventrefs.yml
+++ /dev/null
@@ -1,7 +0,0 @@
-events:
- - name: MakeVetAppointment
- source: VetServiceSoure
- kind: produced
- - name: VetAppointmentInfo
- source: VetServiceSource
- kind: consumed
diff --git a/api/src/test/resources/features/vetappointmentretries.json b/api/src/test/resources/features/vetappointmentretries.json
deleted file mode 100644
index 40f83b55..00000000
--- a/api/src/test/resources/features/vetappointmentretries.json
+++ /dev/null
@@ -1,9 +0,0 @@
-{
- "retries": [
- {
- "name": "TimeoutRetryStrategy",
- "delay": "PT1M",
- "maxAttempts": "5"
- }
- ]
-}
\ No newline at end of file
diff --git a/api/src/test/resources/features/vetappointmentretries.yml b/api/src/test/resources/features/vetappointmentretries.yml
deleted file mode 100644
index fa4c810d..00000000
--- a/api/src/test/resources/features/vetappointmentretries.yml
+++ /dev/null
@@ -1,4 +0,0 @@
-retries:
- - name: TimeoutRetryStrategy
- delay: PT1M
- maxAttempts: '5'
diff --git a/code-of-conduct.md b/code-of-conduct.md
index ebdded50..97a8526a 100644
--- a/code-of-conduct.md
+++ b/code-of-conduct.md
@@ -1,59 +1,11 @@
-## CNCF Community Code of Conduct v1.0
+# Code of Conduct
-Other languages available:
-- [Chinese/中文](https://github.com/cncf/foundation/blob/master/code-of-conduct-languages/zh.md)
-- [German/Deutsch](https://github.com/cncf/foundation/blob/master/code-of-conduct-languages/de.md)
-- [Spanish/Español](https://github.com/cncf/foundation/blob/master/code-of-conduct-languages/es.md)
-- [French/Français](https://github.com/cncf/foundation/blob/master/code-of-conduct-languages/fr.md)
-- [Italian/Italiano](https://github.com/cncf/foundation/blob/master/code-of-conduct-languages/it.md)
-- [Japanese/日本語](https://github.com/cncf/foundation/blob/master/code-of-conduct-languages/jp.md)
-- [Korean/한국어](https://github.com/cncf/foundation/blob/master/code-of-conduct-languages/ko.md)
-- [Ukrainian/Українська](https://github.com/cncf/foundation/blob/master/code-of-conduct-languages/uk.md)
-- [Russian/Русский](https://github.com/cncf/foundation/blob/master/code-of-conduct-languages/ru.md)
-- [Portuguese/Português](https://github.com/cncf/foundation/blob/master/code-of-conduct-languages/pt.md)
-- [Arabic/العربية](https://github.com/cncf/foundation/blob/master/code-of-conduct-languages/ar.md)
-- [Polish/Polski](https://github.com/cncf/foundation/blob/master/code-of-conduct-languages/pl.md)
+We follow the [CNCF Code of Conduct](https://github.com/cncf/foundation/blob/main/code-of-conduct.md).
-### Contributor Code of Conduct
-
-As contributors and maintainers of this project, and in the interest of fostering
-an open and welcoming community, we pledge to respect all people who contribute
-through reporting issues, posting feature requests, updating documentation,
-submitting pull requests or patches, and other activities.
-
-We are committed to making participation in this project a harassment-free experience for
-everyone, regardless of level of experience, gender, gender identity and expression,
-sexual orientation, disability, personal appearance, body size, race, ethnicity, age,
-religion, or nationality.
-
-Examples of unacceptable behavior by participants include:
-
-* The use of sexualized language or imagery
-* Personal attacks
-* Trolling or insulting/derogatory comments
-* Public or private harassment
-* Publishing others' private information, such as physical or electronic addresses,
- without explicit permission
-* Other unethical or unprofessional conduct.
-
-Project maintainers have the right and responsibility to remove, edit, or reject
-comments, commits, code, wiki edits, issues, and other contributions that are not
-aligned to this Code of Conduct. By adopting this Code of Conduct, project maintainers
-commit themselves to fairly and consistently applying these principles to every aspect
-of managing this project. Project maintainers who do not follow or enforce the Code of
-Conduct may be permanently removed from the project team.
-
-This code of conduct applies both within project spaces and in public spaces
-when an individual is representing the project or its community.
-
-Instances of abusive, harassing, or otherwise unacceptable behavior in Kubernetes may be reported by contacting the [Kubernetes Code of Conduct Committee](https://git.k8s.io/community/committee-code-of-conduct) via conduct@kubernetes.io. For other projects, please contact a CNCF project maintainer or our mediator, Mishi Choudhary via mishi@linux.com.
-
-This Code of Conduct is adapted from the Contributor Covenant
-(http://contributor-covenant.org), version 1.2.0, available at
-http://contributor-covenant.org/version/1/2/0/
-
-
-### CNCF Events Code of Conduct
-
-CNCF events are governed by the Linux Foundation [Code of Conduct](https://events.linuxfoundation.org/code-of-conduct/) available on the event page.
-This is designed to be compatible with the above policy and also includes more details on responding to incidents.
\ No newline at end of file
+
+Please contact the [CNCF Code of Conduct Committee](mailto:conduct@cncf.io)
+in order to report violations of the Code of Conduct.
diff --git a/diagram/.gitignore b/diagram/.gitignore
deleted file mode 100644
index d4dfde66..00000000
--- a/diagram/.gitignore
+++ /dev/null
@@ -1,31 +0,0 @@
-HELP.md
-target/
-!.mvn/wrapper/maven-wrapper.jar
-!**/src/main/**
-!**/src/test/**
-
-### STS ###
-.apt_generated
-.classpath
-.factorypath
-.project
-.settings
-.springBeans
-.sts4-cache
-
-### IntelliJ IDEA ###
-.idea
-*.iws
-*.iml
-*.ipr
-
-### NetBeans ###
-/nbproject/private/
-/nbbuild/
-/dist/
-/nbdist/
-/.nb-gradle/
-build/
-
-### VS Code ###
-.vscode/
\ No newline at end of file
diff --git a/diagram/pom.xml b/diagram/pom.xml
deleted file mode 100644
index 64f32881..00000000
--- a/diagram/pom.xml
+++ /dev/null
@@ -1,90 +0,0 @@
-
- * 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 io.serverlessworkflow.diagram;
-
-import io.serverlessworkflow.api.Workflow;
-import io.serverlessworkflow.api.interfaces.WorkflowDiagram;
-import io.serverlessworkflow.diagram.utils.WorkflowToPlantuml;
-import net.sourceforge.plantuml.FileFormat;
-import net.sourceforge.plantuml.FileFormatOption;
-import net.sourceforge.plantuml.SourceStringReader;
-
-import java.io.ByteArrayOutputStream;
-import java.nio.charset.Charset;
-
-public class WorkflowDiagramImpl implements WorkflowDiagram {
-
-
- @SuppressWarnings("unused")
- private String source;
- private Workflow workflow;
- private boolean showLegend = false;
-
- @Override
- public WorkflowDiagram setWorkflow(Workflow workflow) {
- this.workflow = workflow;
- this.source = Workflow.toJson(workflow);
- return this;
- }
-
- @Override
- public WorkflowDiagram setSource(String source) {
- this.source = source;
- this.workflow = Workflow.fromSource(source);
- return this;
- }
-
- @Override
- public String getSvgDiagram() throws Exception {
- if(workflow == null) {
- throw new IllegalAccessException("Unable to get diagram - no workflow set.");
- }
- String diagramSource = WorkflowToPlantuml.convert(workflow, showLegend);
- SourceStringReader reader = new SourceStringReader(diagramSource);
- final ByteArrayOutputStream os = new ByteArrayOutputStream();
- reader.generateImage(os, new FileFormatOption(FileFormat.SVG));
- os.close();
- return new String(os.toByteArray(), Charset.forName("UTF-8"));
- }
-
- @Override
- public WorkflowDiagram showLegend(boolean showLegend) {
- this.showLegend = showLegend;
- return this;
- }
-}
diff --git a/diagram/src/main/java/io/serverlessworkflow/diagram/config/ThymeleafConfig.java b/diagram/src/main/java/io/serverlessworkflow/diagram/config/ThymeleafConfig.java
deleted file mode 100644
index d490746e..00000000
--- a/diagram/src/main/java/io/serverlessworkflow/diagram/config/ThymeleafConfig.java
+++ /dev/null
@@ -1,42 +0,0 @@
-/*
- * Copyright 2020-Present The Serverless Workflow Specification Authors
- *
- * 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 io.serverlessworkflow.diagram.config;
-
-import org.thymeleaf.TemplateEngine;
-import org.thymeleaf.templatemode.TemplateMode;
-import org.thymeleaf.templateresolver.ClassLoaderTemplateResolver;
-import org.thymeleaf.templateresolver.ITemplateResolver;
-
-public class ThymeleafConfig {
- public static TemplateEngine templateEngine;
-
- static {
- templateEngine = new TemplateEngine();
- templateEngine.addTemplateResolver(plantUmlTemplateResolver());
- }
-
- private static ITemplateResolver plantUmlTemplateResolver() {
- ClassLoaderTemplateResolver templateResolver = new ClassLoaderTemplateResolver();
- templateResolver.setPrefix("/templates/plantuml/");
- templateResolver.setSuffix(".txt");
- templateResolver.setTemplateMode(TemplateMode.TEXT);
- templateResolver.setCharacterEncoding("UTF8");
- templateResolver.setCheckExistence(true);
- templateResolver.setCacheable(false);
- return templateResolver;
- }
-}
diff --git a/diagram/src/main/java/io/serverlessworkflow/diagram/model/ModelConnection.java b/diagram/src/main/java/io/serverlessworkflow/diagram/model/ModelConnection.java
deleted file mode 100644
index 70c5e934..00000000
--- a/diagram/src/main/java/io/serverlessworkflow/diagram/model/ModelConnection.java
+++ /dev/null
@@ -1,70 +0,0 @@
-/*
- * Copyright 2020-Present The Serverless Workflow Specification Authors
- *
- * 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 io.serverlessworkflow.diagram.model;
-
-import io.serverlessworkflow.diagram.utils.WorkflowDiagramUtils;
-
-public class ModelConnection {
- private String left;
- private String right;
- private String desc;
-
- public ModelConnection(String left, String right, String desc) {
- this.left = left.replaceAll("\\s", "");
- this.right = right.replaceAll("\\s", "");
- this.desc = desc;
- }
-
- @Override
- public String toString() {
- StringBuilder retBuff = new StringBuilder();
- retBuff.append(System.lineSeparator());
- retBuff.append(left.equals(WorkflowDiagramUtils.wfStart) ? WorkflowDiagramUtils.startEnd : left);
- retBuff.append(WorkflowDiagramUtils.connection);
- retBuff.append(right.equals(WorkflowDiagramUtils.wfEnd) ? WorkflowDiagramUtils.startEnd : right);
- if (desc != null && desc.trim().length() > 0) {
- retBuff.append(WorkflowDiagramUtils.description).append(desc);
- }
- retBuff.append(System.lineSeparator());
-
- return retBuff.toString();
- }
-
- public String getLeft() {
- return left;
- }
-
- public void setLeft(String left) {
- this.left = left;
- }
-
- public String getRight() {
- return right;
- }
-
- public void setRight(String right) {
- this.right = right;
- }
-
- public String getDesc() {
- return desc;
- }
-
- public void setDesc(String desc) {
- this.desc = desc;
- }
-}
diff --git a/diagram/src/main/java/io/serverlessworkflow/diagram/model/ModelState.java b/diagram/src/main/java/io/serverlessworkflow/diagram/model/ModelState.java
deleted file mode 100644
index 0cbea40e..00000000
--- a/diagram/src/main/java/io/serverlessworkflow/diagram/model/ModelState.java
+++ /dev/null
@@ -1,52 +0,0 @@
-/*
- * Copyright 2020-Present The Serverless Workflow Specification Authors
- *
- * 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 io.serverlessworkflow.diagram.model;
-
-import io.serverlessworkflow.diagram.utils.WorkflowDiagramUtils;
-
-import java.util.ArrayList;
-import java.util.List;
-
-public class ModelState {
-
- @SuppressWarnings("unused")
- private String name;
- private String noSpaceName;
- private List
- * 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 io.serverlessworkflow.diagram.model;
-
-import io.serverlessworkflow.diagram.utils.WorkflowDiagramUtils;
-
-public class ModelStateDef {
- private String name;
- private String type;
- private String noSpaceName;
-
- public ModelStateDef(String name, String type) {
- this.name = name;
- this.type = type;
- this.noSpaceName = name.replaceAll("\\s", "");
- }
-
- @Override
- public String toString() {
- StringBuilder retBuff = new StringBuilder();
- retBuff.append(WorkflowDiagramUtils.stateDef)
- .append(noSpaceName)
- .append(WorkflowDiagramUtils.stateAsName)
- .append("\"" + name + "\"")
- .append(WorkflowDiagramUtils.typeDefStart)
- .append(type)
- .append(WorkflowDiagramUtils.typeDefEnd);
- return retBuff.toString();
- }
-}
diff --git a/diagram/src/main/java/io/serverlessworkflow/diagram/model/WorkflowDiagramModel.java b/diagram/src/main/java/io/serverlessworkflow/diagram/model/WorkflowDiagramModel.java
deleted file mode 100644
index 9d561561..00000000
--- a/diagram/src/main/java/io/serverlessworkflow/diagram/model/WorkflowDiagramModel.java
+++ /dev/null
@@ -1,419 +0,0 @@
-/*
- * Copyright 2020-Present The Serverless Workflow Specification Authors
- *
- * 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 io.serverlessworkflow.diagram.model;
-
-import io.serverlessworkflow.api.Workflow;
-import io.serverlessworkflow.api.interfaces.State;
-import io.serverlessworkflow.api.states.*;
-import io.serverlessworkflow.api.switchconditions.DataCondition;
-import io.serverlessworkflow.api.switchconditions.EventCondition;
-import io.serverlessworkflow.diagram.utils.WorkflowDiagramUtils;
-
-import java.util.ArrayList;
-import java.util.List;
-import java.util.Optional;
-import java.util.stream.Collectors;
-
-public class WorkflowDiagramModel {
- private Workflow workflow;
-
- private String title;
- private String legend;
- private String footer;
- private List
- * 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 io.serverlessworkflow.diagram.utils;
-
-import io.serverlessworkflow.api.Workflow;
-import io.serverlessworkflow.api.interfaces.State;
-import io.serverlessworkflow.api.states.DefaultState;
-
-import java.util.List;
-import java.util.stream.Collectors;
-
-public class WorkflowDiagramUtils {
- public static final String versionSeparator = " v";
- public static final String wfStart = "wfstart";
- public static final String wfEnd = "wfend";
- public static final String startEnd = "[*]";
- public static final String connection = " --> ";
- public static final String description = " : ";
- public static final String title = "title ";
- public static final String footer = "center footer Serverless Workflow Specification - serverlessworkflow.io";
- public static final String legendStart = new StringBuilder().append("legend top center").append(System.lineSeparator()).toString();
- public static final String legendEnd = new StringBuilder().append(System.lineSeparator()).append("endlegend").toString();
- public static final String stateDef = "state ";
- public static final String stateAsName = " as ";
- public static final String typeDefStart = " << ";
- public static final String typeDefEnd = " >> ";
-
-
- public static State getWorkflowStartState(Workflow workflow) {
- return workflow.getStates().stream()
- .filter(ws -> ws.getName().equals(workflow.getStart().getStateName()))
- .findFirst().get();
- }
-
- public static List
- * 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 io.serverlessworkflow.diagram.utils;
-
-import io.serverlessworkflow.api.Workflow;
-import io.serverlessworkflow.diagram.config.ThymeleafConfig;
-import io.serverlessworkflow.diagram.model.WorkflowDiagramModel;
-import org.thymeleaf.TemplateEngine;
-import org.thymeleaf.context.Context;
-
-public class WorkflowToPlantuml {
- public static String convert(Workflow workflow, boolean showLegend) {
- TemplateEngine plantUmlTemplateEngine = ThymeleafConfig.templateEngine;
- Context context = new Context();
- context.setVariable("diagram", new WorkflowDiagramModel(workflow, showLegend));
-
- return plantUmlTemplateEngine.process("workflow-template", context);
- }
-}
diff --git a/diagram/src/main/resources/META-INF/services/io.serverlessworkflow.api.interfaces.WorkflowDiagram b/diagram/src/main/resources/META-INF/services/io.serverlessworkflow.api.interfaces.WorkflowDiagram
deleted file mode 100644
index 637a614f..00000000
--- a/diagram/src/main/resources/META-INF/services/io.serverlessworkflow.api.interfaces.WorkflowDiagram
+++ /dev/null
@@ -1 +0,0 @@
-io.serverlessworkflow.diagram.WorkflowDiagramImpl
\ No newline at end of file
diff --git a/diagram/src/main/resources/templates/plantuml/workflow-template.txt b/diagram/src/main/resources/templates/plantuml/workflow-template.txt
deleted file mode 100644
index 9d8f8c0b..00000000
--- a/diagram/src/main/resources/templates/plantuml/workflow-template.txt
+++ /dev/null
@@ -1,47 +0,0 @@
-@startuml
-skinparam backgroundColor White
-skinparam legendBackgroundColor White
-skinparam legendBorderColor White
-skinparam state {
- StartColor Green
- EndColor Orange
- BackgroundColor GhostWhite
- BackgroundColor<< workflow >> White
- BorderColor Black
- ArrowColor Black
-
- BorderColor<< event >> #7fe5f0
- BorderColor<< operation >> #bada55
- BorderColor<< switch >> #92a0f2
- BorderColor<< delay >> #b83b5e
- BorderColor<< parallel >> #6a2c70
- BorderColor<< subflow >> #87753c
- BorderColor<< inject >> #1e5f74
- BorderColor<< foreach >> #931a25
- BorderColor<< callback >> #ffcb8e
-}
-state "[(${diagram.title})]" as workflow << workflow >> {
-
-[# th:each="stateDef : ${diagram.modelStateDefs}" ]
-[(${stateDef.toString()})]
-[/]
-
-[# th:each="state : ${diagram.modelStates}" ]
-[(${state.toString()})]
-[/]
-
-[# th:each="connection : ${diagram.modelConnections}" ]
-[(${connection.toString()})]
-[/]
-
-}
-
-[# th:if="${diagram.showLegend}" ]
-legend center
-State Types and Border Colors:
-| Event | Operation | Switch | Delay | Parallel | SubFlow | Inject | ForEach | CallBack |
-|<#7fe5f0>|<#bada55>|<#92a0f2>|<#b83b5e>|<#6a2c70>|<#87753c>|<#1e5f74>|<#931a25>|<#ffcb8e>|
-endlegend
-[/]
-
-@enduml
\ No newline at end of file
diff --git a/diagram/src/test/java/io/serverlessworkflow/diagram/test/WorkflowDiagramTest.java b/diagram/src/test/java/io/serverlessworkflow/diagram/test/WorkflowDiagramTest.java
deleted file mode 100644
index 80bed886..00000000
--- a/diagram/src/test/java/io/serverlessworkflow/diagram/test/WorkflowDiagramTest.java
+++ /dev/null
@@ -1,70 +0,0 @@
-/*
- * Copyright 2020-Present The Serverless Workflow Specification Authors
- *
- * 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 io.serverlessworkflow.diagram.test;
-
-import io.serverlessworkflow.api.Workflow;
-import io.serverlessworkflow.api.interfaces.WorkflowDiagram;
-import io.serverlessworkflow.diagram.WorkflowDiagramImpl;
-import io.serverlessworkflow.diagram.test.utils.DiagramTestUtils;
-import org.junit.jupiter.api.Assertions;
-import org.junit.jupiter.params.ParameterizedTest;
-import org.junit.jupiter.params.provider.ValueSource;
-
-import static org.junit.jupiter.api.Assertions.assertNotNull;
-
-public class WorkflowDiagramTest {
-
- @ParameterizedTest
- @ValueSource(strings = {"/examples/applicantrequest.json", "/examples/applicantrequest.yml",
- "/examples/carauctionbids.json", "/examples/carauctionbids.yml",
- "/examples/creditcheck.json", "/examples/creditcheck.yml",
- "/examples/eventbasedgreeting.json", "/examples/eventbasedgreeting.yml",
- "/examples/finalizecollegeapplication.json", "/examples/finalizecollegeapplication.yml",
- "/examples/greeting.json", "/examples/greeting.yml",
- "/examples/helloworld.json", "/examples/helloworld.yml",
- "/examples/jobmonitoring.json", "/examples/jobmonitoring.yml",
- "/examples/monitorpatient.json", "/examples/monitorpatient.yml",
- "/examples/parallel.json", "/examples/parallel.yml",
- "/examples/provisionorder.json", "/examples/provisionorder.yml",
- "/examples/sendcloudevent.json", "/examples/sendcloudevent.yml",
- "/examples/solvemathproblems.json", "/examples/solvemathproblems.yml",
- "/examples/foreachstatewithactions.json", "/examples/foreachstatewithactions.yml",
- "/examples/periodicinboxcheck.json", "/examples/periodicinboxcheck.yml",
- "/examples/vetappointmentservice.json", "/examples/vetappointmentservice.yml",
- "/examples/eventbasedtransition.json", "/examples/eventbasedtransition.yml",
- "/examples/roomreadings.json", "/examples/roomreadings.yml",
- "/examples/checkcarvitals.json", "/examples/checkcarvitals.yml",
- "/examples/booklending.json", "/examples/booklending.yml"
- })
- public void testSpecExamplesParsing(String workflowLocation) throws Exception {
-
- Workflow workflow = Workflow.fromSource(DiagramTestUtils.readWorkflowFile(workflowLocation));
-
- assertNotNull(workflow);
- assertNotNull(workflow.getId());
- assertNotNull(workflow.getName());
- assertNotNull(workflow.getStates());
-
- WorkflowDiagram workflowDiagram = new WorkflowDiagramImpl();
- workflowDiagram.setWorkflow(workflow);
-
- String diagramSVG = workflowDiagram.getSvgDiagram();
-
- Assertions.assertNotNull(diagramSVG);
-
- }
-}
diff --git a/diagram/src/test/java/io/serverlessworkflow/diagram/test/utils/DiagramTestUtils.java b/diagram/src/test/java/io/serverlessworkflow/diagram/test/utils/DiagramTestUtils.java
deleted file mode 100644
index 74f46c6a..00000000
--- a/diagram/src/test/java/io/serverlessworkflow/diagram/test/utils/DiagramTestUtils.java
+++ /dev/null
@@ -1,70 +0,0 @@
-/*
- * Copyright 2020-Present The Serverless Workflow Specification Authors
- *
- * 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 io.serverlessworkflow.diagram.test.utils;
-
-import io.serverlessworkflow.api.mapper.JsonObjectMapper;
-import io.serverlessworkflow.api.mapper.YamlObjectMapper;
-
-import java.io.*;
-import java.nio.file.Files;
-import java.nio.file.Path;
-import java.nio.file.Paths;
-
-public class DiagramTestUtils {
- private static JsonObjectMapper jsonObjectMapper = new JsonObjectMapper();
- private static YamlObjectMapper yamlObjectMapper = new YamlObjectMapper();
-
- public static final Path resourceDirectory = Paths.get("src",
- "test",
- "resources");
- public static final String absolutePath = resourceDirectory.toFile().getAbsolutePath();
-
- public static Path getResourcePath(String file) {
- return Paths.get(absolutePath + File.separator + file);
- }
-
- public static InputStream getInputStreamFromPath(Path path) throws Exception {
- return Files.newInputStream(path);
- }
-
- public static String readWorkflowFile(String location) {
- return readFileAsString(classpathResourceReader(location));
- }
-
- public static Reader classpathResourceReader(String location) {
- return new InputStreamReader(DiagramTestUtils.class.getResourceAsStream(location));
- }
-
- public static String readFileAsString(Reader reader) {
- try {
- StringBuilder fileData = new StringBuilder(1000);
- char[] buf = new char[1024];
- int numRead;
- while ((numRead = reader.read(buf)) != -1) {
- String readData = String.valueOf(buf,
- 0,
- numRead);
- fileData.append(readData);
- buf = new char[1024];
- }
- reader.close();
- return fileData.toString();
- } catch (IOException e) {
- throw new RuntimeException(e);
- }
- }
-}
diff --git a/diagram/src/test/resources/examples/applicantrequest.json b/diagram/src/test/resources/examples/applicantrequest.json
deleted file mode 100644
index b330bdeb..00000000
--- a/diagram/src/test/resources/examples/applicantrequest.json
+++ /dev/null
@@ -1,54 +0,0 @@
-{
- "id": "applicantrequest",
- "version": "1.0",
- "name": "Applicant Request Decision Workflow",
- "description": "Determine if applicant request is valid",
- "start": "CheckApplication",
- "functions": [
- {
- "name": "sendRejectionEmailFunction",
- "operation": "http://myapis.org/applicationapi.json#emailRejection"
- }
- ],
- "states":[
- {
- "name":"CheckApplication",
- "type":"switch",
- "dataConditions": [
- {
- "condition": "${ .applicants | .age >= 18 }",
- "transition": "StartApplication"
- },
- {
- "condition": "${ .applicants | .age < 18 }",
- "transition": "RejectApplication"
- }
- ],
- "default": {
- "transition": "RejectApplication"
- }
- },
- {
- "name": "StartApplication",
- "type": "subflow",
- "workflowId": "startApplicationWorkflowId",
- "end": true
- },
- {
- "name":"RejectApplication",
- "type":"operation",
- "actionMode":"sequential",
- "actions":[
- {
- "functionRef": {
- "refName": "sendRejectionEmailFunction",
- "arguments": {
- "applicant": "${ .applicant }"
- }
- }
- }
- ],
- "end": true
- }
- ]
-}
\ No newline at end of file
diff --git a/diagram/src/test/resources/examples/applicantrequest.yml b/diagram/src/test/resources/examples/applicantrequest.yml
deleted file mode 100644
index d75d400f..00000000
--- a/diagram/src/test/resources/examples/applicantrequest.yml
+++ /dev/null
@@ -1,31 +0,0 @@
-id: applicantrequest
-version: '1.0'
-name: Applicant Request Decision Workflow
-description: Determine if applicant request is valid
-start: CheckApplication
-functions:
- - name: sendRejectionEmailFunction
- operation: http://myapis.org/applicationapi.json#emailRejection
-states:
- - name: CheckApplication
- type: switch
- dataConditions:
- - condition: "${ .applicants | .age >= 18 }"
- transition: StartApplication
- - condition: "${ .applicants | .age < 18 }"
- transition: RejectApplication
- default:
- transition: RejectApplication
- - name: StartApplication
- type: subflow
- workflowId: startApplicationWorkflowId
- end: true
- - name: RejectApplication
- type: operation
- actionMode: sequential
- actions:
- - functionRef:
- refName: sendRejectionEmailFunction
- arguments:
- applicant: "${ .applicant }"
- end: true
\ No newline at end of file
diff --git a/diagram/src/test/resources/examples/booklending.json b/diagram/src/test/resources/examples/booklending.json
deleted file mode 100644
index 37fbcf8b..00000000
--- a/diagram/src/test/resources/examples/booklending.json
+++ /dev/null
@@ -1,129 +0,0 @@
-{
- "id": "booklending",
- "name": "Book Lending Workflow",
- "version": "1.0",
- "start": "Book Lending Request",
- "states": [
- {
- "name": "Book Lending Request",
- "type": "event",
- "onEvents": [
- {
- "eventRefs": ["Book Lending Request Event"]
- }
- ],
- "transition": "Get Book Status"
- },
- {
- "name": "Get Book Status",
- "type": "operation",
- "actions": [
- {
- "functionRef": {
- "refName": "Get status for book",
- "arguments": {
- "bookid": "${ .book.id }"
- }
- }
- }
- ],
- "transition": "Book Status Decision"
- },
- {
- "name": "Book Status Decision",
- "type": "switch",
- "dataConditions": [
- {
- "name": "Book is on loan",
- "condition": "${ .book.status == \"onloan\" }",
- "transition": "Report Status To Lender"
- },
- {
- "name": "Check is available",
- "condition": "${ .book.status == \"available\" }",
- "transition": "Check Out Book"
- }
- ]
- },
- {
- "name": "Report Status To Lender",
- "type": "operation",
- "actions": [
- {
- "functionRef": {
- "refName": "Send status to lender",
- "arguments": {
- "bookid": "${ .book.id }",
- "message": "Book ${ .book.title } is already on loan"
- }
- }
- }
- ],
- "transition": "Wait for Lender response"
- },
- {
- "name": "Wait for Lender response",
- "type": "switch",
- "eventConditions": [
- {
- "name": "Hold Book",
- "eventRef": "Hold Book Event",
- "transition": "Request Hold"
- },
- {
- "name": "Decline Book Hold",
- "eventRef": "Decline Hold Event",
- "transition": "Cancel Request"
- }
- ]
- },
- {
- "name": "Request Hold",
- "type": "operation",
- "actions": [
- {
- "functionRef": {
- "refName": "Request hold for lender",
- "arguments": {
- "bookid": "${ .book.id }",
- "lender": "${ .lender }"
- }
- }
- }
- ],
- "transition": "Wait two weeks"
- },
- {
- "name": "Wait two weeks",
- "type": "delay",
- "timeDelay": "P2W",
- "transition": "Get Book Status"
- },
- {
- "name": "Check Out Book",
- "type": "operation",
- "actions": [
- {
- "functionRef": {
- "refName": "Check out book with id",
- "arguments": {
- "bookid": "${ .book.id }"
- }
- }
- },
- {
- "functionRef": {
- "refName": "Notify Lender for checkout",
- "arguments": {
- "bookid": "${ .book.id }",
- "lender": "${ .lender }"
- }
- }
- }
- ],
- "end": true
- }
- ],
- "functions": [],
- "events": []
-}
\ No newline at end of file
diff --git a/diagram/src/test/resources/examples/booklending.yml b/diagram/src/test/resources/examples/booklending.yml
deleted file mode 100644
index a595588f..00000000
--- a/diagram/src/test/resources/examples/booklending.yml
+++ /dev/null
@@ -1,74 +0,0 @@
-id: booklending
-name: Book Lending Workflow
-version: '1.0'
-start: Book Lending Request
-states:
- - name: Book Lending Request
- type: event
- onEvents:
- - eventRefs:
- - Book Lending Request Event
- transition: Get Book Status
- - name: Get Book Status
- type: operation
- actions:
- - functionRef:
- refName: Get status for book
- arguments:
- bookid: "${ .book.id }"
- transition: Book Status Decision
- - name: Book Status Decision
- type: switch
- dataConditions:
- - name: Book is on loan
- condition: ${ .book.status == "onloan" }
- transition: Report Status To Lender
- - name: Check is available
- condition: ${ .book.status == "available" }
- transition: Check Out Book
- - name: Report Status To Lender
- type: operation
- actions:
- - functionRef:
- refName: Send status to lender
- arguments:
- bookid: "${ .book.id }"
- message: Book ${ .book.title } is already on loan
- transition: Wait for Lender response
- - name: Wait for Lender response
- type: switch
- eventConditions:
- - name: Hold Book
- eventRef: Hold Book Event
- transition: Request Hold
- - name: Decline Book Hold
- eventRef: Decline Hold Event
- transition: Cancel Request
- - name: Request Hold
- type: operation
- actions:
- - functionRef:
- refName: Request fold for lender
- arguments:
- bookid: "${ .book.id }"
- lender: "${ .lender }"
- transition: Wait two weeks
- - name: Wait two weeks
- type: delay
- timeDelay: P2W
- transition: Get Book Status
- - name: Check Out Book
- type: operation
- actions:
- - functionRef:
- refName: Check out book with id
- arguments:
- bookid: "${ .book.id }"
- - functionRef:
- refName: Notify Lender for checkout
- arguments:
- bookid: "${ .book.id }"
- lender: "${ .lender }"
- end: true
-functions:
-events:
\ No newline at end of file
diff --git a/diagram/src/test/resources/examples/carauctionbids.json b/diagram/src/test/resources/examples/carauctionbids.json
deleted file mode 100644
index 8c2fde11..00000000
--- a/diagram/src/test/resources/examples/carauctionbids.json
+++ /dev/null
@@ -1,44 +0,0 @@
-{
- "id": "handleCarAuctionBid",
- "version": "1.0",
- "name": "Car Auction Bidding Workflow",
- "description": "Store a single bid whole the car auction is active",
- "start": {
- "stateName": "StoreCarAuctionBid",
- "schedule": "2020-03-20T09:00:00Z/2020-03-20T15:00:00Z"
- },
- "functions": [
- {
- "name": "StoreBidFunction",
- "operation": "http://myapis.org/carauctionapi.json#storeBid"
- }
- ],
- "events": [
- {
- "name": "CarBidEvent",
- "type": "carBidMadeType",
- "source": "carBidEventSource"
- }
- ],
- "states": [
- {
- "name": "StoreCarAuctionBid",
- "type": "event",
- "exclusive": true,
- "onEvents": [
- {
- "eventRefs": ["CarBidEvent"],
- "actions": [{
- "functionRef": {
- "refName": "StoreBidFunction",
- "arguments": {
- "bid": "${ .bid }"
- }
- }
- }]
- }
- ],
- "end": true
- }
- ]
-}
\ No newline at end of file
diff --git a/diagram/src/test/resources/examples/carauctionbids.yml b/diagram/src/test/resources/examples/carauctionbids.yml
deleted file mode 100644
index f943f52f..00000000
--- a/diagram/src/test/resources/examples/carauctionbids.yml
+++ /dev/null
@@ -1,27 +0,0 @@
-id: handleCarAuctionBid
-version: '1.0'
-name: Car Auction Bidding Workflow
-description: Store a single bid whole the car auction is active
-start:
- stateName: StoreCarAuctionBid
- schedule: 2020-03-20T09:00:00Z/2020-03-20T15:00:00Z
-functions:
- - name: StoreBidFunction
- operation: http://myapis.org/carauctionapi.json#storeBid
-events:
- - name: CarBidEvent
- type: carBidMadeType
- source: carBidEventSource
-states:
- - name: StoreCarAuctionBid
- type: event
- exclusive: true
- onEvents:
- - eventRefs:
- - CarBidEvent
- actions:
- - functionRef:
- refName: StoreBidFunction
- arguments:
- bid: "${ .bid }"
- end: true
\ No newline at end of file
diff --git a/diagram/src/test/resources/examples/checkcarvitals.json b/diagram/src/test/resources/examples/checkcarvitals.json
deleted file mode 100644
index 504235d2..00000000
--- a/diagram/src/test/resources/examples/checkcarvitals.json
+++ /dev/null
@@ -1,39 +0,0 @@
-{
- "id": "checkcarvitals",
- "name": "Check Car Vitals Workflow",
- "version": "1.0",
- "start": "WhenCarIsOn",
- "states": [
- {
- "name": "WhenCarIsOn",
- "type": "event",
- "onEvents": [
- {
- "eventRefs": ["CarTurnedOnEvent"]
- }
- ],
- "transition": "DoCarVitalsChecks"
- },
- {
- "name": "DoCarVitalsChecks",
- "type": "subflow",
- "workflowId": "vitalscheck",
- "repeat": {
- "stopOnEvents": ["CarTurnedOffEvent"]
- },
- "end": true
- }
- ],
- "events": [
- {
- "name": "CarTurnedOnEvent",
- "type": "car.events",
- "source": "my/car/start"
- },
- {
- "name": "CarTurnedOffEvent",
- "type": "car.events",
- "source": "my/car/start"
- }
- ]
-}
\ No newline at end of file
diff --git a/diagram/src/test/resources/examples/checkcarvitals.yml b/diagram/src/test/resources/examples/checkcarvitals.yml
deleted file mode 100644
index d17d73ce..00000000
--- a/diagram/src/test/resources/examples/checkcarvitals.yml
+++ /dev/null
@@ -1,25 +0,0 @@
-id: checkcarvitals
-name: Check Car Vitals Workflow
-version: '1.0'
-start: WhenCarIsOn
-states:
- - name: WhenCarIsOn
- type: event
- onEvents:
- - eventRefs:
- - CarTurnedOnEvent
- transition: DoCarVitalsChecks
- - name: DoCarVitalsChecks
- type: subflow
- workflowId: vitalscheck
- repeat:
- stopOnEvents:
- - CarTurnedOffEvent
- end: true
-events:
- - name: CarTurnedOnEvent
- type: car.events
- source: my/car/start
- - name: CarTurnedOffEvent
- type: car.events
- source: my/car/start
\ No newline at end of file
diff --git a/diagram/src/test/resources/examples/creditcheck.json b/diagram/src/test/resources/examples/creditcheck.json
deleted file mode 100644
index e6bfd9b6..00000000
--- a/diagram/src/test/resources/examples/creditcheck.json
+++ /dev/null
@@ -1,85 +0,0 @@
-{
- "id": "customercreditcheck",
- "version": "1.0",
- "name": "Customer Credit Check Workflow",
- "description": "Perform Customer Credit Check",
- "start": "CheckCredit",
- "functions": [
- {
- "name": "creditCheckFunction",
- "operation": "http://myapis.org/creditcheckapi.json#doCreditCheck"
- },
- {
- "name": "sendRejectionEmailFunction",
- "operation": "http://myapis.org/creditcheckapi.json#rejectionEmail"
- }
- ],
- "events": [
- {
- "name": "CreditCheckCompletedEvent",
- "type": "creditCheckCompleteType",
- "source": "creditCheckSource",
- "correlation": [
- {
- "contextAttributeName": "customerId"
- }
- ]
- }
- ],
- "states": [
- {
- "name": "CheckCredit",
- "type": "callback",
- "action": {
- "functionRef": {
- "refName": "callCreditCheckMicroservice",
- "arguments": {
- "customer": "${ .customer }"
- }
- }
- },
- "eventRef": "CreditCheckCompletedEvent",
- "timeout": "PT15M",
- "transition": "EvaluateDecision"
- },
- {
- "name": "EvaluateDecision",
- "type": "switch",
- "dataConditions": [
- {
- "condition": "${ .creditCheck | .decision == \"Approved\" }",
- "transition": "StartApplication'"
- },
- {
- "condition": "${ .creditCheck | .decision == \"Denied\" }",
- "transition": "RejectApplication"
- }
- ],
- "default": {
- "transition": "RejectApplication"
- }
- },
- {
- "name": "StartApplication",
- "type": "subflow",
- "workflowId": "startApplicationWorkflowId",
- "end": true
- },
- {
- "name": "RejectApplication",
- "type": "operation",
- "actionMode": "sequential",
- "actions": [
- {
- "functionRef": {
- "refName": "sendRejectionEmailFunction",
- "arguments": {
- "applicant": "${ .customer }"
- }
- }
- }
- ],
- "end": true
- }
- ]
-}
\ No newline at end of file
diff --git a/diagram/src/test/resources/examples/creditcheck.yml b/diagram/src/test/resources/examples/creditcheck.yml
deleted file mode 100644
index c4e5eb4a..00000000
--- a/diagram/src/test/resources/examples/creditcheck.yml
+++ /dev/null
@@ -1,49 +0,0 @@
-id: customercreditcheck
-version: '1.0'
-name: Customer Credit Check Workflow
-description: Perform Customer Credit Check
-start: CheckCredit
-functions:
- - name: creditCheckFunction
- operation: http://myapis.org/creditcheckapi.json#doCreditCheck
- - name: sendRejectionEmailFunction
- operation: http://myapis.org/creditcheckapi.json#rejectionEmail
-events:
- - name: CreditCheckCompletedEvent
- type: creditCheckCompleteType
- source: creditCheckSource
- correlation:
- - contextAttributeName: customerId
-states:
- - name: CheckCredit
- type: callback
- action:
- functionRef:
- refName: callCreditCheckMicroservice
- arguments:
- customer: "${ .customer }"
- eventRef: CreditCheckCompletedEvent
- timeout: PT15M
- transition: EvaluateDecision
- - name: EvaluateDecision
- type: switch
- dataConditions:
- - condition: "${ .creditCheck | .decision == \"Approved\" }"
- transition: StartApplication
- - condition: "${ .creditCheck | .decision == \"Denied\" }"
- transition: RejectApplication
- default:
- transition: RejectApplication
- - name: StartApplication
- type: subflow
- workflowId: startApplicationWorkflowId
- end: true
- - name: RejectApplication
- type: operation
- actionMode: sequential
- actions:
- - functionRef:
- refName: sendRejectionEmailFunction
- arguments:
- applicant: "${ .customer }"
- end: true
\ No newline at end of file
diff --git a/diagram/src/test/resources/examples/eventbasedgreeting.json b/diagram/src/test/resources/examples/eventbasedgreeting.json
deleted file mode 100644
index aa80a3b4..00000000
--- a/diagram/src/test/resources/examples/eventbasedgreeting.json
+++ /dev/null
@@ -1,46 +0,0 @@
-{
- "id": "eventbasedgreeting",
- "version": "1.0",
- "name": "Event Based Greeting Workflow",
- "description": "Event Based Greeting",
- "start": "Greet",
- "events": [
- {
- "name": "GreetingEvent",
- "type": "greetingEventType",
- "source": "greetingEventSource"
- }
- ],
- "functions": [
- {
- "name": "greetingFunction",
- "operation": "file://myapis/greetingapis.json#greeting"
- }
- ],
- "states":[
- {
- "name":"Greet",
- "type":"event",
- "onEvents": [{
- "eventRefs": ["GreetingEvent"],
- "eventDataFilter": {
- "data": "${ .data.greet }"
- },
- "actions":[
- {
- "functionRef": {
- "refName": "greetingFunction",
- "arguments": {
- "name": "${ .greet.name }"
- }
- }
- }
- ]
- }],
- "stateDataFilter": {
- "output": "${ .payload.greeting }"
- },
- "end": true
- }
- ]
-}
\ No newline at end of file
diff --git a/diagram/src/test/resources/examples/eventbasedgreeting.yml b/diagram/src/test/resources/examples/eventbasedgreeting.yml
deleted file mode 100644
index ec22bec3..00000000
--- a/diagram/src/test/resources/examples/eventbasedgreeting.yml
+++ /dev/null
@@ -1,28 +0,0 @@
-id: eventbasedgreeting
-version: '1.0'
-name: Event Based Greeting Workflow
-description: Event Based Greeting
-start: Greet
-events:
- - name: GreetingEvent
- type: greetingEventType
- source: greetingEventSource
-functions:
- - name: greetingFunction
- operation: file://myapis/greetingapis.json#greeting
-states:
- - name: Greet
- type: event
- onEvents:
- - eventRefs:
- - GreetingEvent
- eventDataFilter:
- data: "${ .data.greet }"
- actions:
- - functionRef:
- refName: greetingFunction
- arguments:
- name: "${ .greet.name }"
- stateDataFilter:
- output: "${ .payload.greeting }"
- end: true
\ No newline at end of file
diff --git a/diagram/src/test/resources/examples/eventbasedtransition.json b/diagram/src/test/resources/examples/eventbasedtransition.json
deleted file mode 100644
index 29ee0271..00000000
--- a/diagram/src/test/resources/examples/eventbasedtransition.json
+++ /dev/null
@@ -1,57 +0,0 @@
-{
- "id": "eventbasedswitch",
- "version": "1.0",
- "name": "Event Based Switch Transitions",
- "description": "Event Based Switch Transitions",
- "start": "CheckVisaStatus",
- "events": [
- {
- "name": "visaApprovedEvent",
- "type": "VisaApproved",
- "source": "visaCheckSource"
- },
- {
- "name": "visaRejectedEvent",
- "type": "VisaRejected",
- "source": "visaCheckSource"
- }
- ],
- "states":[
- {
- "name":"CheckVisaStatus",
- "type":"switch",
- "eventConditions": [
- {
- "eventRef": "visaApprovedEvent",
- "transition": "HandleApprovedVisa"
- },
- {
- "eventRef": "visaRejectedEvent",
- "transition": "HandleRejectedVisa"
- }
- ],
- "eventTimeout": "PT1H",
- "default": {
- "transition": "HandleNoVisaDecision"
- }
- },
- {
- "name": "HandleApprovedVisa",
- "type": "subflow",
- "workflowId": "handleApprovedVisaWorkflowID",
- "end": true
- },
- {
- "name": "HandleRejectedVisa",
- "type": "subflow",
- "workflowId": "handleRejectedVisaWorkflowID",
- "end": true
- },
- {
- "name": "HandleNoVisaDecision",
- "type": "subflow",
- "workflowId": "handleNoVisaDecisionWorkfowId",
- "end": true
- }
- ]
-}
\ No newline at end of file
diff --git a/diagram/src/test/resources/examples/eventbasedtransition.yml b/diagram/src/test/resources/examples/eventbasedtransition.yml
deleted file mode 100644
index c00eef5d..00000000
--- a/diagram/src/test/resources/examples/eventbasedtransition.yml
+++ /dev/null
@@ -1,35 +0,0 @@
-id: eventbasedswitch
-version: '1.0'
-name: Event Based Switch Transitions
-description: Event Based Switch Transitions
-start: CheckVisaStatus
-events:
- - name: visaApprovedEvent
- type: VisaApproved
- source: visaCheckSource
- - name: visaRejectedEvent
- type: VisaRejected
- source: visaCheckSource
-states:
- - name: CheckVisaStatus
- type: switch
- eventConditions:
- - eventRef: visaApprovedEvent
- transition: HandleApprovedVisa
- - eventRef: visaRejectedEvent
- transition: HandleRejectedVisa
- eventTimeout: PT1H
- default:
- transition: HandleNoVisaDecision
- - name: HandleApprovedVisa
- type: subflow
- workflowId: handleApprovedVisaWorkflowID
- end: true
- - name: HandleRejectedVisa
- type: subflow
- workflowId: handleRejectedVisaWorkflowID
- end: true
- - name: HandleNoVisaDecision
- type: subflow
- workflowId: handleNoVisaDecisionWorkfowId
- end: true
\ No newline at end of file
diff --git a/diagram/src/test/resources/examples/finalizecollegeapplication.json b/diagram/src/test/resources/examples/finalizecollegeapplication.json
deleted file mode 100644
index 4df99b15..00000000
--- a/diagram/src/test/resources/examples/finalizecollegeapplication.json
+++ /dev/null
@@ -1,73 +0,0 @@
-{
- "id": "finalizeCollegeApplication",
- "name": "Finalize College Application",
- "version": "1.0",
- "start": "FinalizeApplication",
- "events": [
- {
- "name": "ApplicationSubmitted",
- "type": "org.application.submitted",
- "source": "applicationsource",
- "correlation": [
- {
- "contextAttributeName": "applicantId"
- }
- ]
- },
- {
- "name": "SATScoresReceived",
- "type": "org.application.satscores",
- "source": "applicationsource",
- "correlation": [
- {
- "contextAttributeName": "applicantId"
- }
- ]
- },
- {
- "name": "RecommendationLetterReceived",
- "type": "org.application.recommendationLetter",
- "source": "applicationsource",
- "correlation": [
- {
- "contextAttributeName": "applicantId"
- }
- ]
- }
- ],
- "functions": [
- {
- "name": "finalizeApplicationFunction",
- "operation": "http://myapis.org/collegeapplicationapi.json#finalize"
- }
- ],
- "states": [
- {
- "name": "FinalizeApplication",
- "type": "event",
- "exclusive": false,
- "onEvents": [
- {
- "eventRefs": [
- "ApplicationSubmitted",
- "SATScoresReceived",
- "RecommendationLetterReceived"
- ],
- "actions": [
- {
- "functionRef": {
- "refName": "finalizeApplicationFunction",
- "arguments": {
- "student": "${ .applicantId }"
- }
- }
- }
- ]
- }
- ],
- "end": {
- "terminate": true
- }
- }
- ]
-}
\ No newline at end of file
diff --git a/diagram/src/test/resources/examples/finalizecollegeapplication.yml b/diagram/src/test/resources/examples/finalizecollegeapplication.yml
deleted file mode 100644
index d84690ca..00000000
--- a/diagram/src/test/resources/examples/finalizecollegeapplication.yml
+++ /dev/null
@@ -1,39 +0,0 @@
-id: finalizeCollegeApplication
-name: Finalize College Application
-version: '1.0'
-start: FinalizeApplication
-events:
- - name: ApplicationSubmitted
- type: org.application.submitted
- source: applicationsource
- correlation:
- - contextAttributeName: applicantId
- - name: SATScoresReceived
- type: org.application.satscores
- source: applicationsource
- correlation:
- - contextAttributeName: applicantId
- - name: RecommendationLetterReceived
- type: org.application.recommendationLetter
- source: applicationsource
- correlation:
- - contextAttributeName: applicantId
-functions:
- - name: finalizeApplicationFunction
- operation: http://myapis.org/collegeapplicationapi.json#finalize
-states:
- - name: FinalizeApplication
- type: event
- exclusive: false
- onEvents:
- - eventRefs:
- - ApplicationSubmitted
- - SATScoresReceived
- - RecommendationLetterReceived
- actions:
- - functionRef:
- refName: finalizeApplicationFunction
- arguments:
- student: "${ .applicantId }"
- end:
- terminate: true
\ No newline at end of file
diff --git a/diagram/src/test/resources/examples/foreachstatewithactions.json b/diagram/src/test/resources/examples/foreachstatewithactions.json
deleted file mode 100644
index 1d3dc1eb..00000000
--- a/diagram/src/test/resources/examples/foreachstatewithactions.json
+++ /dev/null
@@ -1,32 +0,0 @@
-{
- "id": "foreachstatewithactions",
- "name": "ForEach State With Actions",
- "description": "ForEach State With Actions",
- "version": "1.0",
- "start": "SendConfirmationForEachCompletedhOrder",
- "functions": [
- {
- "name": "sendConfirmationFunction",
- "operation": "http://myapis.org/confirmationapi.json#sendConfirmation"
- }
- ],
- "states": [
- {
- "name":"SendConfirmationForEachCompletedhOrder",
- "type":"foreach",
- "inputCollection": "${ .orders[?(@.completed == true)] }",
- "iterationParam": "${ .completedorder }",
- "actions":[
- {
- "functionRef": {
- "refName": "sendConfirmationFunction",
- "arguments": {
- "orderNumber": "${ .completedorder.orderNumber }",
- "email": "${ .completedorder.email }"
- }
- }
- }],
- "end": true
- }
- ]
-}
\ No newline at end of file
diff --git a/diagram/src/test/resources/examples/foreachstatewithactions.yml b/diagram/src/test/resources/examples/foreachstatewithactions.yml
deleted file mode 100644
index cead8472..00000000
--- a/diagram/src/test/resources/examples/foreachstatewithactions.yml
+++ /dev/null
@@ -1,20 +0,0 @@
-id: foreachstatewithactions
-name: ForEach State With Actions
-description: ForEach State With Actions
-version: '1.0'
-start: SendConfirmationForEachCompletedhOrder
-functions:
- - name: sendConfirmationFunction
- operation: http://myapis.org/confirmationapi.json#sendConfirmation
-states:
- - name: SendConfirmationForEachCompletedhOrder
- type: foreach
- inputCollection: "${ .orders[?(@.completed == true)] }"
- iterationParam: "${ .completedorder }"
- actions:
- - functionRef:
- refName: sendConfirmationFunction
- arguments:
- orderNumber: "${ .completedorder.orderNumber }"
- email: "${ .completedorder.email }"
- end: true
diff --git a/diagram/src/test/resources/examples/greeting.json b/diagram/src/test/resources/examples/greeting.json
deleted file mode 100644
index 3540cb6d..00000000
--- a/diagram/src/test/resources/examples/greeting.json
+++ /dev/null
@@ -1,33 +0,0 @@
-{
- "id": "greeting",
- "version": "1.0",
- "name": "Greeting Workflow",
- "description": "Greet Someone",
- "start": "Greet",
- "functions": [
- {
- "name": "greetingFunction",
- "operation": "file://myapis/greetingapis.json#greeting"
- }
- ],
- "states":[
- {
- "name":"Greet",
- "type":"operation",
- "actions":[
- {
- "functionRef": {
- "refName": "greetingFunction",
- "arguments": {
- "name": "${ .person.name }"
- }
- },
- "actionDataFilter": {
- "results": "${ .greeting }"
- }
- }
- ],
- "end": true
- }
- ]
-}
\ No newline at end of file
diff --git a/diagram/src/test/resources/examples/greeting.yml b/diagram/src/test/resources/examples/greeting.yml
deleted file mode 100644
index 8bbc8b4d..00000000
--- a/diagram/src/test/resources/examples/greeting.yml
+++ /dev/null
@@ -1,19 +0,0 @@
-id: greeting
-version: '1.0'
-name: Greeting Workflow
-description: Greet Someone
-start: Greet
-functions:
- - name: greetingFunction
- operation: file://myapis/greetingapis.json#greeting
-states:
- - name: Greet
- type: operation
- actions:
- - functionRef:
- refName: greetingFunction
- arguments:
- name: "${ .person.name }"
- actionDataFilter:
- results: "${ .greeting }"
- end: true
\ No newline at end of file
diff --git a/diagram/src/test/resources/examples/helloworld.json b/diagram/src/test/resources/examples/helloworld.json
deleted file mode 100644
index c1864a6d..00000000
--- a/diagram/src/test/resources/examples/helloworld.json
+++ /dev/null
@@ -1,17 +0,0 @@
-{
- "id": "helloworld",
- "version": "1.0",
- "name": "Hello World Workflow",
- "description": "Inject Hello World",
- "start": "Hello State",
- "states":[
- {
- "name":"Hello State",
- "type":"inject",
- "data": {
- "result": "Hello World!"
- },
- "end": true
- }
- ]
-}
\ No newline at end of file
diff --git a/diagram/src/test/resources/examples/helloworld.yml b/diagram/src/test/resources/examples/helloworld.yml
deleted file mode 100644
index 0d537603..00000000
--- a/diagram/src/test/resources/examples/helloworld.yml
+++ /dev/null
@@ -1,11 +0,0 @@
-id: helloworld
-version: '1.0'
-name: Hello World Workflow
-description: Inject Hello World
-start: Hello State
-states:
- - name: Hello State
- type: inject
- data:
- result: Hello World!
- end: true
\ No newline at end of file
diff --git a/diagram/src/test/resources/examples/jobmonitoring.json b/diagram/src/test/resources/examples/jobmonitoring.json
deleted file mode 100644
index fda8446b..00000000
--- a/diagram/src/test/resources/examples/jobmonitoring.json
+++ /dev/null
@@ -1,138 +0,0 @@
-{
- "id": "jobmonitoring",
- "version": "1.0",
- "name": "Job Monitoring",
- "description": "Monitor finished execution of a submitted job",
- "start": "SubmitJob",
- "functions": [
- {
- "name": "submitJob",
- "operation": "http://myapis.org/monitorapi.json#doSubmit"
- },
- {
- "name": "checkJobStatus",
- "operation": "http://myapis.org/monitorapi.json#checkStatus"
- },
- {
- "name": "reportJobSuceeded",
- "operation": "http://myapis.org/monitorapi.json#reportSucceeded"
- },
- {
- "name": "reportJobFailed",
- "operation": "http://myapis.org/monitorapi.json#reportFailure"
- }
- ],
- "states":[
- {
- "name":"SubmitJob",
- "type":"operation",
- "actionMode":"sequential",
- "actions":[
- {
- "functionRef": {
- "refName": "submitJob",
- "arguments": {
- "name": "${ .job.name }"
- }
- },
- "actionDataFilter": {
- "results": "${ .jobuid }"
- }
- }
- ],
- "onErrors": [
- {
- "error": "*",
- "transition": "SubmitError"
- }
- ],
- "stateDataFilter": {
- "output": "${ .jobuid }"
- },
- "transition": "WaitForCompletion'"
- },
- {
- "name": "SubmitError",
- "type": "subflow",
- "workflowId": "handleJobSubmissionErrorWorkflow",
- "end": true
- },
- {
- "name": "WaitForCompletion",
- "type": "delay",
- "timeDelay": "PT5S",
- "transition": "GetJobStatus"
- },
- {
- "name":"GetJobStatus",
- "type":"operation",
- "actionMode":"sequential",
- "actions":[
- {
- "functionRef": {
- "refName": "checkJobStatus",
- "arguments": {
- "name": "${ .jobuid }"
- }
- },
- "actionDataFilter": {
- "results": "${ .jobstatus }"
- }
- }
- ],
- "stateDataFilter": {
- "output": "${ .jobstatus }"
- },
- "transition": "DetermineCompletion"
- },
- {
- "name":"DetermineCompletion",
- "type":"switch",
- "dataConditions": [
- {
- "condition": "${ .jobStatus == \"SUCCEEDED\" }",
- "transition": "JobSucceeded"
- },
- {
- "condition": "${ .jobStatus == \"FAILED\" }",
- "transition": "JobFailed"
- }
- ],
- "default": {
- "transition": "WaitForCompletion"
- }
- },
- {
- "name":"JobSucceeded",
- "type":"operation",
- "actionMode":"sequential",
- "actions":[
- {
- "functionRef": {
- "refName": "reportJobSuceeded",
- "arguments": {
- "name": "${ .jobuid }"
- }
- }
- }
- ],
- "end": true
- },
- {
- "name":"JobFailed",
- "type":"operation",
- "actionMode":"sequential",
- "actions":[
- {
- "functionRef": {
- "refName": "reportJobFailed",
- "arguments": {
- "name": "${ .jobuid }"
- }
- }
- }
- ],
- "end": true
- }
- ]
-}
\ No newline at end of file
diff --git a/diagram/src/test/resources/examples/jobmonitoring.yml b/diagram/src/test/resources/examples/jobmonitoring.yml
deleted file mode 100644
index 5f30b08e..00000000
--- a/diagram/src/test/resources/examples/jobmonitoring.yml
+++ /dev/null
@@ -1,79 +0,0 @@
-id: jobmonitoring
-version: '1.0'
-name: Job Monitoring
-description: Monitor finished execution of a submitted job
-start: SubmitJob
-functions:
- - name: submitJob
- operation: http://myapis.org/monitorapi.json#doSubmit
- - name: checkJobStatus
- operation: http://myapis.org/monitorapi.json#checkStatus
- - name: reportJobSuceeded
- operation: http://myapis.org/monitorapi.json#reportSucceeded
- - name: reportJobFailed
- operation: http://myapis.org/monitorapi.json#reportFailure
-states:
- - name: SubmitJob
- type: operation
- actionMode: sequential
- actions:
- - functionRef:
- refName: submitJob
- arguments:
- name: "${ .job.name }"
- actionDataFilter:
- results: "${ .jobuid }"
- onErrors:
- - error: "*"
- transition: SubmitError
- stateDataFilter:
- output: "${ .jobuid }"
- transition: WaitForCompletion
- - name: SubmitError
- type: subflow
- workflowId: handleJobSubmissionErrorWorkflow
- end: true
- - name: WaitForCompletion
- type: delay
- timeDelay: PT5S
- transition: GetJobStatus
- - name: GetJobStatus
- type: operation
- actionMode: sequential
- actions:
- - functionRef:
- refName: checkJobStatus
- arguments:
- name: "${ .jobuid }"
- actionDataFilter:
- results: "${ .jobstatus }"
- stateDataFilter:
- output: "${ .jobstatus }"
- transition: DetermineCompletion
- - name: DetermineCompletion
- type: switch
- dataConditions:
- - condition: "${ .jobstatus == \"SUCCEEDED\" }"
- transition: JobSucceeded
- - condition: "${ .jobstatus == \"FAILED\" }"
- transition: JobFailed
- default:
- transition: WaitForCompletion
- - name: JobSucceeded
- type: operation
- actionMode: sequential
- actions:
- - functionRef:
- refName: reportJobSuceeded
- arguments:
- name: "${ .jobuid }"
- end: true
- - name: JobFailed
- type: operation
- actionMode: sequential
- actions:
- - functionRef:
- refName: reportJobFailed
- arguments:
- name: "${ .jobuid }"
- end: true
\ No newline at end of file
diff --git a/diagram/src/test/resources/examples/monitorpatient.json b/diagram/src/test/resources/examples/monitorpatient.json
deleted file mode 100644
index ab216b60..00000000
--- a/diagram/src/test/resources/examples/monitorpatient.json
+++ /dev/null
@@ -1,95 +0,0 @@
-{
- "id": "patientVitalsWorkflow",
- "name": "Monitor Patient Vitals",
- "version": "1.0",
- "start": "MonitorVitals",
- "events": [
- {
- "name": "HighBodyTemperature",
- "type": "org.monitor.highBodyTemp",
- "source": "monitoringSource",
- "correlation": [
- {
- "contextAttributeName": "patientId"
- }
- ]
- },
- {
- "name": "HighBloodPressure",
- "type": "org.monitor.highBloodPressure",
- "source": "monitoringSource",
- "correlation": [
- {
- "contextAttributeName": "patientId"
- }
- ]
- },
- {
- "name": "HighRespirationRate",
- "type": "org.monitor.highRespirationRate",
- "source": "monitoringSource",
- "correlation": [
- {
- "contextAttributeName": "patientId"
- }
- ]
- }
- ],
- "functions": [
- {
- "name": "callPulmonologist",
- "operation": "http://myapis.org/patientapis.json#callPulmonologist"
- },
- {
- "name": "sendTylenolOrder",
- "operation": "http://myapis.org/patientapis.json#tylenolOrder"
- },
- {
- "name": "callNurse",
- "operation": "http://myapis.org/patientapis.json#callNurse"
- }
- ],
- "states": [
- {
- "name": "MonitorVitals",
- "type": "event",
- "exclusive": true,
- "onEvents": [{
- "eventRefs": ["HighBodyTemperature"],
- "actions": [{
- "functionRef": {
- "refName": "sendTylenolOrder",
- "arguments": {
- "patientid": "${ .patientId }"
- }
- }
- }]
- },
- {
- "eventRefs": ["HighBloodPressure"],
- "actions": [{
- "functionRef": {
- "refName": "callNurse",
- "arguments": {
- "patientid": "${ .patientId }"
- }
- }
- }]
- },
- {
- "eventRefs": ["HighRespirationRate"],
- "actions": [{
- "functionRef": {
- "refName": "callPulmonologist",
- "arguments": {
- "patientid": "${ .patientId }"
- }
- }
- }]
- }
- ],
- "end": {
- "terminate": true
- }
- }]
-}
\ No newline at end of file
diff --git a/diagram/src/test/resources/examples/monitorpatient.yml b/diagram/src/test/resources/examples/monitorpatient.yml
deleted file mode 100644
index 33b99459..00000000
--- a/diagram/src/test/resources/examples/monitorpatient.yml
+++ /dev/null
@@ -1,55 +0,0 @@
-id: patientVitalsWorkflow
-name: Monitor Patient Vitals
-version: '1.0'
-start: MonitorVitals
-events:
- - name: HighBodyTemperature
- type: org.monitor.highBodyTemp
- source: monitoringSource
- correlation:
- - contextAttributeName: patientId
- - name: HighBloodPressure
- type: org.monitor.highBloodPressure
- source: monitoringSource
- correlation:
- - contextAttributeName: patientId
- - name: HighRespirationRate
- type: org.monitor.highRespirationRate
- source: monitoringSource
- correlation:
- - contextAttributeName: patientId
-functions:
- - name: callPulmonologist
- operation: http://myapis.org/patientapis.json#callPulmonologist
- - name: sendTylenolOrder
- operation: http://myapis.org/patientapis.json#tylenolOrder
- - name: callNurse
- operation: http://myapis.org/patientapis.json#callNurse
-states:
- - name: MonitorVitals
- type: event
- exclusive: true
- onEvents:
- - eventRefs:
- - HighBodyTemperature
- actions:
- - functionRef:
- refName: sendTylenolOrder
- arguments:
- patientid: "${ .patientId }"
- - eventRefs:
- - HighBloodPressure
- actions:
- - functionRef:
- refName: callNurse
- arguments:
- patientid: "${ .patientId }"
- - eventRefs:
- - HighRespirationRate
- actions:
- - functionRef:
- refName: callPulmonologist
- arguments:
- patientid: "${ .patientId }"
- end:
- terminate: true
diff --git a/diagram/src/test/resources/examples/parallel.json b/diagram/src/test/resources/examples/parallel.json
deleted file mode 100644
index cb50c8fc..00000000
--- a/diagram/src/test/resources/examples/parallel.json
+++ /dev/null
@@ -1,25 +0,0 @@
-{
- "id": "parallelexec",
- "version": "1.0",
- "name": "Parallel Execution Workflow",
- "description": "Executes two branches in parallel",
- "start": "ParallelExec",
- "states":[
- {
- "name": "ParallelExec",
- "type": "parallel",
- "completionType": "and",
- "branches": [
- {
- "name": "ShortDelayBranch",
- "workflowId": "shortdelayworkflowid"
- },
- {
- "name": "LongDelayBranch",
- "workflowId": "longdelayworkflowid"
- }
- ],
- "end": true
- }
- ]
-}
\ No newline at end of file
diff --git a/diagram/src/test/resources/examples/parallel.yml b/diagram/src/test/resources/examples/parallel.yml
deleted file mode 100644
index 49536973..00000000
--- a/diagram/src/test/resources/examples/parallel.yml
+++ /dev/null
@@ -1,15 +0,0 @@
-id: parallelexec
-version: '1.0'
-name: Parallel Execution Workflow
-description: Executes two branches in parallel
-start: ParallelExec
-states:
- - name: ParallelExec
- type: parallel
- completionType: and
- branches:
- - name: ShortDelayBranch
- workflowId: shortdelayworkflowid
- - name: LongDelayBranch
- workflowId: longdelayworkflowid
- end: true
\ No newline at end of file
diff --git a/diagram/src/test/resources/examples/periodicinboxcheck.json b/diagram/src/test/resources/examples/periodicinboxcheck.json
deleted file mode 100644
index 5e20c30e..00000000
--- a/diagram/src/test/resources/examples/periodicinboxcheck.json
+++ /dev/null
@@ -1,52 +0,0 @@
-{
- "id": "checkInbox",
- "name": "Check Inbox Workflow",
- "description": "Periodically Check Inbox",
- "start": {
- "stateName": "CheckInbox",
- "schedule": {
- "cron": "0 0/15 * * * ?"
- }
- },
- "version": "1.0",
- "functions": [
- {
- "name": "checkInboxFunction",
- "operation": "http://myapis.org/inboxapi.json#checkNewMessages"
- },
- {
- "name": "sendTextFunction",
- "operation": "http://myapis.org/inboxapi.json#sendText"
- }
- ],
- "states": [
- {
- "name": "CheckInbox",
- "type": "operation",
- "actionMode": "sequential",
- "actions": [
- {
- "functionRef": "checkInboxFunction"
- }
- ],
- "transition": "SendTextForHighPriority"
- },
- {
- "name": "SendTextForHighPriority",
- "type": "foreach",
- "inputCollection": "${ .messages }",
- "iterationParam": "singlemessage",
- "actions": [
- {
- "functionRef": {
- "refName": "sendTextFunction",
- "arguments": {
- "message": "${ .singlemessage }"
- }
- }
- }
- ],
- "end": true
- }
- ]
-}
\ No newline at end of file
diff --git a/diagram/src/test/resources/examples/periodicinboxcheck.yml b/diagram/src/test/resources/examples/periodicinboxcheck.yml
deleted file mode 100644
index 1d7de0bb..00000000
--- a/diagram/src/test/resources/examples/periodicinboxcheck.yml
+++ /dev/null
@@ -1,30 +0,0 @@
-id: checkInbox
-name: Check Inbox Workflow
-description: Periodically Check Inbox
-start:
- stateName: CheckInbox
- schedule:
- cron: 0 0/15 * * * ?
-version: '1.0'
-functions:
- - name: checkInboxFunction
- operation: http://myapis.org/inboxapi.json#checkNewMessages
- - name: sendTextFunction
- operation: http://myapis.org/inboxapi.json#sendText
-states:
- - name: CheckInbox
- type: operation
- actionMode: sequential
- actions:
- - functionRef: checkInboxFunction
- transition: SendTextForHighPriority
- - name: SendTextForHighPriority
- type: foreach
- inputCollection: "${ .messages }"
- iterationParam: singlemessage
- actions:
- - functionRef:
- refName: sendTextFunction
- arguments:
- message: "${ .singlemessage }"
- end: true
\ No newline at end of file
diff --git a/diagram/src/test/resources/examples/provisionorder.json b/diagram/src/test/resources/examples/provisionorder.json
deleted file mode 100644
index 1fb59102..00000000
--- a/diagram/src/test/resources/examples/provisionorder.json
+++ /dev/null
@@ -1,72 +0,0 @@
-{
- "id": "provisionorders",
- "version": "1.0",
- "name": "Provision Orders",
- "description": "Provision Orders and handle errors thrown",
- "start": "ProvisionOrder",
- "functions": [
- {
- "name": "provisionOrderFunction",
- "operation": "http://myapis.org/provisioningapi.json#doProvision"
- }
- ],
- "states":[
- {
- "name":"ProvisionOrder",
- "type":"operation",
- "actionMode":"sequential",
- "actions":[
- {
- "functionRef": {
- "refName": "provisionOrderFunction",
- "arguments": {
- "order": "${ .order }"
- }
- }
- }
- ],
- "stateDataFilter": {
- "output": "${ .exceptions }"
- },
- "transition": "ApplyOrder",
- "onErrors": [
- {
- "error": "Missing order id",
- "transition": "MissingId"
- },
- {
- "error": "Missing order item",
- "transition": "MissingItem"
- },
- {
- "error": "Missing order quantity",
- "transition": "MissingQuantity"
- }
- ]
- },
- {
- "name": "MissingId",
- "type": "subflow",
- "workflowId": "handleMissingIdExceptionWorkflow",
- "end": true
- },
- {
- "name": "MissingItem",
- "type": "subflow",
- "workflowId": "handleMissingItemExceptionWorkflow",
- "end": true
- },
- {
- "name": "MissingQuantity",
- "type": "subflow",
- "workflowId": "handleMissingQuantityExceptionWorkflow",
- "end": true
- },
- {
- "name": "ApplyOrder",
- "type": "subflow",
- "workflowId": "applyOrderWorkflowId",
- "end": true
- }
- ]
-}
\ No newline at end of file
diff --git a/diagram/src/test/resources/examples/provisionorder.yml b/diagram/src/test/resources/examples/provisionorder.yml
deleted file mode 100644
index b8eff2be..00000000
--- a/diagram/src/test/resources/examples/provisionorder.yml
+++ /dev/null
@@ -1,43 +0,0 @@
-id: provisionorders
-version: '1.0'
-name: Provision Orders
-description: Provision Orders and handle errors thrown
-start: ProvisionOrder
-functions:
- - name: provisionOrderFunction
- operation: http://myapis.org/provisioningapi.json#doProvision
-states:
- - name: ProvisionOrder
- type: operation
- actionMode: sequential
- actions:
- - functionRef:
- refName: provisionOrderFunction
- arguments:
- order: "${ .order }"
- stateDataFilter:
- output: "${ .exceptions }"
- transition: ApplyOrder
- onErrors:
- - error: Missing order id
- transition: MissingId
- - error: Missing order item
- transition: MissingItem
- - error: Missing order quantity
- transition: MissingQuantity
- - name: MissingId
- type: subflow
- workflowId: handleMissingIdExceptionWorkflow
- end: true
- - name: MissingItem
- type: subflow
- workflowId: handleMissingItemExceptionWorkflow
- end: true
- - name: MissingQuantity
- type: subflow
- workflowId: handleMissingQuantityExceptionWorkflow
- end: true
- - name: ApplyOrder
- type: subflow
- workflowId: applyOrderWorkflowId
- end: true
\ No newline at end of file
diff --git a/diagram/src/test/resources/examples/roomreadings.json b/diagram/src/test/resources/examples/roomreadings.json
deleted file mode 100644
index aab4f25d..00000000
--- a/diagram/src/test/resources/examples/roomreadings.json
+++ /dev/null
@@ -1,82 +0,0 @@
-{
- "id": "roomreadings",
- "name": "Room Temp and Humidity Workflow",
- "version": "1.0",
- "start": "ConsumeReading",
- "execTimeout": {
- "duration": "PT1H",
- "runBefore": "GenerateReport"
- },
- "keepActive": true,
- "states": [
- {
- "name": "ConsumeReading",
- "type": "event",
- "onEvents": [
- {
- "eventRefs": ["TemperatureEvent", "HumidityEvent"],
- "actions": [
- {
- "functionRef": {
- "refName": "LogReading"
- }
- }
- ],
- "eventDataFilter": {
- "data": "${ .readings }"
- }
- }
- ],
- "end": true
- },
- {
- "name": "GenerateReport",
- "type": "operation",
- "actions": [
- {
- "functionRef": {
- "refName": "ProduceReport",
- "arguments": {
- "data": "${ .readings }"
- }
- }
- }
- ],
- "end": {
- "terminate": true
- }
- }
- ],
- "events": [
- {
- "name": "TemperatureEvent",
- "type": "my.home.sensors",
- "source": "/home/rooms/+",
- "correlation": [
- {
- "contextAttributeName": "roomId"
- }
- ]
- },
- {
- "name": "HumidityEvent",
- "type": "my.home.sensors",
- "source": "/home/rooms/+",
- "correlation": [
- {
- "contextAttributeName": "roomId"
- }
- ]
- }
- ],
- "functions": [
- {
- "name": "LogReading",
- "operation": "http.myorg.io/ordersservices.json#logreading"
- },
- {
- "name": "ProduceReport",
- "operation": "http.myorg.io/ordersservices.json#produceReport"
- }
- ]
-}
\ No newline at end of file
diff --git a/diagram/src/test/resources/examples/roomreadings.yml b/diagram/src/test/resources/examples/roomreadings.yml
deleted file mode 100644
index cfbf2e82..00000000
--- a/diagram/src/test/resources/examples/roomreadings.yml
+++ /dev/null
@@ -1,46 +0,0 @@
-id: roomreadings
-name: Room Temp and Humidity Workflow
-version: '1.0'
-start: ConsumeReading
-execTimeout:
- duration: PT1H
- runBefore: GenerateReport
-keepActive: true
-states:
- - name: ConsumeReading
- type: event
- onEvents:
- - eventRefs:
- - TemperatureEvent
- - HumidityEvent
- actions:
- - functionRef:
- refName: LogReading
- eventDataFilter:
- data: "${ .readings }"
- end: true
- - name: GenerateReport
- type: operation
- actions:
- - functionRef:
- refName: ProduceReport
- arguments:
- data: "${ .readings }"
- end:
- terminate: true
-events:
- - name: TemperatureEvent
- type: my.home.sensors
- source: "/home/rooms/+"
- correlation:
- - contextAttributeName: roomId
- - name: HumidityEvent
- type: my.home.sensors
- source: "/home/rooms/+"
- correlation:
- - contextAttributeName: roomId
-functions:
- - name: LogReading
- operation: http.myorg.io/ordersservices.json#logreading
- - name: ProduceReport
- operation: http.myorg.io/ordersservices.json#produceReport
\ No newline at end of file
diff --git a/diagram/src/test/resources/examples/sendcloudevent.json b/diagram/src/test/resources/examples/sendcloudevent.json
deleted file mode 100644
index 5b94fc11..00000000
--- a/diagram/src/test/resources/examples/sendcloudevent.json
+++ /dev/null
@@ -1,44 +0,0 @@
-{
- "id": "sendcloudeventonprovision",
- "version": "1.0",
- "name": "Send CloudEvent on provision completion",
- "start": "ProvisionOrdersState",
- "events": [
- {
- "name": "provisioningCompleteEvent",
- "type": "provisionCompleteType",
- "kind": "produced"
- }
- ],
- "functions": [
- {
- "name": "provisionOrderFunction",
- "operation": "http://myapis.org/provisioning.json#doProvision"
- }
- ],
- "states": [
- {
- "name": "ProvisionOrdersState",
- "type": "foreach",
- "inputCollection": "${ .orders }",
- "iterationParam": "singleorder",
- "outputCollection": "${ .provisionedOrders }",
- "actions": [
- {
- "functionRef": {
- "refName": "provisionOrderFunction",
- "arguments": {
- "order": "${ .singleorder }"
- }
- }
- }
- ],
- "end": {
- "produceEvents": [{
- "eventRef": "provisioningCompleteEvent",
- "data": "${ .provisionedOrders }"
- }]
- }
- }
- ]
-}
\ No newline at end of file
diff --git a/diagram/src/test/resources/examples/sendcloudevent.yml b/diagram/src/test/resources/examples/sendcloudevent.yml
deleted file mode 100644
index 1359fb10..00000000
--- a/diagram/src/test/resources/examples/sendcloudevent.yml
+++ /dev/null
@@ -1,26 +0,0 @@
-id: sendcloudeventonprovision
-version: '1.0'
-name: Send CloudEvent on provision completion
-start: ProvisionOrdersState
-events:
- - name: provisioningCompleteEvent
- type: provisionCompleteType
- kind: produced
-functions:
- - name: provisionOrderFunction
- operation: http://myapis.org/provisioning.json#doProvision
-states:
- - name: ProvisionOrdersState
- type: foreach
- inputCollection: "${ .orders }"
- iterationParam: singleorder
- outputCollection: "${ .provisionedOrders }"
- actions:
- - functionRef:
- refName: provisionOrderFunction
- arguments:
- order: "${ .singleorder }"
- end:
- produceEvents:
- - eventRef: provisioningCompleteEvent
- data: "${ .provisionedOrders }"
\ No newline at end of file
diff --git a/diagram/src/test/resources/examples/singleeventstate.json b/diagram/src/test/resources/examples/singleeventstate.json
deleted file mode 100644
index ce027117..00000000
--- a/diagram/src/test/resources/examples/singleeventstate.json
+++ /dev/null
@@ -1,46 +0,0 @@
-{
- "id": "testEvents",
- "name": "Test Events Workflow",
- "description": "This is a test events workflow",
- "version": "1.0",
- "start": "EventState",
- "events": [
- {
- "name": "event1",
- "source": "event1source",
- "type": "event1type"
- },
- {
- "name": "event2",
- "source": "evet2source",
- "type": "event2type"
- },
- {
- "name": "event3",
- "source": "event3source",
- "type": "event3type"
- },
- {
- "name": "event4",
- "source": "event4source",
- "type": "event4type"
- }
- ],
- "states": [
- {
- "name": "EventState",
- "type": "event",
- "end": true,
- "onEvents": [
- {
- "eventRefs": ["event1", "event2"],
- "actions": []
- },
- {
- "eventRefs": ["event3", "event4"],
- "actions": []
- }
- ]
- }
- ]
-}
\ No newline at end of file
diff --git a/diagram/src/test/resources/examples/singleeventstate.yml b/diagram/src/test/resources/examples/singleeventstate.yml
deleted file mode 100644
index 874ddf9c..00000000
--- a/diagram/src/test/resources/examples/singleeventstate.yml
+++ /dev/null
@@ -1,32 +0,0 @@
----
-id: testEvents
-name: Test Events Workflow
-description: This is a test events workflow
-version: '1.0'
-start: EventState
-events:
- - name: event1
- source: event1source
- type: event1type
- - name: event2
- source: evet2source
- type: event2type
- - name: event3
- source: event3source
- type: event3type
- - name: event4
- source: event4source
- type: event4type
-states:
- - name: EventState
- type: event
- end: true
- onEvents:
- - eventRefs:
- - event1
- - event2
- actions: []
- - eventRefs:
- - event3
- - event4
- actions: []
diff --git a/diagram/src/test/resources/examples/singleswitchstate.json b/diagram/src/test/resources/examples/singleswitchstate.json
deleted file mode 100644
index 5531b55d..00000000
--- a/diagram/src/test/resources/examples/singleswitchstate.json
+++ /dev/null
@@ -1,47 +0,0 @@
-{
- "id": "testSwitch",
- "name": "Test Switch State Workflow",
- "description": "This is a test switch state workflow",
- "version": "1.0",
- "start": "SwitchIt",
- "states": [
- {
- "name": "SwitchIt",
- "type": "switch",
- "dataConditions": [
- {
- "name": "first",
- "condition": "",
- "transition": "FromFirstCondition"
- },
- {
- "name": "second",
- "condition": "",
- "transition": "FromSecondCondition"
- },
- {
- "name": "third",
- "condition": "",
- "end": true
- },
- {
- "name": "fourth",
- "condition": "",
- "end": true
- }
- ]
- },
- {
- "name": "FromFirstCondition",
- "type": "delay",
- "timeDelay": "PT2M",
- "end": true
- },
- {
- "name": "FromSecondCondition",
- "type": "inject",
- "data": {},
- "end": true
- }
- ]
-}
\ No newline at end of file
diff --git a/diagram/src/test/resources/examples/singleswitchstate.yml b/diagram/src/test/resources/examples/singleswitchstate.yml
deleted file mode 100644
index bf9dc2f3..00000000
--- a/diagram/src/test/resources/examples/singleswitchstate.yml
+++ /dev/null
@@ -1,30 +0,0 @@
----
-id: testSwitch
-name: Test Switch State Workflow
-description: This is a test switch state workflow
-version: '1.0'
-start: SwitchIt
-states:
- - name: SwitchIt
- type: switch
- dataConditions:
- - name: first
- condition: ''
- transition: FromFirstCondition
- - name: second
- condition: ''
- transition: FromSecondCondition
- - name: third
- condition: ''
- end: true
- - name: fourth
- condition: ''
- end: true
- - name: FromFirstCondition
- type: delay
- timeDelay: PT2M
- end: true
- - name: FromSecondCondition
- type: inject
- data: {}
- end: true
diff --git a/diagram/src/test/resources/examples/singleswitchstateeventconditions.json b/diagram/src/test/resources/examples/singleswitchstateeventconditions.json
deleted file mode 100644
index 9f0fd698..00000000
--- a/diagram/src/test/resources/examples/singleswitchstateeventconditions.json
+++ /dev/null
@@ -1,47 +0,0 @@
-{
- "id": "testSwitch",
- "name": "Test Switch State Workflow",
- "description": "This is a test switch state workflow",
- "version": "1.0",
- "start": "SwitchIt",
- "states": [
- {
- "name": "SwitchIt",
- "type": "switch",
- "eventConditions": [
- {
- "name": "first",
- "eventRef": "firstEvent",
- "transition": "FromFirstCondition"
- },
- {
- "name": "second",
- "eventRef": "secondEvent",
- "transition": "FromSecondCondition"
- },
- {
- "name": "third",
- "eventRef": "thirdEvent",
- "end": true
- },
- {
- "name": "fourth",
- "eventRef": "fourthEvent",
- "end": true
- }
- ]
- },
- {
- "name": "FromFirstCondition",
- "type": "delay",
- "timeDelay": "PT2M",
- "end": true
- },
- {
- "name": "FromSecondCondition",
- "type": "inject",
- "data": {},
- "end": true
- }
- ]
-}
\ No newline at end of file
diff --git a/diagram/src/test/resources/examples/singleswitchstateeventconditions.yml b/diagram/src/test/resources/examples/singleswitchstateeventconditions.yml
deleted file mode 100644
index e7934fdc..00000000
--- a/diagram/src/test/resources/examples/singleswitchstateeventconditions.yml
+++ /dev/null
@@ -1,30 +0,0 @@
----
-id: testSwitch
-name: Test Switch State Workflow
-description: This is a test switch state workflow
-version: '1.0'
-start: SwitchIt
-states:
- - name: SwitchIt
- type: switch
- eventConditions:
- - name: first
- eventRef: firstEvent
- transition: FromFirstCondition
- - name: second
- eventRef: secondEvent
- transition: FromSecondCondition
- - name: third
- eventRef: thirdEvent
- end: true
- - name: fourth
- eventRef: fourthEvent
- end: true
- - name: FromFirstCondition
- type: delay
- timeDelay: PT2M
- end: true
- - name: FromSecondCondition
- type: inject
- data: {}
- end: true
diff --git a/diagram/src/test/resources/examples/solvemathproblems.json b/diagram/src/test/resources/examples/solvemathproblems.json
deleted file mode 100644
index 25e00e33..00000000
--- a/diagram/src/test/resources/examples/solvemathproblems.json
+++ /dev/null
@@ -1,36 +0,0 @@
-{
- "id": "solvemathproblems",
- "version": "1.0",
- "name": "Solve Math Problems Workflow",
- "description": "Solve math problems",
- "start": "Solve",
- "functions": [
- {
- "name": "solveMathExpressionFunction",
- "operation": "http://myapis.org/mapthapis.json#solveExpression"
- }
- ],
- "states":[
- {
- "name":"Solve",
- "type":"foreach",
- "inputCollection": "${ .expressions }",
- "iterationParam": "singleexpression",
- "outputCollection": "${ .results }",
- "actions":[
- {
- "functionRef": {
- "refName": "solveMathExpressionFunction",
- "arguments": {
- "expression": "${ .singleexpression }"
- }
- }
- }
- ],
- "stateDataFilter": {
- "output": "${ .results }"
- },
- "end": true
- }
- ]
-}
\ No newline at end of file
diff --git a/diagram/src/test/resources/examples/solvemathproblems.yml b/diagram/src/test/resources/examples/solvemathproblems.yml
deleted file mode 100644
index b7bd1e27..00000000
--- a/diagram/src/test/resources/examples/solvemathproblems.yml
+++ /dev/null
@@ -1,22 +0,0 @@
-id: solvemathproblems
-version: '1.0'
-name: Solve Math Problems Workflow
-description: Solve math problems
-start: Solve
-functions:
- - name: solveMathExpressionFunction
- operation: http://myapis.org/mapthapis.json#solveExpression
-states:
- - name: Solve
- type: foreach
- inputCollection: "${ .expressions }"
- iterationParam: singleexpression
- outputCollection: "${ .results }"
- actions:
- - functionRef:
- refName: solveMathExpressionFunction
- arguments:
- expression: "${ .singleexpression }"
- stateDataFilter:
- output: "${ .results }"
- end: true
\ No newline at end of file
diff --git a/diagram/src/test/resources/examples/vetappointmentservice.json b/diagram/src/test/resources/examples/vetappointmentservice.json
deleted file mode 100644
index 230e0f73..00000000
--- a/diagram/src/test/resources/examples/vetappointmentservice.json
+++ /dev/null
@@ -1,40 +0,0 @@
-{
- "id": "VetAppointmentWorkflow",
- "name": "Vet Appointment Workflow",
- "description": "Vet service call via events",
- "version": "1.0",
- "start": "MakeVetAppointmentState",
- "events": [
- {
- "name": "MakeVetAppointment",
- "source": "VetServiceSoure",
- "kind": "produced"
- },
- {
- "name": "VetAppointmentInfo",
- "source": "VetServiceSource",
- "kind": "consumed"
- }
- ],
- "states": [
- {
- "name": "MakeVetAppointmentState",
- "type": "operation",
- "actions": [
- {
- "name": "MakeAppointmentAction",
- "eventRef": {
- "triggerEventRef": "MakeVetAppointment",
- "data": "${ .patientInfo }",
- "resultEventRef": "VetAppointmentInfo"
- },
- "actionDataFilter": {
- "results": "${ .appointmentInfo }"
- },
- "timeout": "PT15M"
- }
- ],
- "end": true
- }
- ]
-}
\ No newline at end of file
diff --git a/diagram/src/test/resources/examples/vetappointmentservice.yml b/diagram/src/test/resources/examples/vetappointmentservice.yml
deleted file mode 100644
index d976067e..00000000
--- a/diagram/src/test/resources/examples/vetappointmentservice.yml
+++ /dev/null
@@ -1,25 +0,0 @@
-id: VetAppointmentWorkflow
-name: Vet Appointment Workflow
-description: Vet service call via events
-version: '1.0'
-start: MakeVetAppointmentState
-events:
- - name: MakeVetAppointment
- source: VetServiceSoure
- kind: produced
- - name: VetAppointmentInfo
- source: VetServiceSource
- kind: consumed
-states:
- - name: MakeVetAppointmentState
- type: operation
- actions:
- - name: MakeAppointmentAction
- eventRef:
- triggerEventRef: MakeVetAppointment
- data: "${ .patientInfo }"
- resultEventRef: VetAppointmentInfo
- actionDataFilter:
- results: "${ .appointmentInfo }"
- timeout: PT15M
- end: true
\ No newline at end of file
diff --git a/examples/events/pom.xml b/examples/events/pom.xml
new file mode 100644
index 00000000..439b3a11
--- /dev/null
+++ b/examples/events/pom.xml
@@ -0,0 +1,21 @@
+