Solved

Succeeding Rules to Stop Parent Process Continuing

  • 13 February 2018
  • 6 replies
  • 8 views

Badge +4

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?

icon

Best answer by NickW 14 February 2018, 15:58

View original

6 replies

Badge +8

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.

Badge +4

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?

Badge +8

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/SmartObjects/Overview/SmartObjects-Overview.htm%3FTocPath%3DCreate%7CWorkflows%7CUsing%2520the%2520K2%2520Workflow%2520Designer%7CToolbox%7C_____7

Badge +4

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?

Badge +4

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.

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! 

Reply