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:
cd swf
kn workflow runIn a separate terminal window:
./mvnw quarkus:dev -Ddebug=5006 -DskipTestsNote
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 Definitionstab- 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
taskerworkflow definition using the "play" icon.- Check the workflow instance status: it's waiting for the
external taskexecution.
- Check the workflow instance status: it's waiting for the
-
Open the task list application
- Type
okin the result field. - Click the
completebutton.
- 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/.