cancel
Showing results for 
Search instead for 
Did you mean: 

Multiple levels escalation for deadline monitoring

Former Member
0 Kudos

Hi all,

We have a business requirement to perform multiple levels escalation in one of the workflow steps. If the approver does not approve the work item(WI) after one day, a mail notification will be sent to the approver. A second mail will be sent again if approver still doesn't approve WI after 48 hours. Then the third/fourth mail will be sent to approver and approver's boss if approver still doesn't approve WI after 72 / 96 hours. The fifth mail will be sent to approver's boss's boss if WI is not approved still after 5 days.

I know how to do simple and modeled deadline monitoring in workflow builder. But I don't know whether our business requirement can be achieved in workflow builder( and this is a step in dynamic parallel processing). Other option I have is to create an ABAP report to go through the table stores workflow run time data and make this report run several times a day in the batch to send mail notification reminder.

Did anybody have a similar business requirement like ours? What's the best way to handle it - build it in workflow builder or write an ABAP report?

Thank you in advance,

Merta

View Entire Topic
Former Member
0 Kudos

Hi Merta,

We had a similar requirement and this is how I achieved it:

1. Pleace your approval task into a loop (while not approved) and create a container element as the approval flag. This allows you to get out of the loop when the item has been correctly actioned. Also create a DL element to hold your calculated deadline value;

2. Create a method and task to determine the next escalation point based on how many loop passes the instance has had, ie:

Pass 1 - DL = sy-datum + 1 day;

Pass 2 - DL = DL1 + 1 day, and so on.

3. Create a method to determine who should get what. Link this to a condition so you know whether to send a mail or escalate the entire workitem. Create the notification as a send mail within the condition;

4. Change the Deadline parameters in your step to "Refer.date/tim" = Expression and bind the DL element;

5. Set the processing obsolete property to ensure the workitem is killed when a new pass (and therefore and new deadline/agent etc) is started.

See the following:

This one handles the loop/obsolete concept.

http://help.sap.com/saphelp_47x200/helpdata/en/c5/e4b97e453d11d189430000e829fbbd/frameset.htm

http://help.sap.com/saphelp_47x200/helpdata/en/bc/ecdd5ad24e11d2b494006094b9ea0d/frameset.htm

Regards

Gareth

Former Member
0 Kudos

Hi Gareth,

Thank you very much for the information.

If I understand your approach correctly, I will need to use "modeled deadline monitoring" for my approval step. If I just use simple deadline in my approval step, the loop step will not do anything since the work item is "waiting" for the agent to do something. ( this is where I am stuck...)

However we don't want set the first work item to be obsolete as the work item will stand out(shown as overdue) in SAP inbox once the deadline is reached. Also if I obsolete the first work item and create a new one it will confuse the original approver with new date/time stamps from the new WI and message in the mail reminder( your work item has been past due XX hours) ....

Our business scenario is more like people are "forgetting" to do their job and it causes the delay. Therefore the work item should remain in the first person's inbox until he/she does something.

Regards,

Merta

Former Member
0 Kudos

Hi Merta

How about separating the task and the deadline. Place the task (with no deadline) in one side of a fork (2 branches - exit when one completes) in the other branch put the loop for deadline message control. What we would get is:

1) Workitem sent to approver. In the other fork the deadline time is calculated for a send mail;

2) After the calc deadline time, the sendmail is activated and goes to the first DL agent. we go into the next loop pass and calculate a new DL (and perhaps new agent);

3) Process continues until the Work item is actioned (as there is no modelled way to leave the DL loop).

One thing I have done to assist a similar process is to create the various message texts (with container placeholders) as SO10 texts and then use a method at each stage to get the correct text and fill with container data. This would only be needed if the messages were remarkably different. Otherwise you could pass a loop count parameter into the one text and use a case statement within the Description text (which is SAPSCRIPT) to have several possible texts for the one SendMail task.

Anyway, Good luck and let us know how you go.

Regards

Gareth

Former Member
0 Kudos

Hi Gareth,

Thank you for giving me the ideas to proceed. I am in the process of developing the changes and I am confident your approach will achieve what we need.

I do have a few questions though. How do I make the loop for sending mails only run once a day before the approval work item is executed. In my current development and tests(using minutes), I create a method with "wait" statement to suspend the looping. I am curious whether there is a better way to do it? It seems that I can not find any variables from workflow container under "_workitem" for Requested ended date/time. However I do see Desired ended date/time, Latest ended date/time. I was wondering why SAP does not offer "Requested ended date/time" in the workflow container or I have missed something.

Thanks again,

Merta

Former Member
0 Kudos

Hi Merta,

I would control by using a requested start deadline in the first task of the loop and setting to 1 day from WI creation. As the rest of the steps in the loop are background (including the send mails) this means I have the same time each day. Basically this means we control the start, rather than the end.

Regards

Gareth

Former Member
0 Kudos

Hi Gareth,

