protected void doExecute() throws Throwable {
ContinueAsNewWorkflowExecutionParameters cp = continueAsNew.get();
if (cp == null) {
return;
}
StartChildWorkflowExecutionParameters nextParameters = new StartChildWorkflowExecutionParameters();
nextParameters.setInput(cp.getInput());
WorkflowExecution previousWorkflowExecution = tryCatch.getWorkflowExecution();
String workflowId = previousWorkflowExecution.getWorkflowId();
nextParameters.setWorkflowId(workflowId);
StartChildWorkflowExecutionParameters previousParameters = tryCatch.getParameters();
nextParameters.setWorkflowType(previousParameters.getWorkflowType());
long startToClose = cp.getExecutionStartToCloseTimeoutSeconds();
if (startToClose == FlowConstants.NONE) {
startToClose = previousParameters.getExecutionStartToCloseTimeoutSeconds();
}
nextParameters.setExecutionStartToCloseTimeoutSeconds(startToClose);
long taskStartToClose = cp.getTaskStartToCloseTimeoutSeconds();
if (taskStartToClose == FlowConstants.NONE) {
taskStartToClose = previousParameters.getTaskStartToCloseTimeoutSeconds();
}
nextParameters.setTaskStartToCloseTimeoutSeconds(taskStartToClose);
Settable<StartChildWorkflowReply> reply = new Settable<StartChildWorkflowReply>();
startChildWorkflow(nextParameters, reply, result);
}