I want to trigger child workflows from one workflow(parent). Basically this would happen in a loop in the decider
@Workflow
@WorkflowRegistrationOptions(defaultExecutionStartToCloseTimeoutSeconds = 240,
defaultTaskStartToCloseTimeoutSeconds = 60)
public interface W1{
@Execute(version = "1.0")
void fn();
}
public class W1Impl implements W1{
ChildClientFactory factory = new ChildClientFactoryImpl();
@Override
public void fn() {
int i;
/*
I'll call activity1 that returns me a list(size = n)
I trigger n child worflows(Each takes the content in the list and operates)
*/
for(i = 0; i < n; i++) {
ChildClient childWorkflowClient = factory.getClient();
childWorkflowClient.someMethod(params);//TRIGGERING CHILD WORKFLOW
}
}
}
The parent workflow need not wait for the child workflows to finish. i.e) the child workflows will do some processing based on the input to them and will put the result in a persistance store. So I'm not returning a promise
from the child workflows.
Note: Child workflow's decider return type is void
.
The ChildPolicy
option on WorkflowRegistrationOptions
has the option ABANDON
From the docs:
ABANDON: Amazon SWF will take no action; the child executions will continue to run.
Questions:
- When I don't return any Promise from the child workflow, will the parent workflow finish after triggering all child workflows?
i.e) after triggering n
child workflows the parent must finish execution. The child will continue to run. (since i've specified ChildPolicy.ABANDON
). Is this correct?
- The
defaultExecutionStartToClosetimeoutSeconds
of parent need not consider(include) the timeout of the child workflows , right?
3.Are there any constraints on the rate at which child workflows are triggered? (Since I trigger workflows from a loop)
And is there anything that I need to take care of?
Thanks..
Aucun commentaire:
Enregistrer un commentaire