Tasks
Tasks are the atomic units of work in a Fleans workflow. Each task maps to a <bpmn:*Task> element
and runs exactly once per activation. Fleans supports four task variants; a fifth (Send Task) is not
yet implemented — see Send Task below.
See also: BPMN Support matrix for the full coverage table.
Plain Task
Section titled “Plain Task”A Plain Task (<bpmn:task>) completes immediately with no executor — the engine advances to
the next element as soon as activation is recorded. Use it for modelling a human activity or a
placeholder that will be replaced later.
BPMN:
<bpmn:task id="Task_1" name="Do something" />Script Task
Section titled “Script Task”A Script Task (<bpmn:scriptTask scriptFormat="csharp">) executes a C# expression via
DynamicExpresso. The expression string is
read from <camunda:script> and evaluated against a _context variable bag that exposes the
current workflow variables.
BPMN:
<bpmn:scriptTask id="Task_1" name="Compute total" scriptFormat="csharp"> <bpmn:extensionElements> <camunda:script><![CDATA[_context.total = _context.price * _context.qty]]></camunda:script> </bpmn:extensionElements></bpmn:scriptTask>User Task
Section titled “User Task”A User Task (<bpmn:userTask>) suspends the workflow and waits for a human to act. Fleans
exposes a claim → complete (or fail / cancel) lifecycle via REST and the admin UI.
BPMN:
<!-- Requires xmlns:fleans="https://fleans.io/schema/bpmn/1.0" on <bpmn:definitions> --><bpmn:userTask id="Task_1" name="Approve request"> <bpmn:extensionElements> <fleans:assignmentDefinition assignee="manager" candidateGroups="approvers" /> </bpmn:extensionElements></bpmn:userTask>Service Task (Custom Task)
Section titled “Service Task (Custom Task)”A Service Task (<bpmn:serviceTask type="…">) delegates execution to a custom-task plugin
identified by the type attribute. The plugin runs on a Worker silo — either bundled with the
engine image or in a dedicated external plugin host — and
publishes results back through <fleans:output> bindings.
BPMN:
<!-- Requires xmlns:fleans="https://fleans.io/schema/bpmn/1.0" on <bpmn:definitions> --><bpmn:serviceTask id="Task_1" name="Call external API"> <bpmn:extensionElements> <fleans:taskDefinition type="rest-caller" /> <fleans:ioMapping> <fleans:input source="=apiUrl" target="url" /> <fleans:output source="=__response.body" target="result" /> </fleans:ioMapping> </bpmn:extensionElements></bpmn:serviceTask>The type value must match a registered plugin’s TaskType. To learn more:
- Custom Tasks — architecture, event flow, parameter mapping, and the REST Caller bundled plugin.
- Hosting plugins externally — run plugins in a dedicated Worker silo isolated from the engine image.
- Writing Custom-Task Plugins — step-by-step authoring guide.
Source: BpmnConverter.cs#L333.
Send Task
Section titled “Send Task”Send Task (<bpmn:sendTask>) is not yet implemented in Fleans. If a BPMN file contains a
Send Task, the converter will not recognise it and the element will be skipped or cause a parse
error. A dedicated fixture and implementation are tracked in issue #420-E.