Does anyone have an example of an approval mechanism?

2
I want to develop an approval mechanism that can for example do the following: Suppose someone places an order. Before delivering the order, the order needs to be approved by the manager of the person and the persons responsible for the items in your order. Preferably a notification message is automatically sent to the approvers, the approvers can add their votes and the mechanism automatically checks the outcome of the votes according to a certain strategy (e.g. the first vote applies, or the majority, etc.). Has such a mechanism or something similar been built?
asked
3 answers
2

Has such a mechanism or something similar been built?

Yes, it has. Several times. Such constructions are common to many of the environments where Mendix technology is is being used.

There is, however, no out-of-the-box solution to your question. These solutions tend to be implementation-oriented and Mendix (being a domain-neutral technology platform) does not provide application (or domain) specific logic at that level.

The example case you asked for in your question can be modeled using Mendix. Similar scenarios are running in production.

answered
2

This is actually a common used system although it has no specific defined use-case. What I did was simply add a attribute Approved(boolean) to the object that needs approving and put the overview into tabs, one for Waiting for Approval with a datagrid constrained to [Object/Approved = false()] and the other tab with a datagrid constrained to [Object/Approved = true()].

From here you can add a Invoke button on the datagrid and connect it to a microflow that sets Object/Approved to true and do other things while you're at it, like sending emails, counting statistics or tracking customers.

To track some sort of voting you could make an association from the Object to a Voter. From there you can make either a scheduled event or a Calculate Votes button to retrieve all these from the association and count them or check if the list is complete.

answered
0

My suggestion would be to have an object per approver, linked to the object that needs to be approved (order).

That way you can track individual approvals and you can extend it to use alternate approvers as well or extend it to allow requesting additional information before being able to approve (some sort of pause).

Furthermore, you would have to look into your business logic first: Do you allow approvals based on groups (one must approve / all must approve), or individual only. Do you want to add levels (a person/group must approve, before a second person/group needs to look into the order. That way you can prevent sending out messages to people that are not yet required to look at an order.

You can then build your microflows to react on each approval/reject from an approver.

answered