jphillips
Novice

Workflow Originator redirect a task at any activity

Hi All,

I have been working with K2 for a couple years now and I haven't been able to figure out a good way to get the Workflow Originator to have permsisions to redirect (or delegate) an approval task.  I feel like I might be missing something simple because I think this would be a common request. 

 

I have a simple approval workflow.  The originator creates and submits a form, workflow starts and goes to an approval activity.  I loop on this activity until there are no more approvers then the workflow completes. 

 

I would like the originator of the workflow be able to redirect the task to another user if an approver is not available.  (We don't want to rely on a K2 admin to redirect.)

 

My approval activity has the actions of Approve, Decline and Rework.  If I create a "transfer" or redirect action on an activity it seems I would have to make the originator part of the destination set and then they would also get all of the approval emails that go out.  

 

Is there another way to handle this?  Can a destination user only have permissions to certain actions?  Or should this be a separate activity and if so how would I stop the current task reassign the approver then start the task again?

 

Thanks for any help you can offer!

Janet

0 Kudos
Reply
3 Replies
ConradK2
Novice

Re: Workflow Originator redirect a task at any activity

Hi Janet,


 


Unfortunatley security ONLY allows the destination user to redirect the task to another user (from the worklist / client API).  The originator has no rights to any of the tasks if not part of the destination set.  This is by design.


 


You will either have to add the Originator to the destination set or build a custom UI to impersonate the destination user (client API) and then if the logged in user is the originator, allow the redirect.


 


Alternatively, a process admin has this rights in Workspace and also via the Management API.


 


HTH!

0 Kudos
Reply
ConradK2
Novice

Re: Workflow Originator redirect a task at any activity

Thinking about it...  If you add an 'Admin' activity (with client event) in your workflow that runs from the 'Start' activity and assigns the task to the Originator, you can within this 'Admin' step change the datafield that sets the destination set and then perform a GotoActivity to the Approval activity which will replan the destination set.


 


NOTE: This will only work in a workflow where there is only a single activity active at any time since the GotoAvtivity will expire all other activities and continue at the designated activity on the GotoActivity.


 


Always keep the 'Admin' activity active by looping back to the activity using a line rule to itself. 

0 Kudos
Reply
Olivier1
Novice

Re: Workflow Originator redirect a task at any activity

Hi  @ConradK2 
 
Warning:  we have encountered a problem with GoToActivity (K2 Five 5.1 to 5.4 at least)
Following the use of the go to activity inside a Split/Merge the workflow stops at the “Merge” step next. Issue appears with Go To Activity from Management site with K2 Five new designer (Split and merge was not possible in K2 Studio).
The issue appears too with Process Version Migration Utility: https://community.k2.com/t5/K2-blackpearl/Process-Version-Migration-Utility-v3-0-6/ba-p/98975
 
At the same time, I asked to an impacted customer to create 2 K2 Ideas created in order to maximize the chances of having actions taken on this subject which can be blocking.
 
I therefore invite you to vote on these K2 ideas:
https://ideas.k2.com/ideas/APIT-I-1554
Fix issue: after go to activity, the workflow stop at the next merge step.
 
https://ideas.k2.com/ideas/APIT-I-1555
Add warning message in case of use of Go to activity from Management site to avoid important issue with split branches.
 
 
Please vote on them and don't hesitate to transfer to your colleagues who have a K2 account: For a K2 Idea to possibly be considered, you need at least 20 votes.
 

In addition, a normal behavior to know is the following:
If there are several activities in progress on the same instance of worklfow and that one uses the GoToActivity on any activity,
all the activities are finished and it does not will remain more than that specified by the Go To Activity.
However, it is possible to do a Go To Activity for a specific activity via the API.
This functionality has been implemented in the Workflow Management: https://community.k2.com/t5/K2-blackpearl/WorkflowManagement-Service/ba-p/65416
With this tool, we have possiblity to specifiy the "FromActivityName".
SmartObject service tester++ URL (https://community.k2.com/t5/General-K2-Utilities/SmartObject-Service-Tester-plus-plus/ba-p/92426😞
SmartObject ExplorerDefaultSmoTask_managementMethodsGotoActivity -E ProcInstID=123;FromActivityName=Task1;ActivityName=Task3
 
 
Best regards,
Olivier
0 Kudos
Reply