title: Dynamics CRM Custom Workflow plugin - read the "start when" context?
body: <p>When creating a custom workflow plugin it is possible to run the process at various "Start when" conditions. AKA:</p>
  
  <ul>
  <li>Record is created</li>
  <li>Record status changes</li>
  <li>Record is assigned</li>
  <li>Record fields changed</li>
  <li>Record is deleted</li>
  </ul>
  
  <p>Is it possible to retrieve in code what the "start when" value is? For example I have one process that runs on the "Record created", but if a record is deleted ie. "Record is deleted" I would like to run the same plugin, identify that in code and then take a different path. For instance something like:</p>
  
  <pre><code>if (context.StartWhen == "Created")
  {
     //Do abc
  }
  
  if (context.StartWhen == "Deleted")
  
  {
      //Do xyz
  }
  </code></pre>
  
  <p>I had a look at the IExecutionContext (<a href="https://msdn.microsoft.com/en-us/library/microsoft.xrm.sdk.iexecutioncontext_properties.aspx" rel="nofollow noreferrer">https://msdn.microsoft.com/en-us/library/microsoft.xrm.sdk.iexecutioncontext_properties.aspx</a>) but nothing stands out?</p>