Solved

workflow loop with tasks in parallel

  • 18 July 2019
  • 7 replies
  • 115 views

Badge +8

Trying to create a workflow which uses a recipient list.

 

Can you send tasks to the list of recipients within the loop, and then when it completes, move on to another step in workflow?

 

When the first task is assigned, the workflow stops instead of sending tasks to all recipients.

 

Anyone have a test example of this?  I am using K2 V5.2.  Do I create a sample list view?  Do I need an item reference within workflow?  I've been looking on the forum, and K2 documentation, but just do not see examples using tasks; only in sending email.

 

BKlaege

icon

Best answer by BKlaege 30 July 2019, 14:28

View original

7 replies

Hi
you can do this in new workflow designer K2 FIVE, you have to add the Create Reference step , and then use Loop to send task to customer. see example on link below, but the example use loop to set email, for you scenario, you can use Task step in loop instead.

https://help.k2.com/onlinehelp/K2Five/UserGuide/5.1/default.htm#How-Tos/LoopList/How-To-Loop-through-list-of-items.htm?

Badge +8

Macky,

 

I'm attaching a couple of screen shots of my workflow.

 

I am using K2 V5.2.  I did search the documentation and decided to use a static list for the loop step to run a test.  I did not look at the sharepoint example, since I wasn't going to use a sharepoint list.

 

When I add the create reference, it looks like it is making me choose a smartbox object.  For now, I just have a static list, and when I use my form; it will be writing out a list specific to each form which I will read through to assign tasks.  This part is not there yet.

 

If I had any smartbox object list containing 3 items; would this loop 3 times?    Seems so difficult to use workflow.

 

Do you have a way to configure a static list?  I think I said before, but the list doesn't seem to matter; since right now, I am just trying to create several tasks in parallel; and I have them hardcode to all go to the originator for testing.

 

BKlaege

Hi BKlaege,

You don't need to use sharepoint list,
I just give you the idea for loop step to help your issue. If you want to use static list for loop, it's easier. You can loop through a list of static values provided to the step. please see as link below

https://help.k2.com/onlinehelp/k2five/userguide/5.2/default.htm#K2-Workflow-Designer/Use/Toolbox/Logic/Loop/Loop.htm?tocpath=Create%7CWorkflows%7CUsing%20the%20K2%20Workflow%20Designer%7CToolbox%7CLogic%7C_____6#staticloop

So this case not need to use 'create reference' step.
Badge +8

Hi Macky!

 

Thanks for replying.

 

I did follow this example I believe.  I attached a screenshot of my workflow in my last post.  The tasks do loop; it is just that the first task has to be completed before the second task is assigned, and the second has to be completed before the third is assigned.

 

Where am I missing having all tasks assigned in the loop, so that the tasks can be worked concurrently?  I will eventually have a list view to work with a random number of tasks; but for now I am trying to use the loop with a simple list.

 

Is there a parameter on the loop step I am not seeing?

 

BKlaege

Badge +8

I received an email asking to mark one of the solutions as an accepted solution.

 

It seems like you can put a task within a loop, but K2 only executes the tasks when any preceeding task is completed.

 

In other words; it is my understanding that K2 cannot send tasks in parallel.  If this is possible; someone please suggest where I am missing a parameter.

 

Thanks!

 

BKlaege

Hello,

For parallel looping will probably not work. I played around with it recently and couldnt get it to work. But if the contact list is truly static it might not be that hard to simply do the tasks in parallel? Is the contact list very large or why is loop needed? 

Badge +8

Thanks Tom-C

 

I was trying to test workflow with a static list.  The list would have eventually been a list view with a random number of people.  It would have likely been a small list (Less than 10).

 

We are abandoning this concept and going back to one form submission and one task per person.  So in all, we are simplifying the design.

 

Thanks for your help.

Reply