Creating a workflow template

The minimum configuration: when is a workflow template "valid"?

A workflow template is only fully usable in this app once at least these criteria are met:

  1. Active = Yes (the template must be active)
  2. Primary Table is set
  3. Rule Set exists (is created/updated automatically when the primary table is set)
  4. At least one normal step (Step Type = Normal) exists
  5. At least one workflow trigger exists and is active

When you activate the template, the app runs a validation and shows an error list if necessary.

image-1766411421921.png

Step 0 – Check supported tables & events (must-know)

What are "AWF Supported Tables"?

In "AWF Supported Tables" you maintain which tables can be selected as the primary table at all.

Important:

image-1766411778422.png

Initialize default tables

Since AWF Supported Tables is not directly searchable via Tell Me, open the page as follows:

  1. Open AWF Workflow Templates.
  2. Open a template (or create a new template).
  3. In the "Primary Table" area, open the lookup of "Primary Table ID"..
  4. In the opened list AWF Supported Tables Action "Initialize Default Tables" run it (it is also initialized directly when opening).
  5. Confirm.

This action initializes or repairs the default configuration.

image-1770031600177.png

View workflow events per table

On AWF Supported Tables:

image-1770031630214.png

 

Create a workflow template

Create a new workflow template

  1. Open AWF Workflow Templates.
  2. New.
  3. Fill in the area General:
    • Code (unique)
    • Description
    • Active initially No (recommended)

image-1766414874909.png

Set the primary table (decisive, as this is the table the workflow is started for)

  1. In the workflow template (card), go to the area "Primary Table".
  2. Field "Primary Table ID" select.
    • The list opens: AWF Supported Tables.
  3. Select a table.
  4. Check whether "Primary Table Caption" is filled automatically.

What happens in the background:

  • The app automatically creates/updates a Rule Set for the template.
  • The primary table is automatically stored as the Primary Table in the rule set.

Filter document type

Older versions had a Primary Document Type directly in the workflow template. This configuration was replaced by the Rule Engine .

If you want to start the workflow only for certain document types, or model different steps per document type, you now solve this via Rule Conditions:

1. Open the appropriate area (e.g. Workflow Trigger → Show Rules))
2. Create a rule condition (action Show Conditions).
). 3. Choose as the source field e.g. "Document Type" (a field of the primary table or a related table).
4. Set operator/value (e.g. "= Order").

Save the audit trail as PDF

When a workflow completes successfully, the audit trail can be saved automatically as a PDF file in the document attachments of the source record.

Configuration

  1. In the AWF Workflow Template → field "Save Audit Trail to Attachments" = Yes.
  2. On successful completion of the workflow, the audit trail report is generated automatically as a PDF and attached as a document attachment to the source record.

Attachments FactBox

In the AWF Workflow Instance card attachments from two sources are shown combined:

  • Attachments of the source record (e.g. scanned invoices)
  • Attachments of the workflow instance (e.g. generated audit-trail PDFs)

This gives approvers and administrators all relevant documents in one place.

Configure related tables (optional)

Why do I need related tables?

The rule engine can check conditions not only on the primary table, but also on related tables (e.g. header/lines).

You define these related tables in the template in the area:

  • Related Tables (technically: "DXP Rule Set Tables")

Add a related table

  1. In the template, in the section, Related Tables create a new line.
  2. Table ID select (lookup).
  3. Define the relation to the primary table:
    • Relation Field 1 (field number in the related table)
    • Primary Field 1 (field number in the primary table)
    • Optionally also Relation Field 2 / Primary Field 2 etc.

Rule of thumb:

image-1770031936324.png

Important: Without a correctly defined relation, the rule engine cannot cleanly evaluate fields of the related table against the current record.

Define steps

Basic structure of the steps

In the template there is the section Steps. A step contains, among others:

  • Step Code
  • Step Name
  • Order
  • Step Type (Normal / Error / Final)
  • Allow Record Edit
  • Assignment logic
  • Approvals / Related Approvals: optionally enable line approvals (Enable Related Approval) and set the Approval Mode .

image-1766415665254.png

Create the first "Normal" step

  1. In the section → Steps → New.
  2. Step Type = Normal.
  3. Step Code and Step Name assign.
  4. In the card, set the Assignee Type and set the Assignee .

Important system behavior:

  • When the first normal step is created, the app automatically generates:
    • an Errorstep (code e.g. ERROR)
    • an Finalstep (code e.g. FINAL)

Configure assignment

On the AWF Stepcard you maintain:

Notes:

If a step cannot resolve a valid assignee, the workflow is typically moved to the error step at runtime.

image-1766415688087.png

