I have a Order_list_service that get all orders that I received.
For each order a need to use a signup_service, which return the new user _id.
I then have to use a client_create_service to register the new user to client collection. In this client_create_service a need data from the Order_list_service. To easyly get that for each Order, a need to pass the order index to the signup_service, which call the client_create_service which aldo need the order index from the Order_list_service.
So for Order index1, I call signup_service and then need to pass index1, to the cliente_create_service. This way the next service knows that I am processing the index1 order, etc...
Since Order_list is a loop, several signup_services are call at once...
To avoid that I only call the signup_service at the complete of the Order_list_service.
To garantee that the correct child service receives the correct parameter ( Order.useremail for example) to use it in th signup_service.
Some times it seems not to work.
Is there a way to tell the system to wait till the parent service to finish the service, or the parent service always will trigger the onComplete event when it finishes the service run?
Any ideia ?