public override void ForceDelete() { //Debug.WriteLine(String.Format("##WF> WorkflowHandlerBase.ForceDelete: {0}, {1}, {2}", Id, WorkflowInstanceGuid, Path)); if (WorkflowStatus == WorkflowStatusEnum.Running) { InstanceManager.Abort(this, WorkflowApplicationAbortReason.StateContentDeleted); } if (Node.Exists(this.Path)) { base.ForceDelete(); } }
private void AbortRelatedWorkflows(Node currentNode, WorkflowApplicationAbortReason reason) { //if (!StorageContext.Search.IsOuterEngineEnabled) IEnumerable <Node> nodes = null; if (RepositoryInstance.ContentQueryIsAllowed) { nodes = Search.ContentQuery.Query(SafeQueries.WorkflowsByRelatedContent, null, currentNode.Id).Nodes; } else { var nodeType = ActiveSchema.NodeTypes["Workflow"]; nodes = ContentRepository.Storage.Search.NodeQuery.QueryNodesByReferenceAndType("RelatedContent", currentNode.Id, nodeType, false).Nodes; } foreach (WorkflowHandlerBase workflow in nodes) { if (workflow.WorkflowStatus == WorkflowStatusEnum.Running && workflow.AbortOnRelatedContentChange) { InstanceManager.Abort(workflow, reason); } } }