Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
65 changes: 25 additions & 40 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ to parse and validate workflow definitions as well as generate the workflow diag

| Latest Releases | Conformance to spec version |
| :---: | :---: |
| 4.0.0-SNAPSHOT (main branch) | [v0.8](https://github.com/serverlessworkflow/specification/tree/0.8.x) |
| [4.0.0.Final](https://github.com/serverlessworkflow/sdk-java/releases/) | [v0.8](https://github.com/serverlessworkflow/specification/tree/0.8.x) |
| [3.0.0.Final](https://github.com/serverlessworkflow/sdk-java/releases/) | [v0.7](https://github.com/serverlessworkflow/specification/tree/0.7.x) |
| [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) |
Expand All @@ -43,71 +43,50 @@ To use it in your projects you can:

#### Maven projects:

a) Add the following repository to your pom.xml `repositories` section:

```xml
<repository>
<id>oss.sonatype.org-snapshot</id>
<url>http://oss.sonatype.org/content/repositories/snapshots</url>
<releases>
<enabled>false</enabled>
</releases>
<snapshots>
<enabled>true</enabled>
</snapshots>
</repository>
```

b) Add the following dependencies to your pom.xml `dependencies` section:
Add the following dependencies to your pom.xml `dependencies` section:

```xml
<dependency>
<groupId>io.serverlessworkflow</groupId>
<artifactId>serverlessworkflow-api</artifactId>
<version>4.0.0-SNAPSHOT</version>
<version>4.0.0.Final</version>
</dependency>

<dependency>
<groupId>io.serverlessworkflow</groupId>
<artifactId>serverlessworkflow-spi</artifactId>
<version>4.0.0-SNAPSHOT</version>
<version>4.0.0.Final</version>
</dependency>

<dependency>
<groupId>io.serverlessworkflow</groupId>
<artifactId>serverlessworkflow-validation</artifactId>
<version>4.0.0-SNAPSHOT</version>
<version>4.0.0.Final</version>
</dependency>

<dependency>
<groupId>io.serverlessworkflow</groupId>
<artifactId>serverlessworkflow-diagram</artifactId>
<version>4.0.0-SNAPSHOT</version>
<version>4.0.0.Final</version>
</dependency>

<dependency>
<groupId>io.serverlessworkflow</groupId>
<artifactId>serverlessworkflow-util</artifactId>
<version>4.0.0-SNAPSHOT</version>
<version>4.0.0.Final</version>
</dependency>
```

#### Gradle projects:

a) Add the following repositories to your build.gradle `repositories` section:

```text
maven { url "https://oss.sonatype.org/content/repositories/snapshots" }
```

b) Add the following dependencies to your build.gradle `dependencies` section:
Add the following dependencies to your build.gradle `dependencies` section:

```text
implementation("io.serverlessworkflow:serverlessworkflow-api:4.0.0-SNAPSHOT")
implementation("io.serverlessworkflow:serverlessworkflow-spi:4.0.0-SNAPSHOT")
implementation("io.serverlessworkflow:serverlessworkflow-validation:4.0.0-SNAPSHOT")
implementation("io.serverlessworkflow:serverlessworkflow-diagram:4.0.0-SNAPSHOT")
implementation("io.serverlessworkflow:serverlessworkflow-util:4.0.0-SNAPSHOT")
implementation("io.serverlessworkflow:serverlessworkflow-api:4.0.0.Final")
implementation("io.serverlessworkflow:serverlessworkflow-spi:4.0.0.Final")
implementation("io.serverlessworkflow:serverlessworkflow-validation:4.0.0.Final")
implementation("io.serverlessworkflow:serverlessworkflow-diagram:4.0.0.Final")
implementation("io.serverlessworkflow:serverlessworkflow-util:4.0.0.Final")
```

### How to Use
Expand Down Expand Up @@ -296,36 +275,42 @@ Here are some generated diagrams from the specification examples (with legend en
Workflow utils provide a number of useful methods for extracting information from workflow definitions.
Once you have a `Workflow` instance, you can use it
##### Get Starting State
```Java

```java
State startingState = WorkflowUtils.getStartingState(workflow);
```
##### Get States by State Type
```Java

```java
List<State> states = WorkflowUtils.getStates(workflow, DefaultState.Type.EVENT);
```
##### Get Consumed-Events, Produced-Events and their count
```Java

```java
List<EventDefinition> consumedEvents = WorkflowUtils.getWorkflowConsumedEvents(workflow);
int consumedEventsCount = WorkflowUtils.getWorkflowConsumedEventsCount(workflow);

List<EventDefinition> producedEvents = WorkflowUtils.getWorkflowProducedEvents(workflow);
int producedEventsCount = WorkflowUtils.getWorkflowProducedEventsCount(workflow);
```
##### Get Defined Consumed-Events, Defined Produced-Events and their count
```Java

```java
List<EventDefinition> consumedEvents = WorkflowUtils.getWorkflowConsumedEventsCount(workflow);
int consumedEventsCount = WorkflowUtils.getWorkflowConsumedEventsCount(workflow);

List<EventDefinition> producedEvents = WorkflowUtils.getWorkflowProducedEvents(workflow);
int producedEventsCount = WorkflowUtils.getWorkflowProducedEventsCount(workflow);
```
##### Get Function definitions which is used by an action
```Java

```java
FunctionDefinition finalizeApplicationFunctionDefinition =
WorkflowUtils.getFunctionDefinitionsForAction(workflow, "finalizeApplicationAction");
```
##### Get Actions which uses a Function definition
```Java

```java
List<Action> actionsForFunctionDefinition =
WorkflowUtils.getActionsForFunctionDefinition(workflow, functionRefName);
```
2 changes: 1 addition & 1 deletion api/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
<parent>
<groupId>io.serverlessworkflow</groupId>
<artifactId>serverlessworkflow-parent</artifactId>
<version>4.0.0-SNAPSHOT</version>
<version>4.0.0.Final</version>
</parent>

<artifactId>serverlessworkflow-api</artifactId>
Expand Down
2 changes: 1 addition & 1 deletion diagram/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
<parent>
<groupId>io.serverlessworkflow</groupId>
<artifactId>serverlessworkflow-parent</artifactId>
<version>4.0.0-SNAPSHOT</version>
<version>4.0.0.Final</version>
</parent>

<artifactId>serverlessworkflow-diagram</artifactId>
Expand Down
Loading