Exemplo n.º 1
0
 public static bool IsCatchEvent(ProcessItemType type)
 {
     return
         (IsBoundaryEvent(type) ||
          IsIntermediateCatchEvent(type) ||
          IsStartEvent(type));
 }
Exemplo n.º 2
0
 public static bool IsSubProcess(ProcessItemType type)
 {
     return
         (IsAdHocSubProcess(type) ||
          IsTransaction(type) ||
          type.Equals(ProcessItemType.SubProcess));
 }
Exemplo n.º 3
0
 public static bool IsThrowEvent(ProcessItemType type)
 {
     return
         (IsEndEvent(type) ||
          IsImplicitThrowEvent(type) ||
          IsIntermediateThrowEvent(type));
 }
Exemplo n.º 4
0
 public static bool IsChoreographyActivity(ProcessItemType type)
 {
     return
         (IsCallChoreography(type) ||
          IsChoreographyTask(type) ||
          IsSubChoreography(type));
 }
Exemplo n.º 5
0
 public static bool IsActivity(ProcessItemType type)
 {
     return
         (IsSubProcess(type) ||
          IsTask(type) ||
          IsCallActivity(type));
 }
Exemplo n.º 6
0
 public static bool IsFlowNode(ProcessItemType type)
 {
     return
         (IsActivity(type) ||
          IsEvent(type) ||
          IsChoreographyActivity(type) ||
          IsGateway(type));
 }
Exemplo n.º 7
0
 public static bool IsGateway(ProcessItemType type)
 {
     return
         (IsComplexGateway(type) ||
          IsEventBasedGateway(type) ||
          IsExclusiveGateway(type) ||
          IsInclusiveGateway(type) ||
          IsParallelGateway(type));
 }
Exemplo n.º 8
0
 public static bool IsTask(ProcessItemType type)
 {
     return
         (IsUserTask(type) ||
          IsBusinessRuleTask(type) ||
          IsManualTask(type) ||
          IsReceiveTask(type) ||
          IsScriptTask(type) ||
          IsSendTask(type) ||
          IsServiceTask(type) ||
          type.Equals(ProcessItemType.Task));
 }
Exemplo n.º 9
0
        private async Task ProcessFlowAsync(TInstance instance, string flowId, CancellationToken cancellationToken)
        {
            var instanceFlow = await _instanceStore.GetOrAddInstanceFlowAsync(instance, flowId);

            var flowTask = GetFlowAsync(instance.ProcessId, flowId, cancellationToken);

            if (IsCanProcess(instanceFlow.Status))
            {
                var flow        = await flowTask;
                var executeTask = ExecuteFlowAsync(instance, flow, cancellationToken);
                instanceFlow.ElementType = ProcessItemType.GetItemType(flow);
                instanceFlow.Status      = await executeTask;
                if (instanceFlow.Status == FlowResult.Completed)
                {
                    await ExecuteCompleteAsync(instance, flow, cancellationToken);

                    var next = ProcessNextFlow(instance, flow, cancellationToken);
                    instanceFlow.Finnish  = DateTime.Now;
                    instanceFlow.Duration = (instanceFlow.Finnish.Value - instanceFlow.Start).Milliseconds;
                    await next;
                }
            }
        }
Exemplo n.º 10
0
 public static bool IsEndEvent(ProcessItemType type)
 {
     return(type.Equals(ProcessItemType.EndEvent));
 }
Exemplo n.º 11
0
 public static bool IsAdHocSubProcess(ProcessItemType type)
 {
     return(type == ProcessItemType.AdHocSubProcess);
 }
Exemplo n.º 12
0
 public static bool IsIntermediateThrowEvent(ProcessItemType type)
 {
     return(type.Equals(ProcessItemType.IntermediateThrowEvent));
 }
Exemplo n.º 13
0
 public static bool IsImplicitThrowEvent(ProcessItemType type)
 {
     return(type.Equals(ProcessItemType.ImplicitThrowEvent));
 }
