Use universal global business rules in your processes. Using the working days calendar in WEBCON BPS.
Working days calendar
WEBCON BPS allows you to define non-working days in your organization. Thanks to this, we can use standard functions such as performing timeouts only on business days. Another standard feature is displaying on SWE reports, how many business days a given workflow instance is in the current step. You can read about it in the article: Working days calendar in WEBCON BPS.
In this post, I would like to present to you 3 ready-to-use business rules that you can use in all processes! What can you use them for?
- Checking if the indicated date is a working day
- Calculating how many business days occur between the dates indicated
- Calculation of the next (or earlier) business day relative to the indicated date and working days amount
Adding functions on the database
Note: In the example I described, SQL functions are created in the WEBCON BPS content database. This is not recommended by the software developer. Creating custom objects and tampering with the WEBCON BPS database may result in the manufacturer’s warranty loss. I recommend creating these functions on a separate SQL database.
Function 1 – Checking if the day is a working day
The following function checks whether the date indicated is a business day. Returns 1 when the checked date is a working date. Otherwise, it returns 0.
Function 2 – Counting working days
The following function counts the working days in the indicated date range. Edge days are also included.
Function 3 – Checking the next working day
The following procedure returns the date of the next business day after the specified number of days. The number of days can be positive or negative. If the number is positive, the function returns the next business day. If the number is negative, the function returns the day preceding the day(s) off.
Creating global business rules
After creating the above functions, it’s time to create parameterized business rules that will make use of them. Below are presented all of them.
Using prepared business rules
Below I show how to configure form fields using my business rules. Of course, this is just an example. You can use these rules anyway you like.
Thanks to these three business rules, you’ll be able to create more comprehensive business solutions. In addition, once prepared, they can be used in all processes you create and save your time.
If you have any questions, feel free to ask them in the comment section.
Featured image Designed by Ibrandify / Freepik