Workflow Tasks
A Workflow Task (AxWorkflowTask) defines a manual task step within a workflow process. Unlike approvals (which have fixed Approve/Deny/Reject/Request Change outcomes), tasks support custom outcomes that the developer defines. This makes tasks flexible for any work assignment where the result is not a simple approval decision.
Tasks are assigned to users or queues, and the assigned user must act on the task by selecting one of the available outcomes. Each outcome triggers event handlers and state machine transitions.
Tasks vs Approvals
| Aspect | Workflow Approval | Workflow Task |
|---|---|---|
| Outcomes | Fixed: Approve, Deny, Reject, Request Change | Developer-defined (any number of custom outcomes) |
| Use case | Document review and approval decisions | General-purpose work assignments |
| Outcome types | Fixed WorkflowElementOutcomeType values | Developer selects outcome type per outcome |
Custom Outcomes
Each workflow task contains a WorkflowOutcomes collection of AxWorkflowOutcome objects. You define as many outcomes as needed — for example, a review task might have "Complete", "Reject", and "Escalate" outcomes.
Each outcome has:
- A
Type(Complete, Return, RequestChange, or Deny) that controls the workflow routing behaviour. - An
ActionMenuItemdisplayed on the task toolbar. - An
EventHandlerinvoked when the user selects the outcome. - Optional
StateMachineandStateMachineTargetStatefor document status transitions.
Creating a Workflow Task
- In Visual Studio, add a new Workflow Task to your project.
- Set
Document,Label,HelpText, andConfigurationKey. - Add outcomes to the
WorkflowOutcomescollection. - Set event handlers for task events (
StartedEventHandler,CanceledEventHandler,WorkItemsCreatedEventHandler). - Register the task as a supported element in a workflow type.
Extensions
Workflow tasks can be extended using Workflow Task Extensions (AxWorkflowTaskExtension). Extensions allow modification of existing tasks and addition of new outcomes.
What You Can Extend
| Extension Capability | Property | Description |
|---|---|---|
| Modify task properties | PropertyModifications | Change property values on the base task (e.g., update event handler references). |
| Modify existing outcome properties | WorkflowOutcomeModifications | Change properties on the base task's outcomes. |
| Add new outcomes | WorkflowOutcomes | Add new custom outcomes to the task. |
What You Cannot Extend
- You cannot remove existing outcomes from the base task.
- You cannot change the Document property via extension.
- You cannot change the outcome Type on existing base outcomes via a modification.