Abort() public static method

public static Abort ( WorkflowHandlerBase workflowInstance, WorkflowApplicationAbortReason reason ) : void
workflowInstance WorkflowHandlerBase
reason WorkflowApplicationAbortReason
return void
Exemplo n.º 1
0
 public override void ForceDelete()
 {
     if (WorkflowStatus == WorkflowStatusEnum.Running)
     {
         InstanceManager.Abort(this, WorkflowApplicationAbortReason.StateContentDeleted);
     }
     base.ForceDelete();
 }
Exemplo n.º 2
0
 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();
     }
 }
Exemplo n.º 3
0
 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();
     }
 }
Exemplo n.º 4
0
        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);
                }
            }
        }
Exemplo n.º 5
0
        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);
                }
            }
        }