NickW
Apprentice

Succeeding Rules to Stop Parent Process Continuing

Jump to solution

OK we are running K2 Five (5.0001.1000.1).

 

In 4.7 we could call an IPC process as part of a loop or use plan per slot (no destinations).

 

The sub-workflow / IPC process would have a task in it and we could then add a succeeding rule to stop the parent process continuing before all the sub-workflow tasks were completed.

 

How the devil is this accomplished in the new workflow designer for Five?

 

I can see the loop activity and the sub workflow activity and see that you can stop the workflow continuing until the sub-workflow task has completed but if you check this then you cannot do the looping as it'll create the first task and then wait. I think this was the same feature as the synchronous option in 4.7.

 

Any ideas?

0 Kudos
6 Replies
k2eric
Apprentice

Re: Succeeding Rules to Stop Parent Process Continuing

Jump to solution

There is a Sub Workflow For Each feature that is high on the backlog for later this year that will provide the same level of functionality that was previously achieved using the plan per slot no destination rule option but done in a way that is easier to understand and configure.

0 Kudos
NickW
Apprentice

Re: Succeeding Rules to Stop Parent Process Continuing

Jump to solution

Thanks.

 

So is there a workaround to stopping the parent workflow continuing?

 

Maybe a creating a task after the loop has completed which can then be completed by the child process?

0 Kudos
k2eric
Apprentice

Re: Succeeding Rules to Stop Parent Process Continuing

Jump to solution

A task could work but you might look into the "Wait For External System" option that is available on the SmartObject step which behaves like an async server event. Basically you can save a Serial Number to a SmartObject using the SmartObject step and have that step wait until the sub workflow finishes it by using the serial number. Here is the help doc that talks about the async option: http://help.k2.com/onlinehelp/k2five/userguide/5.0/default.htm#K2_Workflow_Designer/Use/Toolbox/Smar...

0 Kudos
NickW
Apprentice

Re: Succeeding Rules to Stop Parent Process Continuing

Jump to solution

Thanks - struggling to see how to start/action the Smart Object that's now waiting.

 

It says I need to do this manually through the Workflow API, which API does it refer to and is there not a SmartObject method or endpoint I can call without writing code?

0 Kudos
NickW
Apprentice

Re: Succeeding Rules to Stop Parent Process Continuing

Jump to solution

OK just realised there's a REST endpoint which you enable in the Managment console and can call as follows (tested via Postman):

 

POST: https://{K2Server}/api/workflow/preview/serverevents/{SerialNumber}/finish

 

This now actions the waiting SmartObject.

 

The serial number is passed in as one of the input parameters from the Workflow Context and i'm storing that in a DB table which can be later used by the nth child workflow that completes the parent process.

jgua2418
Apprentice

Re: Succeeding Rules to Stop Parent Process Continuing

Jump to solution

Hi NickW,

 

We are trying this solution but we have some problems with the attribute (userDefinedFields) of REST call.

 

In swagger tester we can't leave empty and we need to put something there like "{}" to run correctly. In Postmant nothing is needed and it runs well, and if we configure an SmartObject using K2 Five REST as integration we need to inform this parameter but we've tried with "{}" and " " and "{"XmlFields": [],"ItemReferences": {}}" but no solution is running, how you are informing this field?

 

Thanks!