Skip to main content
devarnenis2638
August 9, 2024
Question

Multiple node instances

  • August 9, 2024
  • 9 replies
  • 0 views

I have 2 records A and B with one to many relationships, both the records contains a column isActive(boolean). I have a process model that is triggered as related action of record A and this process model contains Start Process(node) with MNI, and a child process will be triggered for each child of record A, this child process is used to deactivate the corresponding child record by marking isActive as false. Here the requirement is, only when all the child process instances finsh by marking the corresponding child rows as deactivated, we need to deactivate the Parent row in the Parent process model,

How can we achieve this?

I tried using send mesaage and recieve message events and it's working but I am not sure this is a preferred way as we are sending message from each and every child instance, if we have 1000 child records 1000 messages will be sent, I don't know weather sending these many messages cause any issue. Is it fine to use the approach or do we have to do something other than this

9 replies

stefanhelzle0001
August 9, 2024

Please help me. You do all of this process-calls-sub-process+messaging thing just to update a few rows in the DB? Is this an automatic process? This does not feel like a very efficient implementation.

Why not just do a query database node or call a stored procedure to update all children. Then query whether all have been deactivated and then update the parent accordingly.

davidj137213
August 10, 2024

Totally agree with [mention:a11f77a729fb4db2af76b09948583328:e9ed411860ed4f2ba0265705b8793d05] ... seems better , easier and more efficient...

kumara0180
August 10, 2024

One other option could be that every time child process completes, that process model checks if all the related child cases are completed. if answer is yes then mark the parent case as completed. 

devarnenis2638
August 11, 2024

[mention:d71dc0922a44411db41369c6058e69ad:e9ed411860ed4f2ba0265705b8793d05] Could you please add few more points and explain how to implement this, like how to check related cases are completed or not every time child process completes

Any specifice nodes/smart services or functions that I should use

kumara0180
August 12, 2024

You can query status of related child cases of the parent case from the current child case. if the status of all child cases are completed you can mark parent case as completed.