Is there any way to redirect multiple tasks?

  • 6 November 2019
  • 4 replies
  • 132 views

Userlevel 3
Badge +9

Is there any way in k2 five to select multiple tasks and forword them. User left the company and I have 30 plus task to forword to new user. Before K2 five we were able to select and forword multiple tasks at a time.


4 replies

Hi YPawar,


 


Unfortunately not, you can not select multiple tasks for redirection as a batch. I understand your concern here that it is a very tideous task to redirect tasks one by one in your situation. How about you log this as an idea and have it voted on and reconsidered back on to K2's future releases?


 


Log a feature request here:


https://ideas.k2.com/


 


Regards,


Katleho

Hey YPawar,


 


It looks like this is already an existing feature request at K2's ideas forum https://ideas.k2.com/ideas/APIT-I-576.  I would recommend adding an 'upvote' to this idea and passing the link along to your colleageus to do the same.  Increasing the votes on these ideas will further increase the visibility to our product management team.


 


Thanks!


 


 

Badge +4

Hi!

Out of the box i don't know of any way on the management site. But there is a way in doing this pretty simple using code and the management api, you could read more about it here as a reference: https://help.k2.com/onlinehelp/k2five/DevRef/5.3/default.htm#Runtime/WF-Client/WF-ClientSamples.htm%3FTocPath%3DRuntime%2520APIs%2520and%2520Services%7CWorkflow%7CWorkflow%2520Client%2520API%7CWorkflow%2520Client%2520API%2520Samples%7C_____0

 

Here are some powershell code that you can use. This sample gets all the worklistitems for "Daniel" on the process "My Workflow", then iterates through all of these and redirects them to the user "Robert".

 

The key here is to create a good filter to get all the correct worklist items that you want to redirect. As you can see there are more parameters to filter on, and if you leave all blank you will get all the worklist items on the server. If you leave processName blank then you will get all the tasks for the user.

 

Add-Type -AssemblyName ("SourceCode.Workflow.Management, Version=4.0.0.0, Culture=neutral, PublicKeyToken=16a2c5aaaa1b130d")

$conn = New-Object -TypeName SourceCode.Workflow.Management.WorkflowManagementServer("localhost", 5555)
$conn.Open()

$destination = "K2:DomainDaniel"
$processName = "DanielMy Workflow"
$activityName = ""
$eventname = ""
$folio = ""
$fromDate = ""
$toDate = ""

$K2Wlist = $conn.GetWorklistItems($destination, $processName, $activityName, $eventname, $folio, $fromDate, $toDate)

$K2Wlist.Count

$K2Wlist | ForEach-Object -Process{

$redirectFrom = "K2:DomainDaniel"
$redirectTo = "K2:DomainRobert"
$procInstID = $_.ProcInstID
$actInstDestID = $_.ActInstID
$worklistItemID = $_.ID

$conn.RedirectWorklistItem($redirectFrom, $redirectTo, $procInstID, $actInstDestID, $worklistItemID)

}


$conn.Connection.Close()

 

Hope this can be a starting point for you.

 

Regards

Daniel

Userlevel 3
Badge +9

Hi,

 

To select and redirect multiple tasks feature was avaialbe since ages and it has been removed in k2 Five. I do not understand how it has to be new idea as it was already there in almost all earlier versions, at least since 2009 when I started working on K2. I would suggest not to wait until you get sufficient votes to implement this. It is a basic and I am sure lot of people would be suffering for this. Please pass on this message to management.

Reply