Bypass Activity for approver

  • 20 September 2013
  • 8 replies
  • 2 views

Badge +1

Hi, I have a requirement to bypass the subsequent activities if the subsequent activities require approval from the same person who has approved the current activity. For example, if there are two activities that the current person is one of the approvers. If the person approve this activity, he/she should not need to approve the next worklist, it will automatically go the the subsequent activity. Any advice will be greatly appreciated. Thanks.


8 replies

Badge

Hi,


I'll probably do something like this :  



 

Badge +1

Thanks Amanda for your prompt reply and advice. I do appreciate it.


For the flow you provided, I am keen to find out after first approver approved and go to the next activity - in this case "Second Approval". If the person who approved "First Approval" is one of the person in second approver list, I will bypass "Second Approval" and go straight to "End of Process" in this case. Fyi, I was trying to find out who is the person who approved but don't know which variable stored this value so that I can store in in Data Field and compare with the next approver list. Any advice which K2 variable I can retrieve this value? I would see this value being stored by viewing from "Process Overview" report, and tested various fields in K2 designer but don't seem to find the right value. Any pointer will be greatly appreciatedly. Thanks.

Badge +6

In K2Studio, within the Workflow Context Browser - use the Activity Destination Instance

Badge +1

Thanks Sujeeth. That's what I would imagine as well and checked all the values from "Activity Destination Instance" earlier but did not find what I wanted to see. I believe the problem is probably the way my company uses K2. My company don't use "K2" label for authentication, we are using "K2SQL" for authentication. This is due to some of the users are sharing computer with the same window account. This practise exist long before "K2" came into picture, so, the way around is to customize and use "Employee ID" instead to uniquely identify the user. Any other pointer? I don't mind using "Server Event" and do some coding since we might not be able to use all the "out-of-the-box" feature now.

Badge +6

Activity Destination Instance from the context browser in K2 Studio works only at runtime of the instance when it has the context of the activity. So you must have the data transfer event within the activity.


Do you see the required data in the process overview report? If so, you can use Activity Instance Destination smartobject. It is under reporting smartobjects category

Badge +13

If there are 10 approval activities the process could get messy.


Is there a way in the client event to determine that it is satisfied and "completes" that activity within the workflow process so the activity's server event (e.g. append an approval comment to text) is executed?   (without creating additional activities/lines for that scenario without a client event)

Badge +1

Hi Peter, thanks for the comment. What you described will be ideal if this can be achieved. So far, I don't quite find any event that I can use to bypass or auto complete "Client Event" when certain conditions is met. I guess the best that I can possibly do is probably play some trick by using "Escalation Rule" and "Line Rule" etc; I have yet to try this. Earlier on Sujeeth seems to shed some light when he talked about report smartobject. I will try it to see if something in this direction achieve the result I wanted to see; could be cumbersome but I need at least one solution that works first before I explore further. (Thanks Sujeeth for this pointer!!). Well, fellow developers, I appeciate any feedback and pointer, do reply on this if you have something that could possibly point me to the right direction.

Badge +1

Ugh... I've had to do this as well.


What I did was have an activity prior to the approval activity that would load the various members of the approval process (from SmartObjects, requestor information etc.) into Activity Instance fields, and then I put in a custom code event that would evaluate the set of users and construct a custom piece of role XML in which no approver exists twice.


The approval Activity then gets assigned to that role, with the destination set up to assign to each member of that role, one at a time (Plan One at a time, Create a slot for each destination, Resolve all roles and groups to users). Then I just needed to modify the outcomes so that all slots had Approve, but just one slot could Decline in order to complete the activity.

Reply