title: Wait for signal to start activity (amazon Workflow)
body: <p>I have built a workflow using java flow framework provided by AWS. I have created 4 activities. First activity wait for signal to start. Then all the activities execute synchronously using Promise&lt;> object. Workflow implementation code is following-</p>
  
  <pre><code>public class PaginationWorkflowImpl implements PaginationWorkflow 
  {  
  private ManualUploadClient operations0 = new ManualUploadClientImpl();
     private DownloadActivityClient operations1 = new DownloadActivityClientImpl();
     private ConvertActivityClient operations2 = new ConvertActivityClientImpl();
     private UploadActivityClient operations3 = new UploadActivityClientImpl();
     final Settable&lt;String&gt; result = new Settable&lt;String&gt;();
  
     public void paginate() 
     {
       Promise&lt;String&gt; UDone = operations0.Upload(result);
       Promise&lt;String&gt; dnDone = operations1.s3Download(UDone);
       Promise&lt;String&gt; convDone = operations2.pdfToTiff(dnDone);
       operations3.s3Upload(convDone);
     }
  
     @Override
     public void signal1(String data)  {
        // result.set(data);
         //result.Void();
         Promise&lt;String&gt; ready = Promise.asPromise("ready");
         result.chain(ready);
     }
  
  
  }
  </code></pre>
  
  <p>Here activity Upload wait for the object result to be in ready state. So when I signal workflow the method signal1 kicks off and puts the object in ready state.
  But as soon as I signal the workflow, workflow execution get failed.</p>
  
  <p>I am using nodejs aws api to signal workflow. Below is the code for the same-</p>
  
  <pre><code>var AWS = require('aws-sdk');
  AWS.config.update({accessKeyId: '', secretAccessKey: ''});
  AWS.config.update({region: 'us-east-1'});
  
  var swf = new AWS.SWF();
  var params = {
    domain: 'HWdemo2', /* required */
    signalName: 'signal1', /* required */
    workflowId: 'PaginationWorkflow', /* required */
    //input: 'true'
    //runId: 'STRING_VALUE'
  };
  swf.signalWorkflowExecution(params, function(err, data) {
    if (err) console.log(err, err.stack); // an error occurred
    else     console.log(data);           // successful response
  });
  </code></pre>
  
  <p>And the error which I is showing in AWS workflow events console for execution fail is following-</p>
  
  <p><div class="snippet" data-lang="js" data-hide="false">
  <div class="snippet-code">
  <pre class="snippet-code-js lang-js prettyprint-override"><code>["java.util.concurrent.CancellationException", {
    "cause": ["java.lang.NullPointerException", {
      "cause": null,
      "stackTrace": [{
        "methodName": "&lt;init&gt;",
        "fileName": null,
        "lineNumber": -1,
        "className": "java.io.StringReader",
        "nativeMethod": false
      }, {
        "methodName": "createParser",
        "fileName": "JsonFactory.java",
        "lineNumber": 835,
        "className": "com.fasterxml.jackson.core.JsonFactory",
        "nativeMethod": false
      }, {
        "methodName": "readValue",
        "fileName": "ObjectMapper.java",
        "lineNumber": 2098,
        "className": "com.fasterxml.jackson.databind.ObjectMapper",
        "nativeMethod": false
      }, {
        "methodName": "fromData",
        "fileName": "JsonDataConverter.java",
        "lineNumber": 96,
        "className": "com.amazonaws.services.simpleworkflow.flow.JsonDataConverter",
        "nativeMethod": false
      }, {
        "methodName": "signalRecieved",
        "fileName": "POJOWorkflowDefinition.java",
        "lineNumber": 111,
        "className": "com.amazonaws.services.simpleworkflow.flow.pojo.POJOWorkflowDefinition",
        "nativeMethod": false
      }, {
        "methodName": "doExecute",
        "fileName": "AsyncDecider.java",
        "lineNumber": 417,
        "className": "com.amazonaws.services.simpleworkflow.flow.worker.AsyncDecider$1",
        "nativeMethod": false
      }, {
        "methodName": "",
        "fileName": "",
        "lineNumber": 0,
        "className": "--- continuation ---",
        "nativeMethod": false
      }, {
        "methodName": "handleWorkflowExecutionSignaled",
        "fileName": "AsyncDecider.java",
        "lineNumber": 413,
        "className": "com.amazonaws.services.simpleworkflow.flow.worker.AsyncDecider",
        "nativeMethod": false
      }, {
        "methodName": "processEvent",
        "fileName": "AsyncDecider.java",
        "lineNumber": 251,
        "className": "com.amazonaws.services.simpleworkflow.flow.worker.AsyncDecider",
        "nativeMethod": false
      }, {
        "methodName": "decide",
        "fileName": "AsyncDecider.java",
        "lineNumber": 496,
        "className": "com.amazonaws.services.simpleworkflow.flow.worker.AsyncDecider",
        "nativeMethod": false
      }, {
        "methodName": "handleDecisionTask",
        "fileName": "AsyncDecisionTaskHandler.java",
        "lineNumber": 50,
        "className": "com.amazonaws.services.simpleworkflow.flow.worker.AsyncDecisionTaskHandler",
        "nativeMethod": false
      }, {
        "methodName": "pollAndProcessSingleTask",
        "fileName": "DecisionTaskPoller.java",
        "lineNumber": 201,
        "className": "com.amazonaws.services.simpleworkflow.flow.worker.DecisionTaskPoller",
        "nativeMethod": false
      }, {
        "methodName": "run",
        "fileName": "GenericWorker.java",
        "lineNumber": 94,
        "className": "com.amazonaws.services.simpleworkflow.flow.worker.GenericWorker$PollServiceTask",
        "nativeMethod": false
      }, {
        "methodName": "runWorker",
        "fileName": null,
        "lineNumber": -1,
        "className": "java.util.concurrent.ThreadPoolExecutor",
        "nativeMethod": false
      }, {
        "methodName": "run",
        "fileName": null,
        "lineNumber": -1,
        "className": "java.util.concurrent.ThreadPoolExecutor$Worker",
        "nativeMethod": false
      }, {
        "methodName": "run",
        "fileName": null,
        "lineNumber": -1,
        "className": "java.lang.Thread",
        "nativeMethod": false
      }],
      "message": null,
      "localizedMessage": null,
      "suppressed": ["[Ljava.lang.Throwable;", []]
    }],
    "stackTrace": [{
      "methodName": "execute",
      "fileName": "POJOWorkflowDefinition.java",
      "lineNumber": 66,
      "className": "com.amazonaws.services.simpleworkflow.flow.pojo.POJOWorkflowDefinition",
      "nativeMethod": false
    }, {
      "methodName": "doAsync",
      "fileName": "AsyncDecider.java",
      "lineNumber": 70,
      "className": "com.amazonaws.services.simpleworkflow.flow.worker.AsyncDecider$WorkflowExecuteAsyncScope",
      "nativeMethod": false
    }],
    "message": null,
    "localizedMessage": null,
    "suppressed": ["[Ljava.lang.Throwable;", []]
  }]</code></pre>
  </div>
  </div>
  </p>
  
  <p>Can anyone please help me out with this error, Thanks a lot in advance. </p>