Approver Limit Type: approval limits from the Approval User Setup

The Approver Limit Type decides whether Advanced Workflow takes the approval limits of the Approval User Setup into account. The field exists on the AWF Step card and on every rule with the rule action Override Assignee; when such a rule matches, its setting applies.

The limits are only evaluated for these assignee types:

Assignee TypeDirect ApproverFirst Qualified Approver
Salesperson/PurchaserThe Approver ID of the user the document's salesperson/purchaser code is assigned to.Starting from that Approver ID, up the chain of Approver IDs to the first user with a sufficient limit.
Workflow User GroupAll members.Only the members with a sufficient limit.
ApproverAlways the user entered – their limit is not checked.

Which limit applies:

Example – purchaser EK01 is assigned to user MEIER; the Approver IDs form the chain MEIER → SCHULZ (Purchase Amount Approval Limit 5,000) → BRAUN (25,000) → CHEF (Unlimited Purchase Approval).

Assignment on the stepOrder 3,000Order 8,000Order 30,000
Salesperson/Purchaser, First Qualified ApproverSCHULZBRAUNCHEF
Salesperson/Purchaser, Direct ApproverSCHULZSCHULZSCHULZ
Workflow User Group SCHULZ/BRAUN/CHEF, First Qualified Approverall threeBRAUN, CHEFCHEF
Approver SCHULZSCHULZSCHULZSCHULZ

Good to know:

On the AWF Step card the Approver Limit Type takes effect from Advanced Workflow 1.17. Earlier versions only honour it on a rule with Override Assignee; set it there until you update.

Due Date Formula (Due Date)

On the AWF Stepcard a Due Date Formula can be configured:



Step rules: how does the workflow move to the next step?

The app uses the DEXPRO Rules Engine to determine:

If no rule is defined, the respective step configuration applies.

Rule group per step ("Show Rules")

  1. In the Stepslist, mark the desired step.
  2. Action "Show Rules".

If no rule group is stored yet, the app automatically creates a Rule Group and enters it on the step.

image-1766416116752.png

Create rules (DEXPRO Core)

On the opened page Rules:

  1. New.
  2. Rule Code and Rule Name set.
  3. Sequence/Priority assign.
  4. Active = Yes.
  5. Optional:
    • Condition Conjunction (AND/OR)
    • Record Matching Type (Any Record / All Records)

image-1766416253261.png

 

Maintain Advanced Workflow fields on the rule (Next Step, Auto-Approve, Override Assignee)

On the rule there is the area "DEXPRO Advanced Workflow":

  1. Rule Action set (lookup/drilldown) and choose the desired action, e.g.
    • Step Transition
    • Override Assignee
    • Auto-Approve
  2. For Step Transition additionally choose Next Step (the lookup shows the next possible steps).
  3. If related approvals are active: Applies To set (Header / Related Only / Header and Related).
  4. For Override Assignee: Assignee Type and Assignee maintain.

image-1770032598479.png

Add conditions (rule conditions)

On the Rules page:

  1. Action "Show Conditions".
  2. Add one line per condition:
    • Source Table ID (primary table or related table)
    • Source Field ID (field)
    • Comparison Operator (operator)
    • Value (value; AssistEdit for Enum/Boolean/Between/In Set)

image-1766993224263.png

Tip: If you use conditions over related tables, the relation in Related Tables must be maintained correctly.

Test rules (without a real workflow)

On the Rules page there are:

This lets you check rules/rule conditions against a sample record before starting real workflows.

image-1766993340328.png

Configure workflow triggers

Workflow triggers determine when a new workflow instance is started.

In the template the section is called "Workflow Triggers".

Template triggers: basic fields

  1. In the template → section Workflow Triggers.
  2. New.
  3. Field Workflow Event select (AssistEdit → list "AWF Table Workflow Events").
  4. Active = Yes.
  5. Priority set (order when several matching triggers exist).

image-1766993429832.png

Trigger rules: when may a trigger fire?

On the trigger there is a Rule Group Code. Via the action "Show Rules":

  1. mark the trigger.
  2. Show Rules.
  3. Maintain rules/rule conditions as in Step rules .

Important system behavior:

image-1766993646446.png

 

OnAfterModify: Monitored fields

For the event OnAfterModify there is the action "Monitored Fields".

  1. Mark the trigger with the workflow event OnAfterModify .
  2. Action "Monitored Fields".
  3. select fields (lookup via "Fields Lookup").

image-1766995825420.png

Workflow action on completion

In the template there is the section "Workflow Action".

  1. Run action on completion enable.
  2. Action on Completion choose (depending on the primary table):
    • Release / Reopen (only for certain document tables)
    • Custom action (codeunit/report)
    • Define field value assignments

