Extract product-agnostic workflow engine from Ablera.Serdica.Workflow into standalone StellaOps.Workflow.* libraries targeting net10.0. Libraries (14): - Contracts, Abstractions (compiler, decompiler, expression runtime) - Engine (execution, signaling, scheduling, projections, hosted services) - ElkSharp (generic graph layout algorithm) - Renderer.ElkSharp, Renderer.ElkJs, Renderer.Msagl, Renderer.Svg - Signaling.Redis, Signaling.OracleAq - DataStore.MongoDB, DataStore.PostgreSQL, DataStore.Oracle WebService: ASP.NET Core Minimal API with 22 endpoints Tests (8 projects, 109 tests pass): - Engine.Tests (105 pass), WebService.Tests (4 E2E pass) - Renderer.Tests, DataStore.MongoDB/Oracle/PostgreSQL.Tests - Signaling.Redis.Tests, IntegrationTests.Shared Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
1.4 KiB
1.4 KiB
Tutorial 4: Human Tasks with OnComplete Flows
The approve/reject pattern — the most common human task flow in insurance workflows.
Concepts Introduced
WorkflowHumanTask.For<T>()— define a task with name, type, route, and roles.WithPayload()— data sent to the UI when the task is displayed.WithTimeout(seconds)— optional deadline for the task.WithRoles()— restrict which roles can interact with this task.OnComplete(flow => ...)— sequence executed after user completes the task.ActivateTask()— pause workflow and wait for user action.AddTask()— register a task in the workflow spec (separate from activation)- Re-activation — send the user back to the same task on validation failure
Approve/Reject Pattern
- Workflow starts, runs some service tasks
.ActivateTask("Approve")— workflow pauses- User sees the task in their inbox, assigns it, submits an answer
.OnCompletecheckspayload.answer:"approve"— run confirmation operations, convert to policy"reject"— cancel the application
- If operations fail, re-activate the same task for correction
Variants
Next
Tutorial 5: Sub-Workflows — inline vs fire-and-forget child workflows.