Background
The current casehub-work-flow bridge (HumanTaskFlowBridge) wraps WorkItem creation in a Quarkus-Flow Java DSL function task returning a Uni. This works but is Quarkus-specific — it does not use the SWF 1.0 native pattern for async human interaction.
The idiomatic SWF 1.0 pattern for human-in-the-loop is emit + listen:
tasks:
- requestReview:
emit:
event:
with:
type: work.item.requested
data: ${ { title: "IRB Review", candidateGroups: "ethics-committee" } }
- waitForReview:
listen:
to:
one:
with:
type: work.item.completed
CaseHub's WorkItemEventBroadcaster already fires lifecycle events — these could be surfaced as CloudEvents to close the listen loop.
Proposed
- A CDI observer subscribes to
work.item.requested CloudEvents and creates a WorkItem
WorkItemLifecycleEvent is published as a CloudEvent (work.item.completed, work.item.rejected, etc.) on the Vert.x event bus / CloudEvents channel
- The
casehub-work-flow module gains an emit+listen example alongside the existing function-based bridge
- The existing
HumanTaskFlowBridge is retained — both patterns are supported
Value
- Runtime-portable: the
emit+listen pattern works with any SWF 1.0 runtime, not just Quarkus-Flow
- Aligns with how Quarkus-Flow's newsletter example models human review (
emit → listen)
- Makes CaseHub WorkItems first-class SWF citizens rather than a Quarkus-specific extension
Background
The current
casehub-work-flowbridge (HumanTaskFlowBridge) wraps WorkItem creation in a Quarkus-Flow Java DSLfunctiontask returning aUni. This works but is Quarkus-specific — it does not use the SWF 1.0 native pattern for async human interaction.The idiomatic SWF 1.0 pattern for human-in-the-loop is
emit+listen:CaseHub's
WorkItemEventBroadcasteralready fires lifecycle events — these could be surfaced as CloudEvents to close thelistenloop.Proposed
work.item.requestedCloudEvents and creates a WorkItemWorkItemLifecycleEventis published as a CloudEvent (work.item.completed,work.item.rejected, etc.) on the Vert.x event bus / CloudEvents channelcasehub-work-flowmodule gains anemit+listenexample alongside the existingfunction-based bridgeHumanTaskFlowBridgeis retained — both patterns are supportedValue
emit+listenpattern works with any SWF 1.0 runtime, not just Quarkus-Flowemit→listen)