Simple workflows to implement complex business logic – part 1

Multi-step approval

In many cases, one of the most challenging tasks during application planning and implementation is the replication of organization’s complex approval process. Especially in finance sector (e.g. purchase order, cost approval/invoices) - hardly ever, there is only one approving person in the process. Usually, there are multiple approval steps that vary depending on mutliple variables like: total amount, order category, cost center, etc.

Instinct suggests to prepare one workflow with multiple approval steps (as many as the number of approvers) and add Flow control steps for each one of them with proper condition. However, that will result in quite complex configuration and lack of transparency for end-users. Instead, you can give business owners of the process a power to add/modify/remove approvers as it is required by a given business case. For that, you need to prepare an additional “helper” workflow where the user (without accessing Designer Studio) will be able to define approval conditions and assign proper users. Let’s call it ‘Approval Matrix’ (as in the example below).

WEBCON BPS multi step approval approvers list dashboard

As you can see in this form the end-user may easily see/modify/add approving persons (paths) to the workflow. The only thing that you need to agree in advance is what variables are important to define approving paths – in other words what columns will be needed in the matrix.

Approval matrix - it’s a very simple workflow:

  • only 3 steps (Register, Active, Archive);
  • picker fields for all main variables (that are common for all paths in the matrix) - in this example: company/branch name of the organization but it could be also: form type, department, etc.;
  • item list presenting approval paths – all variables determining the approver (especially min/max amounts) and the approver name*.

* You may also use role in the organization instead of approver’s name, however, it would require an additional matrix where you store users assigned to the roles in the organization.

Based on that Approval matrix in the destination workflow (in this case it is named: Approval request) you can dynamically show the approvers list selected depending on the information provided by the user.

WEBCON BPS multi step approval

WEBCON BPS multi step approval

You just need to add Data row field on the form and prepare a query that would show all approvers from your Approval Matrix based on the values selected in the (keep in mind that all data from item lists are stored in WFElementDetails data table):

WEBCON BPS approvers list designer studio


<ApproverColumnFromApprovalMatix> as 'Approver'


WHERE WFD_DTYPEID= ‘<ApprovalMatrixID>’

AND WFD_STPID = ‘<ActiveStepIDFromApprovalMatix>’

AND <CompanyFromApprovalMatix> ='<CompanyFormField>'

AND <CostTypeFromApprovalMatix> ='<RequisitionCategoryFormField>'

AND '<RequisitionValueFormField>' >= <MinAmountFromApprovalMatix>

In this query you should choose only currently active approval matrix paths (proper step – WFD_STPID) that have the same values selected (company, cost type) as the user chose on the current form, also check the requisition value to be sure that all required approvers will be shown.

Now you just need to properly assign approving task J

In most cases you will have to assign the task multiple times to get all approvers acceptance in the right order.

What’s the quickest way to do that?

Prepare in your ‘Approval request’ workflow a loop using one flow control (the gry one) step like the one below.

WEBCON BPS multi step approval workflow

After fininshing approval by each of the approving person selected on the brach (flow control step) the system will check whether all required approvals are already done. If not it will go back to the approval step to the next approving person.

To make task creation easier prepare an item list field in the Approval request workflow storing all approvers required - you can use it as a checklist to mark who has already done the task (approved current request).

WEBCON BPS approvers table

For this item list initialization you may use almost exactly the same query as in the previous data row. In the example the initialization is done using action: Change ites list values. When you want to fill in information on the item list based on data on the form entered by the user in the previous step it’s the simplest way.

WEBCON BPS initialize approvers


<ApproverColumnFromApprovalMatix> as <ApproverColumn>,

1 as <ApprovalStatusColumn>


WHERE WFD_DTYPEID= ‘<ApprovalMatrixID>’

AND WFD_STPID = ‘<ActiveStepIDFromApprovalMatix>’

AND <CompanyFromApprovalMatix> ='<CompanyFormField>'

AND <CostTypeFromApprovalMatix> ='<RequisitionCategoryFormField>'

AND '<RequisitionValueFormField>' >= <MinAmountFromApprovalMatix>

As you can see there is also an additional column named ‘Approval status’. It’s an indicator (data row column) that will visualise the current approval status:

WEBCON BPS approval status

The green ‘lamp’ indicates approvers who accepted the request.

When you have all approvers in the right order the task creation is pretty simple. Just add a Create task action on entry to Approval step in Approval request workflow and select the first approver from the list, that have not yet approved the form.

WEBCON BPS select approver

After each approval, you need to update the information on the item list to mark who has already done his/her task and also change the color of the indicator (for values smaller or equal to 0 it will be a red lamp, for value equal 1 it will be a yellow lamp, for values larger than 1 it will be a green lamp). To do that you will need a Change items list values action again on the Approve path:

WEBCON BPS approvers done



2 as <ApprovalStatusColumn>

FROM WFElementDetails

where <ApproverColumn> = '{ASSIGNEDPERSONFULL}'

Additionally, you can also add Date and time column to the this Approvers table item list so the exact acceptance time will be visible. It may be very useful for all ISO/quality documentation approval where the timestamp is crucial.

As you can see, the solution is very neat, user-friendly and at the same time helps a lot with maintenance of your application.

Share on facebook
Share on linkedin
Share on twitter
Share on reddit
Share on email





WEBCON is the leading European-based provider of a complete Low-code Application Platform for mass delivering business solutions. Companies choose WEBCON to dramatically reduce time and cost of app development. The platform allows them to automate and manage business processes across the entire organization – using a single, unified platform. Thanks to its unique InstantChange™ technology, WEBCON embraces change like no other platform on the market.


Get in touch with our team
Local offices

© WEBCON 2024 All rights reserved | Privacy Policy