public static Abort ( |
||
workflowInstance | ||
reason | WorkflowApplicationAbortReason | |
return | void |
public override void ForceDelete() { if (WorkflowStatus == WorkflowStatusEnum.Running) { InstanceManager.Abort(this, WorkflowApplicationAbortReason.StateContentDeleted); } base.ForceDelete(); }
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(); } }
public override void Delete() { SnTrace.Workflow.Write("WorkflowHandlerBase.Delete: {0}, {1}, {2}", Id, WorkflowInstanceGuid, Path); if (WorkflowStatus == WorkflowStatusEnum.Running) { InstanceManager.Abort(this, WorkflowApplicationAbortReason.StateContentDeleted); } if (!TrashBin.IsInTrash(this)) { base.Delete(); } }
private void AbortRelatedWorkflows(Node currentNode, WorkflowApplicationAbortReason reason) { //TODO: WF: Testing StorageContext.Search.IsOuterEngineEnabled flag hack if (!StorageContext.Search.IsOuterEngineEnabled) { return; } var query = String.Format("+TypeIs:Workflow +RelatedContent:{0} .AUTOFILTERS:OFF", currentNode.Id); var result = SenseNet.Search.ContentQuery.Query(query); foreach (WorkflowHandlerBase workflow in result.Nodes) { if (workflow.WorkflowStatus == WorkflowStatusEnum.Running && workflow.AbortOnRelatedContentChange) { InstanceManager.Abort(workflow, reason); } } }
private void AbortRelatedWorkflows(Node currentNode, WorkflowApplicationAbortReason reason) { IEnumerable <Node> nodes = null; if (SearchManager.ContentQueryIsAllowed) { nodes = ContentQuery.Query(SafeQueries.WorkflowsByRelatedContent, null, currentNode.Id).Nodes; } else { var nodeType = ActiveSchema.NodeTypes["Workflow"]; nodes = NodeQuery.QueryNodesByReferenceAndType("RelatedContent", currentNode.Id, nodeType, false).Nodes; } foreach (WorkflowHandlerBase workflow in nodes) { if (workflow.WorkflowStatus == WorkflowStatusEnum.Running && workflow.AbortOnRelatedContentChange) { InstanceManager.Abort(workflow, reason); } } }