Creating multiple ipc events at run time

  • 7 December 2006
  • 0 replies
  • 0 views

Badge +3
I have a slight dilemma. I have a scenario which has me trying to create a Master/Child workflow relationship.
Sounds easy enough, just create an IPC Event.
However, I don't know how many of these Child workflows I am going to be creating...
Sounds easy enough again, just create a slot for every Child workflow, and it will create multiple instances.
Problem is, is that I am passed a Collection of objects, which I have to loop through. This collection is in the form of a Unique Identifier which will become the Folio of each Child Workflow created.
So if I had 3 items in the Collection, and therefore set the number of slots to 3, I would not be able to then assign the Folio to the Child Workflows!

So what I did was I created some Process DataFields and a line rule that pointed back to the event that held the IPC Event and I looped in and out of the Activity until the collection of objects was finished.

This works, however the business requirements states that I am not allowed to do the next Activity until All the Child Workflows have completed. If I set this inside the loop then it won't create the "next" Child event until the previous one is finished, or it will move on straight after all the Child Workflows are created, depending on how I set the K2.Synchronous call.

My solution so far is to have a dummy client event at the start of the next activity which will do a count of how many Child Workflows have completed before I complete the client event. Problem with this is what happens if two workflows complete at the same time and my incrementing gets locked...

I am desperate for a solution here, if anyone else has a better, more stable way of handling this it would be much appreciated.

0 replies

Be the first to reply!

Reply