When Define field value assignments is selected, the section appears Field Value Assignments.

image-1766996199607.png

Cleanup (retention & cleanup)

Under Cleanup Configuration:

In addition there is the action:

image-1766996258454.png

Module: Escalation Engine

The escalation engine automatically monitors overdue approval requests and runs definable escalation steps. This lets you model reminders, automatic delegations, or reassignments on a time-based schedule.

How it works

Prerequisites


Configure escalation steps

At template level (default for all steps)

  1. In the AWF Workflow Template → section "Escalation Steps".
  2. New.
  3. Fill in the fields:
    • Step No.: running number (determines the order).
    • Description: description of the escalation step (e.g. "Reminder after 1 day").
    • Overdue Duration: date formula relative to the due date (e.g. <+1D> = 1 day after due, <+1W> = 1 week after due).
    • Escalation Action: action that runs when the overdue duration is reached.
    • Enabled: Yes/No.

At step level (overrides template level)

  1. In the AWF Stepcard → section "Escalation Steps".
  2. Create steps as described above.
  3. If a workflow step has its own escalation steps, the template escalation steps are not considered for this step.

Escalation actions

Action Description
Send Notification Sends an escalation notification (via the standard BC notification mechanism).
Delegate Delegates the approval automatically via the BC standard substitute chain (from "Approval User Setup").
Reassign Reassigns the approval to a defined recipient. Recipient Type and Recipient Code are configured (user or workflow user group).
Custom Action Runs a custom object (codeunit or report). Optionally the source record can be passed (Pass Source Record).

Configure recipient (for "Send Notification" and "Reassign")


Rule-based escalation (optional)

Escalation steps can optionally have a Rule Group Code . When set, the escalation step only runs if the rule conditions of the rule group match for the current record.

Due date and escalation

For the escalation to work meaningfully, a Due Date Formula must be maintained in the step:

  1. In the step: set the field "Due Date Formula" (e.g. <+3D> = due 3 days after the approval is created).
  2. The escalation duration is added on top of the due date: if the due date formula is <+3D> and the overdue duration is <+1D> the escalation step runs 4 days after the approval is created.

If an approval entry has no due date , a prompt for manual entry is shown if necessary.

Module: Rejection Handling

The rejection behavior in Advanced Workflow is configurable and controls what happens when an approver rejects an approval request.

Default behavior (without special configuration)

Rejection group for related approvals (lines)

If you use related approvals (line approvals), you can specify to whom rejected line approvals are reassigned:

Configuration at template level

  1. In the AWF Workflow Template → area Rejection Settings:
    • Use Rejection Group for Related Approvals = Yes
    • Rejection Default Assignee Type Approver / Workflow User Group / Salesperson/Purchaser
    • Rejection Default Assignee: specific user or group

Configuration at step level (overrides template level)

  1. In the AWF Stepcard → area Rejection Settings:
    • Use Rejection Group for Related Approvals = Yes
    • Rejection Default Assignee Type and Rejection Default Assignee as above
  2. If a step has its own rejection settings, these override the template settings.

Rejection group for header approvals

Normally, rejecting the header approval leads back to the previous step (or cancellation in the first step). Alternatively, you can configure the header rejection to hand the workflow to a rejection group for review: the workflow moves to the template's error step (if the template has none, it stays on the rejecting step), and the rejection group receives a rejection review (see below):

  1. Use Rejection Group for Header = Yes
  2. Header Rejection Assignee Type: Approver / Workflow User Group / Salesperson/Purchaser
  3. Header Rejection Assignee: specific user or group

The configuration is possible at both template and step level (step level overrides template level).

Rejection reason and reassignment for lines

When rejecting a related approval, a dialog opens:

Rejection review: what the rejection group can do

An approval that a rejection group receives after a rejection is a rejection review. The group does not approve — a document somebody has just rejected must not go through without the approval that was withheld. It can correct the document (at a step with Allow Record Edit) and then send it back or cancel the workflow. In "Requests to Approve" the field Rejection Review marks such an approval. If the rejection group is a workflow user group, a member has to claim the review first, as with any group approval.

FactBoxes

An attempt to approve or reject a rejection review is refused with: This approval is a rejection review. It cannot be approved or rejected - send it back or cancel the workflow.

Module: Approval Preconditions

Preconditions let you define on a workflow stage which details a document must have before an approval may take it out of that stage – for example "the cost center is filled in" or "the payment reference is filled in". Advanced Workflow checks these details when someone approves; it does not maintain them. If something is missing, the approver sees what is missing and can add it or reject the document.

