locked
onWorkflowItemDeleted - delete workflow on item deleted RRS feed

  • Question

  • Hi,

    Our SharePoint site uses a special template, and even if I delete an item, I can see that the counter of running workflows stays the same (not the case when the workflow is completed).

    The strange thing is the workflow is correctly deleted in my development environment, not in production.

    So I added a event Driven (State machine workflow) and a onWorkflowItemDeleted.

            private void onWorkflowItemDeleted_Invoked(object sender, ExternalDataEventArgs e)
            {
                try
                {
                    SPWorkflowManager.CancelWorkflow(workflowProperties.Workflow);
                }
                catch (Exception ex)
                {
                    LogComment(ex.ToString());
                }
            }

    but it still does not delete the workflow...

    What should be a fix?

    Wednesday, July 3, 2013 2:14 PM