I am facing an issue with this development. I have a container operation after approval work item is executed to set a flag to leave the fork. While the looping branch is calculating how many minutes (testing with a smaller scale) it has past deadline and sending mails, if the agent approves the work item, the container operation will not be executed due to the locking and it creates an infinite loop. The error says "Work item 000000708955 locked by user WF-BATCH (enqueue error)" .

I have gone to Google to search "Work item locked by user WF-BATCH" and only found two threads. But it's not totally relevant. By any chance you could shed some light about this problem I am dealing with?

http://mailman.mit.edu/pipermail/sap-wug/2005-August/018718.html

Thanks,

Merta

Former Member
0 Kudos

Hi Merta,

First thing I would do is to see if this is a real world issue, or whether it is a function of testing deadlines over minutes. Does the error happen if deadlines are set to more realistic levels (usually I find 20 minutes gives a fair outcome)?

Remember in workflow deadlines are not immediate - the deadline is calculated and recorded by the workitem manager at runtime and saved against the workitem, the deadline action (or notification) is created the next time SWWDHEX runs AFTER the calculated deadline time, and sent the next time SWWERRE runs after it has been created. This process means the smaller the intervals you run, the more likely it is that the deadline activities will actually prevent accurate reflection of the process.

I have often been asked by testers to set deadlines to under 20 minutes. My answer is always no as the activity will invalidate the business process testing scenario.

If the issue is still a problem with more realistic deadline values, please post what happened and we'll dig a bit deeper.

Regards

Gareth

Former Member
0 Kudos

Hi Gareth,

I have tried to change the deadline(approval WI) to 25 minutes and the loop of sending mails every 30 minutes(with wait statement). Here is the test scenario - I will wait 35 minutes until deadline reached and first past due mail sent. Then execute the approval work item. However once the wait step ( the first step of the loop branch) begins, the container operation( this is the step after approval) to set flag in order to end loop is not executed due to the locking. I check lock entries and see this

800 WF-BATCH 09:47:50 E SWWWIHEAD 800000000709662 <- Top WF ID

800 WF-BATCH 09:47:50 E SWWWIHEAD 800000000709683 <- ID of Wait step

I also tried to use binding to pass WI actual agent back to a workflow container (a new variable) instead of using container operation to set flag to see whether it will make a difference. Locking remains.

It seems the wait step with wait statment casued this issue. Without wait statement, any suggestion to make the mail send loop run every period of time?

Thanks,

Merta

Former Member
0 Kudos

Hi Merta,

Does this mean you are using a method task with the ABAP statement

wait up to ..... seconds.

If this is the case it is clear what the problem is. Take this statement out and use the Deadline control on the workflow step in the tab "Requested Start".

Using the wait up to statement means that the workflow engine has the workitem (and thus the entire workflow) enqueued (locked) for the entire time the method is running.

So, what you need is a background method containing the following:

begin method dummy_for_loop.

end method.

(no actually logic - this is just used for the delay task)

Then create a task (background synchronous) referencing this method. Then in the workflow step for the task, set values in the deadline tab "Requested Start" from workitem creation with the timing set to your calculated container element. Then it will work.

Regards

Gareth

Former Member
0 Kudos

Hi Gareth,

Thank you very much for the quick reply. Yes, I used the "wait up to" statement. I need addition clues about 'set values in the deadline tab "Requested Start" from workitem creation with the timing set to your calculated container element'.

I guess you mean to use option of "Expression" in the Requested Start tab and has date and time to be dynamically changed? I am not ABAP fluent and need more hint to proceed....

Thanks,

Merta

Former Member
0 Kudos

Hi Merta,

This is what you do:

1) In the Workflow Builder, double click on the task set up for the background dummy method described in the previous post. At the top of the display you see tabs for 'Control', 'Outcome' "Notification' etc;

2) Select the tab 'Requested start';

3) In the field refer date/time Select the value ;'Expression';

4) In the Date field select (using the Search Help) System Fields - Current Date. This will give the value %DATUM% when you get back to the deadline screen;

5) in the + field add your deadline value (ie 1 for 1 day or 20 for 20 minutes) and in the drop down select your time unit (Minutes, Hourse, Days etc).

What this means is that when the step is reached and WI created, the system knows to set a delay of today plus 1 day before publishing the workitem. If you are using a DL of less than one day, set the time field to System-Time (%UZEIT%) so the engine has a reference for timing in minutes.

Regards

Gareth

Former Member
0 Kudos

Hi Gareth,

I can not stop thinking your first reply on the way home with my long commute. What I would have tried(before your second reply) was to write a method to offset the work item create date/time by passing a counter. Then pass the calculated date/time back to expression.

What you have walked me through is so much better and it works great. I would never thought "'Requested start" could be used this way to solve my issue.

Thank you so much.

Merta

Former Member
0 Kudos

Hi Merta,

Great news.

Regards

Gareth

Former Member
0 Kudos

Hi Gareth,

I am very interested in your idea about using a fork but I don't have any experience in using one. How do I set one up to do just what you are talking about here? I am a very visual person so diagrams help a lot!!

Sincerely,

Anna