Multiple node instances

Certified Senior Developer

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

  Discussion posts and replies are publicly visible

Parents
  • 0
    Certified Lead Developer

    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.

  • 0
    Certified Senior Developer
    in reply to Stefan Helzle

       To add on here the requirement is not just about updating the DB, we have few integrations to perform on each child row then need to update the DB that's the reason I went through that approach, if its just updating the DB I think we can directly update the Parent record and all its child records just using one write records smart service as they had one to many relation,

    Only when all the child process perform the integrations and updates the DB only the I need to end the Parent process, what should I do when I use Start process to trigger child processes 

Reply
  • 0
    Certified Senior Developer
    in reply to Stefan Helzle

       To add on here the requirement is not just about updating the DB, we have few integrations to perform on each child row then need to update the DB that's the reason I went through that approach, if its just updating the DB I think we can directly update the Parent record and all its child records just using one write records smart service as they had one to many relation,

    Only when all the child process perform the integrations and updates the DB only the I need to end the Parent process, what should I do when I use Start process to trigger child processes 

Children