title: How do I Cancel or Terminate a workflow from within itself
body: <p>I have a workflow that moves files around between ftp sites.
  It can be the case that a user deletes the files from an ftp site while the workflow is about to copy it.  I can detect that the file is gone, so I want to Cancel the workflow about to do the file transfer.</p>
  
  <p>I start my workflows using a factory.  The factory creates a helper class (wfManager) and the helper class starts the actual workflow using WorkflowApplication.</p>
  
  <p>The workflow itself determines if it should Close based on if the file has gone missing.  The workflow has a reference to the wfManager that started it so calls workflowApplication.close from the wfManager</p>
  
  <p>I had thought that if I use WorkflowApplication.close from the wfManager that the workflow would Close.</p>
  
  <p>However, the Close times out.</p>
  
  <p>What would cause the Close to time out and is there a generic way to close or terminate a workflow via code?</p>