how to run Async sub process model in loop with some values?

Hi Team,

I have a array of some values in parent process model on based of which I run sub-process model Async with multiple instances wrt array, now I want that sub process model to send a value to parent and on based of that value it should run subproces model again, how to do that?

  Discussion posts and replies are publicly visible

  • Let's consider a few things

    • if you're calling your sub-process Asynchronously you cannot (directly) pass a value back to the parent process. The parent process could pick up data from another source (e.g. if the sub-process writes values to a database table the parent could pick up data from that, but you'd have to find a way to synchronise the two to ensure the parent knows when the data is available. One option to synchronise the two is to have the sub-process send a message to the parent process telling it that it has finished its processing and that it's now safe to retrieve the data from the database table
    • looking at this differently - what is the sub-process actually doing? could you achieve the same outcome by implementing your processing in an expression rule and call that from you parent process? And, by extension, could the expression call itself again based upon the result from the first call (i.e. implement a recursive design)

    Key questions are:

    1. exactly what is the sub-process doing with the data passed to it?
    2. what result in the sub-process would cause it to be re-executed? (and how do you prevent this from being an infinite loop?)
    3. how may data items are in your original array? (i.e. do we have to handle more than 1000 items and can we use MNI or do we need to avoid using that as a pattern?)
    4. why do you think you need to run the sub-process asynchronously if you need data passed back to the parent process? What's preventing you from calling the sub-process synchronously?