Skip to content

Commit 731a2ae

Browse files
Upgrade 5.x deps (#1688)
* Bump the patch-updates group with 4 updates Bumps the patch-updates group with 4 updates: org.slf4j:slf4j-api, org.slf4j:jcl-over-slf4j, [org.codehaus.mojo:buildnumber-maven-plugin](https://github.com/mojohaus/buildnumber-maven-plugin) and [org.jsonschema2pojo:jsonschema2pojo-maven-plugin](https://github.com/joelittlejohn/jsonschema2pojo). Updates `org.slf4j:slf4j-api` from 2.0.18 to 2.0.19 Updates `org.slf4j:jcl-over-slf4j` from 2.0.18 to 2.0.19 Updates `org.slf4j:jcl-over-slf4j` from 2.0.18 to 2.0.19 Updates `org.codehaus.mojo:buildnumber-maven-plugin` from 3.3.0 to 3.3.1 - [Release notes](https://github.com/mojohaus/buildnumber-maven-plugin/releases) - [Commits](mojohaus/buildnumber-maven-plugin@buildnumber-maven-plugin-3.3.0...buildnumber-maven-plugin-3.3.1) Updates `org.jsonschema2pojo:jsonschema2pojo-maven-plugin` from 1.3.1 to 1.3.3 - [Release notes](https://github.com/joelittlejohn/jsonschema2pojo/releases) - [Changelog](https://github.com/joelittlejohn/jsonschema2pojo/blob/master/CHANGELOG.md) - [Commits](joelittlejohn/jsonschema2pojo@jsonschema2pojo-1.3.1...jsonschema2pojo-1.3.3) --- updated-dependencies: - dependency-name: org.slf4j:slf4j-api dependency-version: 2.0.19 dependency-type: direct:production update-type: version-update:semver-patch dependency-group: patch-updates - dependency-name: org.slf4j:jcl-over-slf4j dependency-version: 2.0.19 dependency-type: direct:production update-type: version-update:semver-patch dependency-group: patch-updates - dependency-name: org.slf4j:jcl-over-slf4j dependency-version: 2.0.19 dependency-type: direct:production update-type: version-update:semver-patch dependency-group: patch-updates - dependency-name: org.codehaus.mojo:buildnumber-maven-plugin dependency-version: 3.3.1 dependency-type: direct:development update-type: version-update:semver-patch dependency-group: patch-updates - dependency-name: org.jsonschema2pojo:jsonschema2pojo-maven-plugin dependency-version: 1.3.3 dependency-type: direct:production update-type: version-update:semver-patch dependency-group: patch-updates ... Signed-off-by: dependabot[bot] <support@github.com> * Pin jsonschema2pojo to 1.3.1 and drop workflow-to-SVG feature jsonschema2pojo 1.3.2/1.3.3 has an upstream regression generating invalid List<@Valid java.lang.String> syntax; pin back to 1.3.1. Also removes the diagram module and the diagram-rest addon along with their PlantUML/Thymeleaf/Graphviz dependencies: PlantUML is GPL-3.0-licensed, incompatible with distributing this project's Apache-2.0-licensed artifacts. Signed-off-by: Matheus Cruz <matheuscruz.dev@gmail.com> * Replace Logback with slf4j-simple Logback is LGPL-2.1-licensed. Swap it for org.slf4j:slf4j-simple (MIT) as the test-scope SLF4J binding. Signed-off-by: Matheus Cruz <matheuscruz.dev@gmail.com> --------- Signed-off-by: dependabot[bot] <support@github.com> Signed-off-by: Matheus Cruz <matheuscruz.dev@gmail.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
1 parent 5a93476 commit 731a2ae

80 files changed

Lines changed: 18 additions & 4239 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

‎README.md‎

Lines changed: 5 additions & 92 deletions
Original file line numberDiff line numberDiff line change
@@ -10,11 +10,14 @@ With the SDK you can:
1010
* Parse workflow JSON and YAML definitions
1111
* Programmatically build workflow definitions
1212
* Validate workflow definitions (both schema and workflow integrity validation)
13-
* Generate workflow diagram (SVG)
1413
* Set of utilities to help runtimes interpret the Serverless Workflow object model
1514

1615
Serverless Workflow Java SDK is **not** a workflow runtime implementation but can be used by Java runtime implementations
17-
to parse and validate workflow definitions as well as generate the workflow diagram (SVG).
16+
to parse and validate workflow definitions.
17+
18+
> **Note:** The `serverlessworkflow-diagram` module (workflow-to-SVG diagram generation) and the `diagram-rest` addon
19+
> have been removed. They depended on [PlantUML](https://plantuml.com/), which is GPL-3.0-licensed and incompatible
20+
> with distributing this project's Apache-2.0-licensed artifacts.
1821
1922
### Status
2023

@@ -90,12 +93,6 @@ b) Add the following dependencies to your pom.xml `dependencies` section:
9093
<version>5.1.0.Final</version>
9194
</dependency>
9295

93-
<dependency>
94-
<groupId>io.serverlessworkflow</groupId>
95-
<artifactId>serverlessworkflow-diagram</artifactId>
96-
<version>5.1.0.Final</version>
97-
</dependency>
98-
9996
<dependency>
10097
<groupId>io.serverlessworkflow</groupId>
10198
<artifactId>serverlessworkflow-util</artifactId>
@@ -117,7 +114,6 @@ b) Add the following dependencies to your build.gradle `dependencies` section:
117114
implementation("io.serverlessworkflow:serverlessworkflow-api:5.1.0.Final")
118115
implementation("io.serverlessworkflow:serverlessworkflow-spi:5.1.0.Final")
119116
implementation("io.serverlessworkflow:serverlessworkflow-validation:5.1.0.Final")
120-
implementation("io.serverlessworkflow:serverlessworkflow-diagram:5.1.0.Final")
121117
implementation("io.serverlessworkflow:serverlessworkflow-util:5.1.0.Final")
122118
```
123119

@@ -258,67 +254,6 @@ WorkflowValidator workflowValidator = new WorkflowValidatorImpl();
258254
List<ValidationError> validationErrors = workflowValidator.setWorkflow(workflow).validate();
259255
```
260256

261-
#### Building Workflow Diagram
262-
263-
Given a valid workflow definition (JSON/YAML) or a Workflow object you can build the workflow diagram SVG.
264-
The generated diagram SVG uses [PlantUML](https://plantuml.com/) state diagram visualization and can be embedded inside your
265-
tooling or web pages, or any SVG viewer.
266-
267-
You can build the workflow diagram SVG with the following code:
268-
269-
``` java
270-
Workflow workflow = Workflow.fromSource(source);
271-
272-
WorkflowDiagram workflowDiagram = new WorkflowDiagramImpl();
273-
workflowDiagram.setWorkflow(workflow);
274-
275-
String diagramSVG = workflowDiagram.getSvgDiagram();
276-
```
277-
278-
`diagramSVG` includes the diagram SVG source which you can then decide to save to a file,
279-
print, or process further.
280-
281-
In case default visualization of the workflow is not sufficient you can provide custom workflow template to be
282-
used while generating the SVG file. Easiest is to start off from the default template and customize it to your needs.
283-
284-
Custom template must be on the classpath in `templates/plantuml` directory and must use `.txt` extension. Next
285-
template is set on `WorkflowDiagram` instance as shown below.
286-
287-
``` java
288-
Workflow workflow = Workflow.fromSource(source);
289-
290-
WorkflowDiagram workflowDiagram = new WorkflowDiagramImpl();
291-
workflowDiagram.setWorkflow(workflow);
292-
workflowDiagram.setTemplate("custom-template");
293-
294-
String diagramSVG = workflowDiagram.getSvgDiagram();
295-
```
296-
297-
By default the diagram legend is now shown. If you want to enable it you can do:
298-
299-
``` java
300-
Workflow workflow = Workflow.fromSource(source);
301-
302-
WorkflowDiagram workflowDiagram = new WorkflowDiagramImpl();
303-
workflowDiagram.setWorkflow(workflow)
304-
.showLegend(true);
305-
306-
String diagramSVG = workflowDiagram.getSvgDiagram();
307-
```
308-
309-
Here are some generated diagrams from the specification examples (with legend enabled):
310-
311-
1. [Job Monitoring Example](https://github.com/serverlessworkflow/specification/blob/master/examples/examples.md#Monitor-Job-Example)
312-
<p align="center">
313-
<img src="img/jobmonitoring.png" alt="Job Monitoring Example Diagram"/>
314-
</p>
315-
316-
317-
2. [Send CloudEvent on Workflow completion Example](https://github.com/serverlessworkflow/specification/blob/master/examples/examples.md#send-cloudevent-on-workfow-completion-example)
318-
<p align="center">
319-
<img src="img/provisionorders.png" alt="Send Cloud Event on Workflow completion"/>
320-
</p>
321-
322257
#### Using Workflow Utils
323258
Workflow utils provide a number of useful methods for extracting information from workflow definitions.
324259
Once you have a `Workflow` instance, you can use it
@@ -357,26 +292,4 @@ FunctionDefinition finalizeApplicationFunctionDefinition =
357292
WorkflowUtils.getActionsForFunctionDefinition(workflow, functionRefName);
358293
```
359294

360-
#### Extra
361-
362-
SDK includes extra functionalities which are not part of core modules but
363-
are very useful and can be used as addons to the core:
364-
365-
##### Diagram REST
366-
This is a Spring Boot app which builds a rest api for diagram generation.
367-
It was contributed by our community member David Marques.
368-
369-
To start using it:
370-
371-
```
372-
cd diagram-rest
373-
mvn clean install spring-boot:run
374-
```
375-
376-
Then you can get the diagram SVG for a workflow definition for example:
377-
378-
```
379-
curl -X POST localhost:8090/diagram -d '{"id":"booklending","name":"Book Lending Workflow","version":"1.0","specVersion":"0.8","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":"sleep","duration":"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":[]}'
380-
```
381-
382295

‎api/pom.xml‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -59,8 +59,8 @@
5959
<scope>test</scope>
6060
</dependency>
6161
<dependency>
62-
<groupId>ch.qos.logback</groupId>
63-
<artifactId>logback-classic</artifactId>
62+
<groupId>org.slf4j</groupId>
63+
<artifactId>slf4j-simple</artifactId>
6464
<scope>test</scope>
6565
</dependency>
6666
<dependency>

‎diagram-rest/.gitignore‎

Lines changed: 0 additions & 31 deletions
This file was deleted.

‎diagram-rest/pom.xml‎

Lines changed: 0 additions & 58 deletions
This file was deleted.

‎diagram-rest/src/main/java/io/serverlessworkflow/diagramrest/Application.java‎

Lines changed: 0 additions & 26 deletions
This file was deleted.

‎diagram-rest/src/main/java/io/serverlessworkflow/diagramrest/DiagramRequest.java‎

Lines changed: 0 additions & 43 deletions
This file was deleted.

‎diagram-rest/src/main/java/io/serverlessworkflow/diagramrest/DiagramRequestHelper.java‎

Lines changed: 0 additions & 44 deletions
This file was deleted.

‎diagram-rest/src/main/java/io/serverlessworkflow/diagramrest/RouterRest.java‎

Lines changed: 0 additions & 34 deletions
This file was deleted.

0 commit comments

Comments
 (0)