How to assign a task to multiple users dynamically

  • 26 January 2016
  • 2 replies
  • 2 views

Badge

I have a requirement for a work flow as under

 

1.  KPI Data is entered by updaters in a .net application.

2. On submit the next step in the work flow for approval is triggered.

3. In this stage the number of approvers varies from KPI to KPI. 

4. KPIs have none or maximum of 3 approvers.

5. If a KPI has NO approvers it should automatically be approved and instance closed.

6. If only ONE approver it should assign the task to that user.

7. If only TWO approvers it should assign the task to the TWO  users and if ANYONE approves the instance to be closed.

8 If THREE approvers it should assign the task to the THREE users and if ANYONE approves the instance to be closed.

 

Appreciate if any help is provided on how to create the workflow in K2.


2 replies

Badge +7

i recently did similar workflow, you need to create a few Line Rules, and check conditions

if next approvers are some negative value example 'N'
then skip all and complete task

or next approver are NOT 'N' value then move to next approver

Badge +5

Hi Cheenu,

 

First, if you aren't familiar with how Line Rules, User Tasks, Activities, Slots and Outcomes work, check out the following links first. If you have gone through these before...great! You should be able to piece it all together.

 

Actions and Outcomes

 

Activity Rules and the Sequence of Execution

 

Activity Planning and Slots

 

Slots and Outcomes

 

Working with Lines

 

To set this up, I assume you have a database table, sharepoint list or SmartBox based SmartObject where you manage your KPI's and the assigned KPI owners. The assigned owners with each KPI should be either a K2 user account, or correspond to an Active Directory account, e.g.  DENALLIXjohnr, etc. These will be the destinations in your assigned User Task within your workflow.

 

Steps:

 

  1. Coming out of the "submit the next step" event on the workflow canvas, setup two line rules. (We evaluate both of these line rules so that the workflow only goes down one of them.)
    1. One line rule will load up the assinged KPI record from your SmartObject and determine if there are "No KPI Owners". If this evaluates to true, route this path to an activity designed to mark your KPI as Approved for that workflow instance.
    2. The other line rule will also load up the assigned KPI record and determine if there "Are KPI Owners", route this line to a User Task that assigns the owners of the KPI an approval task. 
  2. With your approval task, based on what requirements 6 - 8 are stating, you want to setup the activity planning in a manner called "Plan just once". Then assign the owners of the KPI the task from your KPI SmartObject. This way all of your KPI owners will receive an approval task, but the first to approve will send the task on. That should cover all three of those scenarios.
  3. Next, from your User Task assignment you'll have your Approved outcome line run to the same Mark Approved Activity from 1.1 above to mark the KPI as approved.
  4. Then also setup a Disapprove/Rejected outcome to go to an activity setup to mark your KPI as rejected, or whatever you want it to be there.

Are you using K2 Studio/Visual Studio to build your workflow, or K2 Designer?

 

I have attached a small example description shown in the file: Multiple Destinations Example.pdf (or use the OneNote file if the PDF is too blurry).

 

Also, if you have access to a K2 VM, I have attached a K2 Package and Deploy file with a small solution, although it's using SmartForms. The Workflow was built in K2 Studio.

 

Jason

 

Disclaimer:  The attached package file and examples are provided for learning purposes and are just one way of doing it.   :)

Reply