Uncategorized

Business rules for working days in WEBCON BPS

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.

The business rule checking if a day is a business day
The business rule is counting business days
The business rule returns next business day after a given amount of days

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.

The default value of “Is working day?” form field

An example of how a business rule works
The default value of “How many working days?” form field
An example of how a business rule works
The default value of “Next working date (after Start Date)” form field
An example of how a business rule works

Summary

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

nedza.kamil

A graduate of the AGH University of Science and Technology in Krakow. When not involved in the creation and optimization of business processes, he plays board or computer games. He also is interested in using game mechanics (gamification) in real life and business. Spends the evenings creating and prototyping amateur games based on the UNITY engine.

View Comments

Recent Posts

Managing local WEBCON BPS groups

WEBCON BPS local groups management using simple process. Adding and removal of multiple group users…

3 years ago

Using the FOR EACH ROW form rule in practice

The article describes how to use the FOR EACH ROW form rule in practice on…

3 years ago

Create your own WEBCON BPS Express laboratory from scratch.

A video tutorial on how to set up a WEBON BPS home laboratory from scratch…

3 years ago

JSON nested collection handling in WEBCON BPS

How to use the OPENJSON tabular function to handle a data import to WEBCON BPS…

3 years ago

REST Web Service Connections – WEBCON BPS Authentication

How to configure and use REST Web Service connections using WEBCON BPS Authentication. Examples of…

3 years ago

Upgrade WEBCON BPS Express from 2020 to 2021

How to upgrade standalone version of WEBCON BPS 2020 to 2021. The article describes the…

3 years ago