Exemplo n.º 14
0
        public async Task <ProcessTaskEntity> CreateTaskAsync(int processInstanceId, int nodeId, string nodeName, ProcessItemType ItemType)
        {
            if (!ProcessItemCheck.IsTask(ItemType))
            {
                throw new FlowNodeException(nodeName, "Task");
            }
            ProcessTaskEntity task = new ProcessTaskEntity()
            {
                ProcessInstanceId = processInstanceId,
                FlowNodeId        = nodeId,
                TaskId            = nodeName,
                TaskType          = ItemType,
                CreatedBy         = GetUserId()
            };

            TaskStore.Create(task);
            await SaveChangesAsync();

            return(task);

            //TODO Add to history
            //AddHistory(proc.Name, pi.ProcessInstanceName, t.ProcessTaskName, string.Format("User: {0} Created Task '{1}'", user, proc.Name), user);
        }
Exemplo n.º 15
0
 public static bool IsInclusiveGateway(ProcessItemType type)
 {
     return(type.Equals(ProcessItemType.InclusiveGateway));
 }
Exemplo n.º 16
0
 public static bool IsComplexGateway(ProcessItemType type)
 {
     return(type.Equals(ProcessItemType.ComplexGateway));
 }
Exemplo n.º 17
0
        private async Task <FlowNodeEntity> CreateFlowNodeAsync(string flowNodeId, string flowNodeName, ProcessItemType processType, string ProcessId, int?parentFlowId = null)
        {
            FlowNodeEntity flowNode = new FlowNodeEntity()
            {
                FlowNodeId = flowNodeId,
                Name       = flowNodeName,
                ItemType   = processType,
                ParentId   = parentFlowId,
                Processid  = ProcessId
            };

            flowNodeStore.Create(flowNode);
            await SaveChangesAsync();

            return(flowNode);
        }
Exemplo n.º 18
0
 public static bool IsSequenceFlow(ProcessItemType type)
 {
     return(type.Equals(ProcessItemType.SequenceFlow));
 }
Exemplo n.º 19
0
 public static bool IsBoundaryEvent(ProcessItemType type)
 {
     return(type.Equals(ProcessItemType.BoundaryEvent));
 }
Exemplo n.º 20
0
 public static bool IsDataStoreReference(ProcessItemType type)
 {
     return(type.Equals(ProcessItemType.DataStoreReference));
 }
Exemplo n.º 21
0
 public static bool IsDataObject(ProcessItemType type)
 {
     return(type.Equals(ProcessItemType.DataObject));
 }
Exemplo n.º 22
0
 public static bool IsParallelGateway(ProcessItemType type)
 {
     return(type.Equals(ProcessItemType.ParallelGateway));
 }
Exemplo n.º 23
0
 public static bool IsTransaction(ProcessItemType type)
 {
     return(type == ProcessItemType.Transaction);
 }
Exemplo n.º 24
0
 public static bool IsEvent(ProcessItemType type)
 {
     return
         (IsCatchEvent(type) ||
          IsThrowEvent(type));
 }
Exemplo n.º 25
0
 private static bool IsServiceTask(ProcessItemType type)
 {
     return(type.Equals(ProcessItemType.ServiceTask));
 }
Exemplo n.º 26
0
 public static bool IsSubChoreography(ProcessItemType type)
 {
     return(type.Equals(ProcessItemType.SubChoreography));
 }
Exemplo n.º 27
0
 public async Task <TProcessTask> CreateTaskAsync(TKey processInstanceId, TKey nodeId, string nodeName, ProcessItemType ItemType)
 {
     return(await Store.CreateTaskAsync(processInstanceId, nodeId, nodeName, ItemType));
 }
Exemplo n.º 28
0
 public static bool IsChoreographyTask(ProcessItemType type)
 {
     return(type.Equals(ProcessItemType.ChoreographyTask));
 }
Exemplo n.º 29
0
 private bool IsTask(ProcessItemType type)
 {
     return(type == ProcessItemType.UserTask ||
            type == ProcessItemType.ManualTask);
 }
Exemplo n.º 30
0
 public static bool IsEventBasedGateway(ProcessItemType type)
 {
     return(type.Equals(ProcessItemType.EventBasedGateway));
 }