c# 异步方法

2021-06-20 01:06

阅读:345

标签:ova   conf   lse   user   tap   not   var   inf   new   

private async void DynamicWorkflowAsyncCallBack()
        {
            await System.Threading.Tasks.Task.Run(() =>
            {
                if (string.IsNullOrEmpty(nodeName) || nodeName == CurrentWorkItem.Name)
                {
                    Thread.Sleep(2000);
                }
                var actionDomain = AutofacContainer.Resolver.Resolve();
                var action = actionDomain.GetByTaskId(Task.TaskId);
                if (action == null || action.ActionName == "撤回")
                    return;
                var workflowNodeConfigInfoDal = AutofacContainer.Resolver.Resolve();
                var node = workflowNodeConfigInfoDal.Find(Instance.WorkflowName, CurrentWorkItem.Name);
                if (node == null || !node.ShouldCallback || string.IsNullOrEmpty(node?.CallbackUrl))
                    return;
                var approveInfo = CallbackHelper.GetApproveInfo(Instance.RecordId);
                DynamicWorkflowCallBackRequest request = new DynamicWorkflowCallBackRequest();
                request.CallbackUrl = node.CallbackUrl;
                request.RecordId = Instance.RecordId.ToString();
                request.ApprovalResults = action.ActionName != "驳回";
                request.Approver = approveInfo.ApproveUser;
                request.NodeName = node.NodeName;
                request.NodeDisplayName = node.NodeDisplayName;
                request.NextNodeName = nodeName;
                request.NextNodeDisplayName = nodeDisplayName;
                Callback(request);
                if (node.IsGaea)
                {
                    Callback(request);
                }
                else
                {
                    CallbackForNotGaea(request);
                }
            });
        }

 

c# 异步方法

标签:ova   conf   lse   user   tap   not   var   inf   new   

原文地址:https://www.cnblogs.com/xuguanghui/p/10270662.html


评论


亲,登录后才可以留言!