Skip to main content

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

AspectWorkflow ApprovalWorkflow Task
OutcomesFixed: Approve, Deny, Reject, Request ChangeDeveloper-defined (any number of custom outcomes)
Use caseDocument review and approval decisionsGeneral-purpose work assignments
Outcome typesFixed WorkflowElementOutcomeType valuesDeveloper 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 ActionMenuItem displayed on the task toolbar.
  • An EventHandler invoked when the user selects the outcome.
  • Optional StateMachine and StateMachineTargetState for document status transitions.

Creating a Workflow Task

  1. In Visual Studio, add a new Workflow Task to your project.
  2. Set Document, Label, HelpText, and ConfigurationKey.
  3. Add outcomes to the WorkflowOutcomes collection.
  4. Set event handlers for task events (StartedEventHandler, CanceledEventHandler, WorkItemsCreatedEventHandler).
  5. 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 CapabilityPropertyDescription
Modify task propertiesPropertyModificationsChange property values on the base task (e.g., update event handler references).
Modify existing outcome propertiesWorkflowOutcomeModificationsChange properties on the base task's outcomes.
Add new outcomesWorkflowOutcomesAdd 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.