Workflow Design Question

  • 15 August 2007
  • 4 replies
  • 3 views

Badge +1

I have 3 approval activities A, B and C in a process. Each approval activity is on the same level in the process and each has a unique destination defined in them. Each approval activity has 2 outcomes: approved and rejected. And to simplify the workflow, each of the 3 approval activities has a line that joins to the same activity called 'Approved', Likewise, there is also a line from each of the 3 approval activities that joins to the same activity 'Rejected'. Therefore, instead of having 3 sets of 'Approved' and 'Rejected' activities, there are only 1 shared by the 3 approval activities. Both the 'Approved' and 'Rejected' activities are the final stage in the process and each has a sever mail event that informs the originator when a process has been approved or rejected.


Question: I want to setup the mail such that if Process A is approved, an email will be sent to inform the originator that Process A has been approved. How can I determine which is the process that leads to the 'Approved or 'Rejected' activity? As the 3 processes are independent of each other with different destination user, the order at which the processes are finished is indeterministic.


 


4 replies

Badge +8

With regards to your Activities A,B and C


1) Do they use the same approval page in the client event?


2) Do you want the process to finish as soon as the 1st Activity is completed or must all 3 be completed at some time?


3) In general what will the approval e-mail tell the user?

Badge +1

Thanks for your reply. And answers to your questions:


1) Yes, they do.


2 and 3)


I think a use-case will better illustrate the scenario I have. When employees need to purchase items, they raise request through this workflow process. Items are grouped into 3 categories manged by the 3 activities and each has it's own approver.


Item Category | Acitivty | Approving Manager


stationary       |      A      |      Manger A


IT related        |      B      |      Manager B


Others           |       C      |     Manager C


User X comes into the system and wants to purchase pens and a keyboard. After submitting, my system will check which processes require approval (using line rules); in this case, process A and B. In K2, right from the 'Start' activity, it will route (parallel) to both activity A and activity B but not activity C. An email will then be sent to both managers A and B at the same time to notify them to action on their respective items. So if say manager B approves first, I want K2 to send 1 email to inform user X (originator) that purchase request for keyboard has been approved. After when manager A approves, another email will be sent to user X saying that purchase request for pens has been approved. That concludes the entire process.


 This is how my workflow design looks like:


             | = > Activity A = > |        | = > Approved


Start  ----| = > Activity B = > |  ----  | 


             | = > Activity C = > |        | = > Rejected


So you can see that I can actually create a set of approved/rejected activities for each of the ctivity A, B and C. That would mean there will be 3 sets of approved/rejected activities performing the same tasks basically, only with a different email message corresponding to the activity. But I am looking for a more elegant solution in this case, using only 1 set of approved/rejected activities..

Badge +3

Hi there.


Based on what i see here and the use case, i believe you are there.


if you do not use preceding rules on your 'approve/reject' activities you should be able to accomplish the different emails by just setting a value in datafields to be used in your email to say which approval/rejection has been fired.


when any of activities a-c have completed, they will execute line based on your line rules. al you have to do is have three datafields, one for each activity, and set these datafields with a server event (within activity a-c), then when you get to your 'approve/reject' activities you use these process datafields to set the relevant content in your emails.


hth

Badge +8

Personally, I see all three of your Activities as just a single Approval step, If you have 100 different categories, you are not going to create 100 Activities.


The K2 Destination Rule property on the Activity allows you to create multiple Send-To/Send To Manager Groups, and you can specify rules on each destination.


My suggestion is to have one Activity and then create multiple Destinations with Rules behind them for that Activity.


Remember to create a Succeeding rule so that the Activity completes only when all managers have responded. If you have access to the K2.net 2003 Dev Course, this is explained in Module 5 :-)


 


 

Reply