Example #1
0
        public async Task 任务转审单人(string bpmnFile)
        {
            var ex = await Record.ExceptionAsync(async() =>
            {
                string sid = Guid.NewGuid().ToString();
                ProcessInstance[] instances = AsyncHelper.RunSync(() => ctx.StartUseFile(bpmnFile, new string[] { sid }));

                Assert.NotNull(instances);
                Assert.True(instances.Count() > 0);

                ITaskController tc = ctx.CreateWorkflowHttpProxy().GetTaskClient();

                var tasks = await tc.MyTasks(sid).ConfigureAwait(false);

                var uid = Guid.NewGuid().ToString();

                TaskModel[] model = await tc.TransferTask(new TransferTaskCmd
                {
                    TaskId      = tasks.List.FirstOrDefault().Id,
                    Assignees   = new string[] { uid },
                    Description = "转审测试"
                }).ConfigureAwait(false);

                tasks = await tc.MyTasks(uid).ConfigureAwait(false);

                await tc.CompleteTask(new CompleteTaskCmd
                {
                    TaskId = tasks.List.First().Id
                }).ConfigureAwait(false);

                tasks = await tc.MyTasks(uid).ConfigureAwait(false);
            });

            Assert.Null(ex);
        }