Skip to main content

Workflow Approvals

A Workflow Approval (AxWorkflowApproval) defines an approval step within a workflow process. Approvals are the most common workflow element — they route a document to one or more users who must approve, reject, deny, or request changes to the document before it can advance to the next step in the workflow.

Each approval element defines:

  • Outcomes — the four built-in approval actions (Approve, Deny, Reject, Request Change), each with its own event handler and menu item.
  • Event handlers — classes that execute when the approval starts, is cancelled, or when work items are created.
  • State machine references — link workflow events to state machine transitions that update the document's approval status.
  • Document — the workflow document class providing the query for the record being approved.

Approval Outcomes

Every workflow approval has four built-in outcomes, each represented by an AxWorkflowOutcome child object:

OutcomeTypeDescription
ApproveComplete (0)The approver accepts the document. The workflow advances to the next step.
DenyDeny (3)The approver permanently rejects the document. The workflow terminates.
RejectReturn (1)The approver sends the document back to the submitter for corrections.
Request ChangeRequestChange (2)The approver requests specific modifications before re-review.

Each outcome has its own:

  • ActionMenuItem — the action menu item that appears on the approval toolbar.
  • EventHandler — a class invoked when the outcome is selected.
  • StateMachine and StateMachineTargetState — the state transition triggered by the action.
  • Enabled — whether this outcome is available to approvers.

Creating a Workflow Approval

  1. In Visual Studio, add a new Workflow Approval object to your project.
  2. Set the Document property to your workflow document class.
  3. Configure the Label, HelpText, and ConfigurationKey.
  4. Set event handlers for StartedEventHandler, CanceledEventHandler, and WorkItemsCreatedEventHandler.
  5. Configure each outcome's ActionMenuItem and EventHandler.
  6. Set the DocumentMenuItem to the menu item that opens the document form.

Extensions

Workflow approvals can be extended using Workflow Approval Extensions (AxWorkflowApprovalExtension). Extensions allow you to modify an existing approval without overlaying the original object.

What You Can Extend

Extension CapabilityPropertyDescription
Modify approval propertiesPropertyModificationsChange property values on the base approval (e.g., update event handler references).
Modify outcome propertiesWorkflowApprovalOutcomeModificationsChange properties on the base approval's outcomes (e.g., change an outcome's event handler or enabled state).

What You Cannot Extend

  • You cannot add new outcomes to an approval via extension — the four outcomes (Approve, Deny, Reject, Request Change) are fixed.
  • You cannot remove or rename existing outcomes.
  • You cannot change the Document property via extension.

Extension Example

To create a workflow approval extension:

  1. In Visual Studio, right-click the workflow approval in the AOT and select Create Extension.
  2. A new AxWorkflowApprovalExtension object is created.
  3. Add property modifications or outcome modifications to alter the base approval behaviour.