}
@Override
public Promise<Void> signalWorkflowExecution(final SignalExternalWorkflowParameters parameters) {
final OpenRequestInfo<Void, Void> context = new OpenRequestInfo<Void, Void>();
final SignalExternalWorkflowExecutionDecisionAttributes attributes = new SignalExternalWorkflowExecutionDecisionAttributes();
String signalId = decisions.getNextId();
attributes.setControl(signalId);
attributes.setSignalName(parameters.getSignalName());
attributes.setInput(parameters.getInput());
attributes.setRunId(parameters.getRunId());
attributes.setWorkflowId(parameters.getWorkflowId());
String taskName = "signalId=" + signalId + ", workflowId=" + parameters.getWorkflowId() + ", workflowRunId="
+ parameters.getRunId();
new ExternalTask() {
@Override
protected ExternalTaskCancellationHandler doExecute(final ExternalTaskCompletionHandle handle) throws Throwable {
decisions.signalExternalWorkflowExecution(attributes);
context.setCompletionHandle(handle);
final String finalSignalId = attributes.getControl();
scheduledSignals.put(finalSignalId, context);
return new ExternalTaskCancellationHandler() {
@Override
public void handleCancellation(Throwable cause) {