@Override
public Promise<String> scheduleActivityTask(final ExecuteActivityParameters parameters) {
final ActivityType activityType = parameters.getActivityType();
final Settable<String> result = new Settable<String>();
final ActivityTask activityTask = new ActivityTask();
String activityId = parameters.getActivityId();
if (activityId == null) {
activityId = decisionContextProvider.getDecisionContext().getWorkflowClient().generateUniqueId();
}
activityTask.setActivityId(activityId);
activityTask.setActivityType(activityType);
activityTask.setInput(parameters.getInput());
activityTask.setStartedEventId(0L);
activityTask.setTaskToken("dummyTaskToken");
DecisionContext decisionContext = decisionContextProvider.getDecisionContext();
final WorkflowExecution workflowExecution = decisionContext.getWorkflowContext().getWorkflowExecution();
activityTask.setWorkflowExecution(workflowExecution);
String taskList = parameters.getTaskList();
if (taskList == null) {
ActivityTypeRegistrationOptions ro = registrationOptions.get(activityType);
if (ro == null) {
String cause = ScheduleActivityTaskFailedCause.ACTIVITY_TYPE_DOES_NOT_EXIST.toString();