Implementing 2 level of Escalation


Badge +4
Hi All,

I am stuck . Maybe this sounds quite odd and simple but somehow I am not getting a way to implement .

This is the scenario:

I have 3 users : User1 , User2 , User3.
User1 is the destination user for an activity. I need to implement Escalation in the following manner : If User1 fails to complete within a specified time(let say 1 minute) then it should escalate to User2 and if User2 fails to complete it in 1 min then it should escalate to User3.

Please suggest a simple and best and trusted way to implement this . I am facing problems because I have never implemented escalation and I am also trying to learn k2 .

Pls reply ASAP.

Any solution can also be sent to:
satyajeet.panda@wipro.com

16 replies

Badge +7
First question is which SP are you running. I think starting at SP you have a redirect escalation function which you could use to achieve your goal.

If you are running a lower version you can do it like this.
Whe the flow first reaches your activity user1 gets the task. If he doesn't handle it within one minute you need to fire the first escalation.

First thing you need to do is add a Process Datafield to your workflow and name it "user" and give it a default value user1.

Now open the escalation wizard for your activity and create a new GoTo escalation which triggers after one minute. After you ran the wizard go to configure your escalation and switch to "generate code" - "use code".
You need to do two things now in your escalation. Add an "if" statement which checks if the value of your datafield is user1, if so start the escalation and also wirte "user2" into your process datafield.

Create a second GoTo escalation which triggers after one miunte but only if your Process Datafield value is user2.
The two GoTo escalations must of course route the flow to the same activity again.

The only thing left is to check within your destination rule of the activity which value your process datafield has and depending on that put the tasks in the responsible users worklist.

Hope this helps. If you have any questions just let me know.
Badge +4
Thanks nukkumatti.

The IDEA was FANTASTIC.

But Still I have some doubts like :

Add an "if" statement which checks if the value of your datafield is user1, if so start the escalation and also wirte "user2" into your process datafield. Here u have said to start teh escalation . How will the escalation start ? Will it start when code will be executed or how do u start it ?

Please give some more details as I am a newbie in K2. I have not even climbed 1/5 th of K2 .

One more thing I do have "redirect" escalation but sadly do not know how to use it . Please guide me regarding using it too.

Thanks a lot once again.

Please reply ASAP.
Badge +7
Okay I try to explain and also will give you a code snippet.
As described in my prvious post you have two GoTo activities but you want to trigger always only one. Actually both would start after one therefor you need to have a check within your escalations. The first one starts only if user1 has not handled the task and the second one only if user2 still has not handel it. See below code:
.Value.ToString());
}
else()...
if (bAllTrue == false) return;
}
}


To write custom code for your escalation right click on your activity - select escalations - select the escalation you want to configure - click configure - on the left side select escalation action - from the radio buttons select use code - click generate code - click edit code - use the code I mentioned above.

For your destination you have two possibilites, use the code from above for the destination rules - right click your activity - select properties - select destination rule - from the radion button select use code - click generate code - click edit code

OR

set up three different desintaion rules for your activity - right click on the destination rule - select modify rules - and set the ruels that destination one only gets the task if your process data field is equal user1


Does this help ?
Badge +7
BTW - Behind each event, activity, line there is automatically code generate which you can customize and yes the escalation rule starts when the code is executed. For some really simple scenarios using rules for the lines etc. is enough but for more complex workflow you need to write your own code.
Badge +4
Hi nukkumatti,

Thanks once again.

It's a bit complicated for me but I am still trying to master it .

Would u mind telling me something related to "REDIRECT Escalation" and if I ask u further about the GoTo escalation.

Pls reply ASAP.
Badge +13
If we have more than 1 escalations defined in an activity, is each escalation managed in its own separate timer so they could run in parallel?

ie. Escalation 1 occurs every day. Escalation 2 occurs every hour, each does their own different action.
Badge +7
Yep this is possible. I have for example a process with an activity that has 1. email esacalation after 30minutes
2. email notification after 60minutes to complete team
3. goto activity after 60minutes and 30 seconds. (I set some process data values within the previous escalation and want to make sure that the second escalation really runs before the third)

The goto activity actually routes the task to the same activity but to a complete team as a destination and not only one user anymore.

Sorry I haven't used the redirect escalation yet.
What else would you like to know about the GoTo stuff ?
Badge +4
Hi nukumatti,

Thanks for replying once again . I think I will go crazy understanding this escalation thing.

U have mentioned something about 2 GoTo activities. Is it 2 Goto activities or 2 Goto Escalations .

Also I have mentioned about 3 users .

User1 escalates to User2 and User2 escalates to User3.
But U have taken into account 2 users viz user1 and user2.

Pls help me out once again with a full fledged method as to what should I do ?
Badge +4
Hi Peter,

Thanks for coming into the picture .


I think there is no such concept of parallel Escalation.

I want to escalate to "user2" if "user1" fails to complete the task within the specified time and further escalate to "user3" if "user2" fails to complete the task within the specified time .