Purpose

Setup

  1. Open the AWF Workflow Template and select the stage in the Stages section.
  2. Choose the Preconditions action (or the number in the Preconditions column). The Rules page opens with the preconditions of this stage.
  3. Create a rule with New and give it a condition that describes the desired state, for example field Cost Center, operator Is Not Empty.
  4. In the rule's Approval Precondition section, set the Severity and, if you like, a Message of your own.

Rules page holding the preconditions of a stage

When you open the preconditions for the first time, the app creates a rule group of their own for the stage (code PRE- + stage code), shown in the stage's Precondition Rule Group field. It is separate from the step rules: step rules are evaluated when a stage is entered, and the first match wins; preconditions are checked when the stage is left, all of them.

A precondition is worded positively: when the rule matches, the precondition is met. If a related record the condition needs does not exist, the precondition is not met.

Rule fields

Header or lines

Whether a precondition concerns the document header or every line follows from its condition: if it checks a field of a line table (for example Purchase Line), each line is checked on its own, and the message names the line. The Record Match Type field is not offered for preconditions.

Filter rules: a precondition for certain records only

If a precondition should apply to certain records only – for example "the cost center is filled in", but only for lines whose Type is not empty –, give it filter rules:

  1. Select the precondition in the list and choose the Filter Rules action (or the value in the Filter Rule Group column). On the precondition's rule card, Filter Rules is under Actions.
  2. Create a filter rule with New and describe in its condition which records the precondition applies to, for example field Type, operator Is Not Empty.

When you open them for the first time, the app creates a rule group of their own for the precondition (code FLT- + rule code, description Filter of precondition … (stage …)).

Checks when the template is activated

The template cannot be activated when

If Allow Record Edit is switched off on the stage, or external approvers approve it, the app points this out when you open the preconditions: the approvers cannot add missing details themselves and can only reject the document so that somebody else completes it.

Testing preconditions

To see whether a precondition and its filter rules do what you expect on a particular document, use Test Precondition (on the rule card and in the list of preconditions) or Test All Preconditions (in the list). On a filter rule, Test Precondition tests the precondition the filter belongs to. Test Rule and Test Rule Group are not offered for preconditions and filter rules: they evaluate a rule only once against the whole document and know nothing of filter rules.

The Precondition Test page opens. Choose a document with Select Test Record. The app checks the preconditions the way the approval checks them – per line where the condition is on the lines, and only where the filter rules let the precondition apply. The test changes nothing and needs no running workflow.

Precondition Test page: result per precondition and line, a comment line does not apply because of the filter rule

After a change to the document or to the rules, Test Again checks once more.

Checks that partners add (see For developers) do not run in the test.

What is checked when approving

Each approval checks what it stands for – so no line blocks an approver who may not change it:

ApprovalChecked
Header approvalthe document header and the lines that have no approval of their own at this stage
Line approval (related approval)its line
the approval that completes the stageall preconditions of the stage

The "Approval not possible yet" dialog

When you approve and a precondition is not met, the dialog Approval not possible yet - stage … (… open) opens before anything is approved. This applies to Approve on the document and in Requests to Approve, to Approve Line(s) in the document lines and to the Related Approvals FactBox. For each precondition it shows Status (Met, Missing or Warning), Precondition, Message, Line, Field and Current Value.

{add screenshot of Approval not possible yet here}

Where no dialog is possible, the approval ends with the message The approval is not possible yet. Stage … requires: … and the action Show problems, which opens the list of preconditions. There is no way to override a precondition of severity Error – not for administrators either.

Approve All

Approve All skips approvals with an unmet Error precondition and reports them at the end: … approval request(s) were approved. … remain open, … of them because their preconditions are not met: …. Open warnings are confirmed once, up front, for all of them.

The "Approval Preconditions" FactBox

The FactBox appears on the document pages with Advanced Workflow integration, in Requests to Approve and on the AWF Workflow Instance card. It is visible while the workflow is at a stage with preconditions.

{add screenshot of Approval Preconditions FactBox here}

Automatic approvals, external approvers and deleted lines

Copying, exporting, importing

Copy a workflow, Export a template and Import / overwrite a template take the stages' preconditions along – with their conditions, their filter rules and the message translations.

For developers

Add checks of your own through the integration event OnAfterCheckPreconditions of codeunit DXP AWF Precondition Mgmt.. It is raised on every path – dialog, the engine's binding check, external and rule-based approvals. A result marked Partner Check with severity Error that is not met blocks the approval exactly like a precondition rule. The event is not raised in the Precondition Test, because there is no workflow instance there.