Usually during modeling the business processes we will model business tasks which involves human interaction.Many tasks will be assigned to a Role.It always best practice to model exceptions on all the tasks (Human and Automated ) which helps to run the business process smoothly.
For example ,There might be many tasks waiting for approval for long period. There will be group of people responsible to perform/complete the task.
In such scenarios, It would be nice to set the deadline on those tasks so that we can escalate in case if the deadline is reached.
Consider a case where I created a request on Friday(12th) and the deadline for approving that request is 3 days. Then Ideally the request should be completed by 17th and not 15th. So out business process should be in a position to handle this and should send a escalation e-mail to all responsible people once this deadline is reached.
We can make use of FM ‘BUSINESS_DATE_CREATE’ in the ECC system to get the next business date which can used with in our Business Process to set the deadline for a particular task.
We can write a EJB which calls this FM and BPM can consume this EJB as seen below.We can make use of web services directly into BPM, but for this particular scenario EJB route will make sense.
Create ‘Completion deadline’ on the task and use the EJB to get the deadline.
Once the deadline is reached, process will send e-mail to required people and sends new task back with a new deadline.
Steps needs to be done
1. Expose the backend service (if any ) for calculating the business days
2. Write a EJB which calls the above service and expose as a EJB function to BPM
3. Model “Critical exception” on the task and Handle the exception
*** To make the process more generic , we can push getting the number of days allotted to complete a particular task to BRM.
Business requirements are as follows
1. If the approving person is manager then time to complete the approval is 2 days
2. If the approving role is Finance then time to complete the approval is 3 days
so on…….. In this case we can make use of BRM to get the no.of days and then we can call EJB to get the actual deadline for that particular task.
This was, Business has handle to decide the number of days.They can change this value at any point of time without touching the process.