This is my humble requirement but I have gone mad trying to figure it out and trying to go thru what nukkumatti has posted.

Pls suggest the best possible solution to my problem and understand one thing that I am very poor in K2

Pls help me out .
Badge +7
Okay lets play this thru only with two users and on GoTo escalation.

Create a Process Datafield named "user" and set its default value to "1"

Set 2 destinations to your activity name them "USER1" and "USER2". Modify the rules for this destinations by right clicking on them.

Select from first box your datafiel USER

from the second "="

enter in the third 1

do the same for your second destination but enter 2 into it.

Okay so far it should be really easy to understand. once the workflow comes to this specific activity the destination rules check the value of your process data field "USER". This is by default (by you) set to one so the task will be given to user1 but not to user2.

Now add an escalation to your activity. Use a Goto activity and follow the steps I already described in my previous post to write some custom code for this escalation.

You escalation code has to look like this:
.Value = "2"; 
K2.GotoActivity("ActivityName-Jump to the same activity");

}


Let's further say this escalation fires after one minute when user1 has not done his work. The escalation first sets the value of your process data field to 2, then routes the flow again to the same activity, the destination rules check the value of your process data field which is now 2 (set by the esaclation) and therefore give the task to user2 and not on anymore.

Is that clear ? Please try first to get this running. May be you also get the rest then. If not jsut let me know.

I think point that you are missing is that when you use the first escalation to route the task again to the same activity all escalation counter start to tick again. therefore you need to check the value of your process data field to see which escalation you actually want to use. but as said try it with two users only firs.
Badge +4
Hi All,

Sorry I messed up with my requirement .

It goes like this :

User1 has a worklist of his own . If he is unable to complete the task specified within time then the pending task should be added to the worklist of User2 and same is the case for User2 . If User2 is unable to complete the task specified within time then the pending task should be added to the worklist of User3.

Sorry for wasting ur valuable time .

Pls guide me thru.
Badge +4
Hi Folks,

I guess U r really angry with me for not giving a clear idea of the requirement.

But I am sorry . I somehow messed it up.

But pls do help me out .

My previous post exactly describes what I want. I am also trying to work out the "Redirect" escalation.

Once again , I sincerely apologize for wasting Ur valuable time.
Badge +11
First, I would like to thank Nukkumatti for sharing his/her knowledge with the K2 community - this is exactly the purpose of the forum and we love to see this kind of interaction.

Ok, so, if I understand your requirement correctly, User1 receives a worklist item to action. If he/she is unable to action it within a predefined time (say 1 minute), the same worklist item should also be sent to User2 (with User1 still having access to the same worklist item). If User1 and User2 are unable to action the worklist item within another minute, User3 should also be added to the list i.e. the worklist item ending up on 3 different user's worklists.

One way to achieve this would be to create a process level datafield called 'DestUsers' which should contain a comma-separated list of Destination users for the specific Activity containing the Client event. You should be able to do the same thing with an XML field but I've found that most people prefer datafields to xml fields. Now, when the process reaches this Activity, the 'DestUsers' datafield should at least contain the name of User1 in the format 'DomainUserName'. In the code behind the Destination Rule for this Activity, you'll need to parse the 'DestUsers' datafield and add each user separately as a Destination User i.e. by the third time the Activity is instantiated, the 'DestUsers' datafield will contain - 'DomainUser1, DomainUser2, DomainUser3' - this, you will need to parse into three unique users and re-run the 'K2.Destinations.Add' line of code once for each user found in the csv list.

Now you can add a 'GoTo' Escalation to fire after 1 minute. In the code behind the Escalation Action, you'll need to add the next user to the 'DestUsers' datafield and 'GoTo' the same Activity - in effect, this will expire the current Client Event and Activity AND re-instantiate the same Activity and Client Event - with the only difference being that a new user is added. Now the same Escalation (after 1 minute) will exist for this new instance of the Activity. Again, in the code behind the Escalation Action, you'll need to add the third user to the list and once again 'GoTo' the same Activity.

Due to the fact that it is the same code being executed in the Escalation Action, you'll need some coding logic to determine which user to add to the csv list.

One important thing to be aware of though, is the fact that when the Activity (and corresponding Client Event) is expired, the existing worklist item will be removed from the list (in the database) BUT...
If the User do not refresh their worklists, the older worklist items will still be shown even though they do not exist anymore. If the user then try to action one of these 'non-existent' worklist items, an error will be generated - this can cause some confusion.

Hope this makes sense,
Ockert
Badge +4
Hi Ockert,

Thanks a lot for the suggestion.

It will definitely make sense .

Do U have any idea about "Redirect" Escalation ? because I have to implement the solution to the problem using Redirect Escalation.
Badge +11
If your requirement were to take away User1's worklist item and send it on to User2 - and then take it away from User2 and send it on to User3 i.e. always just one worklist item, the Redirect Escalation would have worked for you. However, with your requirement, I can't see a possible solution by using the Redirect Escalation.

Regards,
Ockert
Badge +4
Hi Ockert,

Thanks again.

Reply