Solved

Redirect/return tasks outside of K2 Management

  • 8 February 2018
  • 3 replies
  • 26 views

Hi folks,

 

I have a process that requires an option to "return" a task and I'm struggling to solve this without custom code.

Let me paint a picture of the situation:

An accountant gets an invoice that is imported into the system. He checks it and forwards it to the employee responsible for approving the payment for this invoice.

Through escalations we can make sure that, if the task is not completed in 1 day, a reminder is sent. If the task is still open after 2 days, it goes back to the accountant.

Also, the employee has the option to open the form and choose "redirect" as a workflow action to send the invoice to a different user.

Now for the question:

The accountants need an option to get back an invoice. If they sent it to the wrong person or the person they sent it to is not available, they would need to either reassign it or to get it back to them. Waiting 2 days for the task to automatically return is not an option.

Here is what I thought of so far:

  1. I used a workflow-variable to set the escalation time. I then changed the variable from the accountant's side. Sadly, the escalation time does not change and the system sticks to the value the escalation had when it first started the activity.
  2. I tried to find a way to action the redirect outcome for the task - this fails due to the lack of permissions the accountant has on the employee's task. I could not find a way to do an impersonation without custom code.
  3. I had the task escalate back to the same user (through a value in the DB) every 5 minutes. The user could be changed in the DB and the next escalation would push the task to the new user. This offers new challenges, though. There are "gaps" in availability. If the taks gets escalated the link in the users tasklist expires and a refresh is required for the new link to be available. Also, the regular escalation after 2 days does not get a reset on the reassign.

Does anyone know of an option to do this?

Any input would be appreciated!

Alex

icon

Best answer by ShawnFaucher 8 February 2018, 15:02

An untested suggestion, as we use the API via custom code to do these sorts of things, but there is a system smartobject (System>Management>Workflows>SmartObjects>Activity) which has the GoToActivity method. If this works like the API, you should be able to call this on a buttom press rule on the accountant's side, provide the Process Instance ID (the first part of the task Serial Number) and the activity name, and the workflow will expire the existing activity and start it again. If you also change your expiration variable first to make it immediately expire this should do what you want. You would probably have to give the accountant admin rights on that particular workflow.

View original

3 replies

An untested suggestion, as we use the API via custom code to do these sorts of things, but there is a system smartobject (System>Management>Workflows>SmartObjects>Activity) which has the GoToActivity method. If this works like the API, you should be able to call this on a buttom press rule on the accountant's side, provide the Process Instance ID (the first part of the task Serial Number) and the activity name, and the workflow will expire the existing activity and start it again. If you also change your expiration variable first to make it immediately expire this should do what you want. You would probably have to give the accountant admin rights on that particular workflow.

Thanks, this looks to be exactly what I need! 

Userlevel 3
Badge +6

Hi @considerITman 

 

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

Reply