DecisionId decisionId = new DecisionId(DecisionTarget.SELF, null);
addDecision(decisionId, new CompleteWorkflowStateMachine(decisionId, decision));
}
void continueAsNewWorkflowExecution(ContinueAsNewWorkflowExecutionParameters continueParameters) {
ContinueAsNewWorkflowExecutionDecisionAttributes attributes = new ContinueAsNewWorkflowExecutionDecisionAttributes();
attributes.setWorkflowTypeVersion(continueParameters.getWorkflowTypeVersion());
ChildPolicy childPolicy = continueParameters.getChildPolicy();
if (childPolicy != null) {
attributes.setChildPolicy(childPolicy);
}
attributes.setInput(continueParameters.getInput());
attributes.setExecutionStartToCloseTimeout(FlowHelpers.secondsToDuration(continueParameters.getExecutionStartToCloseTimeoutSeconds()));
attributes.setTaskStartToCloseTimeout(FlowHelpers.secondsToDuration(continueParameters.getTaskStartToCloseTimeoutSeconds()));
List<String> tagList = continueParameters.getTagList();
if (tagList != null) {
attributes.setTagList(tagList);
}
String taskList = continueParameters.getTaskList();
if (taskList != null && !taskList.isEmpty()) {
attributes.setTaskList(new TaskList().withName(taskList));
}
Decision decision = new Decision();
decision.setDecisionType(DecisionType.ContinueAsNewWorkflowExecution.toString());
decision.setContinueAsNewWorkflowExecutionDecisionAttributes(attributes);