This project demonstrates an integration strategy for delegating tasks to an external system for processing. The workflow seamlessly incorporates the results returned by the external system to dynamically adjust subsequent execution steps.
The core of this project is a single-page application (SPA) that simulates the behavior of the external system. This SPA features a user-friendly task list interface. Users can select a task from the list and then provide a string-based result upon completion. This simulated environment allows for thorough testing and evaluation of the task delegation and result handling mechanisms within the workflow.
Caution
This application is a Proof of Concept and deliberately designed not to scale out. It must run as a single instance and isn't resilient to restart. In fact, the data store and event distribution (SSE) are kept in memory.
Launch the Serverless Workflow engine:
podman kube play podman-kube-play.yaml
Alternatively, you can use this command:
podman run --network=host --rm --name swf-devmode -v ./swf:/home/kogito/serverless-workflow-project/src/main/resources:Z registry.redhat.io/openshift-serverless-1/logic-swf-devmode-rhel8:1.34.0
To inspect the engine logs:
podman logs -f swf-devmode-pod-swf-devmode
To shutdown the engine:
podman kube down podman-kube-play.yaml
./mvnw quarkus:dev -Ddebug=5006 -DskipTests
Note
to avoid port conflicts, the application uses the port 8081
for HTTP protocol and 5006
for the debugging agent.
-
Open the Serverless Workflow web console.
-
Select
Workflow Definitions
tab- Optionally, set input information to be passed down to the external task application. E.g.
{ "input": "approve the related documentation" }
- Optionally, set input information to be passed down to the external task application. E.g.
-
Start
tasker
workflow definition using the "play" icon.- Check the workflow instance status: it's waiting for the
external task
execution.
- Check the workflow instance status: it's waiting for the
-
Open the task list application
- Type
ok
in the result field. - Click the
complete
button.
- Type
-
In the Serverless Workflow web console, check the workflow progress: the external task is completed and the workflow follow the correct path.
-
Optionally, check the Serverless Workflow log to verify the result of the external task.
This project uses Quarkus, the Supersonic Subatomic Java Framework.
If you want to learn more about Quarkus, please visit its website: https://quarkus.io/.