diff --git a/README.md b/README.md index 20babf07..a720252e 100644 --- a/README.md +++ b/README.md @@ -18,9 +18,8 @@ to parse and validate workflow definitions as well as generate the workflow diag | Latest Releases | Conformance to spec version | | :---: | :---: | -| [1.0.1.Final](https://github.com/serverlessworkflow/sdk-java/releases/) | [v0.5](https://github.com/serverlessworkflow/specification/tree/0.5.x) | -| [1.0.2.Final](https://github.com/serverlessworkflow/sdk-java/releases/) | [v0.5](https://github.com/serverlessworkflow/specification/tree/0.5.x) + [Compensation support](https://github.com/serverlessworkflow/specification/blob/master/specification.md#Workflow-Compensation) | -| [1.0.3.Final](https://github.com/serverlessworkflow/sdk-java/releases/) | [v0.5](https://github.com/serverlessworkflow/specification/tree/0.5.x) + [Compensation support](https://github.com/serverlessworkflow/specification/blob/master/specification.md#Workflow-Compensation) + [Update to start/end definitions](https://github.com/serverlessworkflow/sdk-java/commit/1addf8d66450830cbc3542c8dfb968b3791aba6f) | +| [2.0.0.Final](https://github.com/serverlessworkflow/sdk-java/releases/) | [v0.6](https://github.com/serverlessworkflow/specification/tree/0.6.x) | +| [1.0.3.Final](https://github.com/serverlessworkflow/sdk-java/releases/) | [v0.5](https://github.com/serverlessworkflow/specification/tree/0.5.x) | ### Getting Started @@ -58,25 +57,25 @@ b) Add the following dependencies to your pom.xml `dependencies` section: io.serverlessworkflow serverlessworkflow-api - 2.0.0-SNAPSHOT + 2.0.x io.serverlessworkflow serverlessworkflow-spi - 2.0.0-SNAPSHOT + 2.0.x io.serverlessworkflow serverlessworkflow-validation - 2.0.0-SNAPSHOT + 2.0.x io.serverlessworkflow serverlessworkflow-diagram - 2.0.0-SNAPSHOT + 2.0.x ``` @@ -91,10 +90,10 @@ maven { url "https://oss.sonatype.org/content/repositories/snapshots" } b) Add the following dependencies to your build.gradle `dependencies` section: ```text -implementation("io.serverlessworkflow:serverlessworkflow-api:2.0.0-SNAPSHOT") -implementation("io.serverlessworkflow:serverlessworkflow-spi:2.0.0-SNAPSHOT") -implementation("io.serverlessworkflow:serverlessworkflow-validation:2.0.0-SNAPSHOT") -implementation("io.serverlessworkflow:serverlessworkflow-diagram:2.0.0-SNAPSHOT") +implementation("io.serverlessworkflow:serverlessworkflow-api:2.0.x") +implementation("io.serverlessworkflow:serverlessworkflow-spi:2.0.x") +implementation("io.serverlessworkflow:serverlessworkflow-validation:2.0.x") +implementation("io.serverlessworkflow:serverlessworkflow-diagram:2.0.x") ``` ### How to Use @@ -117,16 +116,15 @@ functions: states: - name: Greet type: operation - actionMode: sequential actions: - functionRef: refName: greetingFunction arguments: - name: ".greet.name" + name: "${ .greet.name }" actionDataFilter: - dataResultsPath: ".payload.greeting" + results: "${ .payload.greeting }" stateDataFilter: - output: ".greeting" + output: "${ .greeting }" end: true ``` @@ -158,7 +156,6 @@ assertTrue(workflow.getStates().get(0) instanceof OperationState); OperationState operationState = (OperationState) workflow.getStates().get(0); assertEquals("Greet", operationState.getName()); assertEquals(DefaultState.Type.OPERATION, operationState.getType()); - ... ``` @@ -167,20 +164,21 @@ assertEquals(DefaultState.Type.OPERATION, operationState.getType()); You can also programmatically create Workflow instances, for example: ``` java -Workflow workflow = new Workflow().withId("test-workflow").withName("test-workflow-name").withVersion("1.0") +Workflow workflow = new Workflow() + .withId("test-workflow") + .withName("test-workflow-name") + .withVersion("1.0") + .withStart(new Start().withStateName("MyDelayState")) .withFunctions(new Functions(Arrays.asList( new FunctionDefinition().withName("testFunction") .withOperation("testSwaggerDef#testOperationId"))) ) .withStates(Arrays.asList( - new DelayState().withName("delayState").withType(DELAY) - .withStart( - new Start().withKind(Start.Kind.DEFAULT) - ) + new DelayState().withName("MyDelayState").withType(DELAY) + .withTimeDelay("PT1M") .withEnd( - new End().withKind(End.Kind.DEFAULT) + new End().withTerminate(true) ) - .withTimeDelay("PT1M") ) ); ``` @@ -218,16 +216,16 @@ boolean isValidWorkflow = workflowValidator.setSource("WORKFLOW_MODEL_JSON/YAML" If you build your Workflow programmatically, you can validate it as well: ``` java -Workflow workflow = new Workflow().withId("test-workflow").withVersion("1.0") +Workflow workflow = new Workflow() + .withId("test-workflow") + .withVersion("1.0") + .withStart(new Start().withStateName("MyDelayState")) .withStates(Arrays.asList( - new DelayState().withName("delayState").withType(DefaultState.Type.DELAY) - .withStart( - new Start().withKind(Start.Kind.DEFAULT) - ) + new DelayState().withName("MyDelayState").withType(DefaultState.Type.DELAY) + .withTimeDelay("PT1M") .withEnd( - new End().withKind(End.Kind.DEFAULT) + new End().withTerminate(true) ) - .withTimeDelay("PT1M") )); ); diff --git a/api/pom.xml b/api/pom.xml index aa480f4e..9a698fd9 100644 --- a/api/pom.xml +++ b/api/pom.xml @@ -6,11 +6,13 @@ io.serverlessworkflow serverlessworkflow-parent - 2.0.0-SNAPSHOT + 2.0.x serverlessworkflow-api Serverless Workflow :: API + ${project.parent.version} + jar Java SDK for Serverless Workflow Specification @@ -18,6 +20,10 @@ org.slf4j slf4j-api + + org.slf4j + jcl-over-slf4j + com.fasterxml.jackson.core jackson-core diff --git a/diagram/pom.xml b/diagram/pom.xml index e89a9cde..67e0151a 100644 --- a/diagram/pom.xml +++ b/diagram/pom.xml @@ -6,11 +6,13 @@ io.serverlessworkflow serverlessworkflow-parent - 2.0.0-SNAPSHOT + 2.0.x serverlessworkflow-diagram Serverless Workflow :: Diagram + ${project.parent.version} + jar Java SDK for Serverless Workflow Specification diff --git a/pom.xml b/pom.xml index f6da6784..233b11e3 100644 --- a/pom.xml +++ b/pom.xml @@ -5,7 +5,7 @@ io.serverlessworkflow serverlessworkflow-parent - 2.0.0-SNAPSHOT + 2.0.x pom Serverless Workflow :: Parent @@ -24,6 +24,20 @@ + + scm:git:git://github.com/serverlessworkflow/sdk-java.git + scm:git:git@github.com:serverlessworkflow/sdk-java.git + https://github.com/serverlessworkflow/sdk-java + + + + + tsurdilo + Tihomir Surdilovic + + + + api spi @@ -71,6 +85,11 @@ slf4j-api ${version.org.slf4j} + + org.slf4j + jcl-over-slf4j + ${version.org.slf4j} + com.fasterxml.jackson.core jackson-core @@ -100,6 +119,12 @@ com.github.erosb everit-json-schema ${json.schema.validation.version} + + + commons-logging + commons-logging + + org.json @@ -175,7 +200,6 @@ - maven-deploy-plugin @@ -233,14 +257,56 @@ org.apache.maven.plugins - maven-failsafe-plugin - ${version.failsafe.plugin} + maven-source-plugin + 3.0.1 + + + attach-sources + + jar + + + + + + org.apache.maven.plugins + maven-javadoc-plugin + 2.10.4 - -Xmx1024m -XX:MaxPermSize=256m + 8 + -Xdoclint:none + + + attach-javadocs + + jar + + + + + + org.apache.maven.plugins + maven-gpg-plugin + 1.6 + + + sign-artifacts + verify + + sign + + + + --batch + --pinentry-mode + loopback + + + + - diff --git a/spi/pom.xml b/spi/pom.xml index da5821a8..2f267f03 100644 --- a/spi/pom.xml +++ b/spi/pom.xml @@ -6,11 +6,13 @@ io.serverlessworkflow serverlessworkflow-parent - 2.0.0-SNAPSHOT + 2.0.x serverlessworkflow-spi Serverless Workflow :: SPI + ${project.parent.version} + jar Java SDK for Serverless Workflow Specification diff --git a/validation/pom.xml b/validation/pom.xml index 887b9705..d083dff2 100644 --- a/validation/pom.xml +++ b/validation/pom.xml @@ -6,11 +6,13 @@ io.serverlessworkflow serverlessworkflow-parent - 2.0.0-SNAPSHOT + 2.0.x serverlessworkflow-validation Serverless Workflow :: Validation + ${project.parent.version} + jar Java SDK for Serverless Workflow Specification @@ -18,6 +20,10 @@ org.slf4j slf4j-api + + org.slf4j + jcl-over-slf4j + io.serverlessworkflow