andiak
Apprentice

How To Undo Redirect Task?

we have a case in where an API receive a list of task to be redirected to another user, and it will iterate for each item and redirect the task to the user destination.

 

The problem is we have a preventive measure so that if any of the redirect fails during the loop (connection down, task not found, etc.) it will undo the task that have successfully redirected, back to the original owner of the task.

 

My Question is, Is it possible to undo the task that was redirected back to the original owner? if yes, how do i achieve this?

 

Thanks.

0 Kudos
Reply
7 Replies
Sunrise
Novice

Re: How To Undo Redirect Task?

Good day  @andiak 

 

“Release a Task List item” can be used to undo “Redirect a Task List item” according to documents, but I have not tested it on my environment yet. Will you please try Redirect if you have not tested with it yet?

 

I hope at least one of the following will helps:

 

Best,

Sunrise

 

0 Kudos
Reply
Widson
Novice

Re: How To Undo Redirect Task?

Hi  @andiak ;


 


At the moment, I think you can redirect the item back to the original user through the management console in Workspace. for now there was feature logged(https://ideas.k2.com/) just that I'm struggling to trace it.


 


Additionally Kindly dive into this dev ref(https://help.k2.com/onlinehelp/K2Five/DevRef/5.3/default.htm#Runtime/WF-Manage/Delegation.html).


 


Take this time to Vote for related issue as shown(https://ideas.k2.com/ideas/APIT-I-880).


 


Best Regards;


Widson.

0 Kudos
Reply
KagisoMasha
Novice

Re: How To Undo Redirect Task?

Please also look read in below:

Goto activity

https://community.k2.com/t5/K2-Five/How-exactly-does-redirect-work/td-p/108248

@Gabor wrote

I have found a workaround a long time ago for removing unwanted worklist items by simply redirecting the item to a person that already has the item. It does not start it twice and the old one goes away.  This is via the K2 API.

 

How to delete or stop an activity from another in the same process?

https://community.k2.com/t5/K2-Net-Blackpoint/How-to-delete-or-stop-an-activity-from-another-in-the-...

 

Hope it helps

0 Kudos
Reply
andiak
Apprentice

Re: How To Undo Redirect Task?

Thanks for the reply

 

This one works since it actually return the task to the original owner after redirect, however the GoToActivity method isn't executed from the management site. I also check the K2 REST API but it seems that i cannot found said method. Any available alternative beside using custom made API?

0 Kudos
Reply
Sunrise
Novice

Re: How To Undo Redirect Task?

Hi  @andiak 

 

Please take a look at the following, if you have not yet, about - Sleeping, Waking, Redirecting, Allocating and Releasing tasks:

Workflow REST API: Task Operations: https://help.k2.com/onlinehelp/k2five/devref/5.3/default.htm#Runtime/WF-REST-API/Workflow-REST-API-T....

 

Best,

Sunrise

 

0 Kudos
Reply
KagisoMasha
Novice

Re: How To Undo Redirect Task?

Hello  @andiak ,

 

I have went out to gather all the information you may neeed 

 

Process cancellation:

https://stackoverflow.com/questions/4394169/k2-process-cancellation

 

Task Name and Goto Activity in K2 Five

https://medium.com/k2-dev-en/task-name-and-goto-activity-in-k2-five-91c7dcf9d2bc

 

Workflow REST API Code Samples

https://help.k2.com/onlinehelp/k2five/devref/5.2/default.htm#runtime/wf-rest-api/workflow-rest-api-s...

 

Workflow REST Services: However this is our previous versions

https://help.k2.com/onlinehelp/k2blackpearl/devref/4.7/default.htm#WorkflowRESTServices.htm

 

 

How To: Expire Parallel Tasks Based on a Condition

https://help.k2.com/onlinehelp/K2Cloud/UserGuide/Update_9/default.htm#How-Tos/ExpireParallelTasks/Ex...

 

 

Expire client event not the activity

https://community.k2.com/t5/K2-Blackpearl-Forum-Posts/Expire-client-event-not-the-activity/td-p/7448...

 

 

 

How to end one of the parallel flow and keep other running on click of a button

https://community.k2.com/t5/K2-Blackpearl-Forum-Posts/How-to-end-one-of-the-parallel-flow-and-keep-o...

 

I think you should also try lookind deeply into the GotoActivity as it has worked for most people.

 

All the best.

 

0 Kudos
Reply
Olivier1
Novice

Re: How To Undo Redirect Task?

Hi  @andiak 

 

Yes, you can use the GoToActivity with API and the advantage is that you can specify the FromActivity in order to not stop all other activities but only one.

This API is already used by the custom very intersting service broker Workflow Management: https://community.k2.com/t5/K2-blackpearl/WorkflowManagement-Service/ba-p/65416

 


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