コード例 #1
0
ファイル: FileTaskManager.cs プロジェクト: visi/ipmessagernet
        /// <summary>
        /// 取消接收任务
        /// </summary>
        /// <param name="packageId">包编号</param>
        /// <param name="index">索引</param>
        public void CancelReceiveTask(ulong packageId, int index)
        {
            FileTaskInfo task = ReceiveTask.Find(s => s.PackageID == packageId);

            if (task == null || task.CancelPadding)
            {
                return;
            }

            Action <FileTaskItem> itemMarker = s =>
            {
                if (s.State == FileTaskItemState.Canceled || s.State == FileTaskItemState.Failure || s.State == FileTaskItemState.Finished)
                {
                    return;
                }
                MarkReceiveTaskItemState(s, FileTaskItemState.Canceling);
            };

            if (index == -1)
            {
                //全部取消
                activeReceiveItems.Where(s => s.TaskInfo == task).ToList().ForEach(itemMarker);
                task.TaskList.ForEach(itemMarker);
            }
            else if (index < task.TaskList.Count)
            {
                itemMarker(task.TaskList[index]);
            }
            task.CancelPadding = true;
        }
コード例 #2
0
        protected internal override BaseElement ConvertXMLToElement(XMLStreamReader xtr, BpmnModel model)
        {
            ReceiveTask receiveTask = new ReceiveTask();

            BpmnXMLUtil.AddXMLLocation(receiveTask, xtr);
            ParseChildElements(XMLElementName, receiveTask, model, xtr);
            return(receiveTask);
        }
コード例 #3
0
ファイル: BpmnFactory.cs プロジェクト: windischb/BPMNUtils
        public virtual ReceiveTask CreateReceiveTask()
        {
            var task = new ReceiveTask();

            //task.Tag = new ReceiveTaskActivityBehavior();

            return(task);
        }
コード例 #4
0
ファイル: ReceiveTask.cs プロジェクト: zhangzihan/nactivity
        public override BaseElement Clone()
        {
            ReceiveTask clone = new ReceiveTask
            {
                Values = this
            };

            return(clone);
        }
コード例 #5
0
 internal void ResponseCompleted(ILog log)
 {
     if (Request is UnknownRequest)
     {
         log.Info(() => LogEvent.Create($"Received {ResponseBytes.Count + Protocol.Request.CorrelationSize} bytes (id {Context.CorrelationId})"));
         return;
     }
     log.Info(() => LogEvent.Create($"Received {ApiKey} response (id {Context.CorrelationId}, {ResponseBytes.Count + Protocol.Request.CorrelationSize} bytes)"));
     if (!ReceiveTask.TrySetResult(ResponseBytes))
     {
         log.Debug(() => {
             var result = ApiKey.ToResponse(Context, ResponseBytes);
             return(LogEvent.Create($"Timed out -----> (timed out or otherwise errored in client) {{Context:{Context},\n{ApiKey}Response:{result}}}"));
         });
     }
 }
コード例 #6
0
 protected internal AbstractReceiveTaskBuilder(BpmnModelInstance modelInstance, ReceiveTask element, Type selfType) : base(modelInstance, element, selfType)
 {
 }
コード例 #7
0
 public virtual ReceiveTaskActivityBehavior CreateReceiveTaskActivityBehavior(ReceiveTask receiveTask)
 {
     return(new ReceiveTaskActivityBehavior());
 }