/// <summary>
        /// 部署流程
        /// </summary>
        /// <param name="bpmnFile"></param>
        /// <param name="bpmnName"></param>
        /// <returns></returns>
        public async Task <Deployment> DeployAsync(string bpmnFile, string bpmnName = null)
        {
            IProcessDefinitionDeployerController deployerClient = CreateWorkflowHttpProxy().GetDefinitionDeployerClient();

            string depBpmnName = string.IsNullOrWhiteSpace(bpmnName) ? Path.GetFileNameWithoutExtension(bpmnFile) : bpmnName;

            string xml = string.IsNullOrWhiteSpace(bpmnName) ? ReadBpmn(bpmnFile) :
                         ReadBpmn(bpmnFile, bpmnName);

            ProcessDefinitionDeployer deployer = new ProcessDefinitionDeployer
            {
                Name     = depBpmnName,
                BpmnXML  = xml,
                TenantId = TenantId,
                EnableDuplicateFiltering = false
            };

            Deployment deployment = await deployerClient.Deploy(deployer).ConfigureAwait(false);

            var list = await deployerClient.Latest(new DeploymentQuery
            {
                Ids      = new string[] { deployment.Id },
                TenantId = TenantId
            }).ConfigureAwait(false);

            Assert.NotNull(list);
            Assert.True(list.List.Count() == 1);


            return(deployment);
        }
Пример #2
0
        public void Latest_返回最终部署的流程列表()
        {
            var ex = Record.Exception(() =>
            {
                var list = AsyncHelper.RunSync <Resources <Deployment> >(() => client.Latest(new DeploymentQuery
                {
                    TenantId = ctx.TenantId
                }));

                Assert.NotNull(list);
            });

            Assert.Null(ex);
        }
Пример #3
0
        public void Latest_返回最终部署的流程列表()
        {
            var ex = Record.Exception(() =>
            {
                var list = client.Latest(new DeploymentQuery
                {
                    TenantId = ctx.TenantId
                }).GetAwaiter().GetResult();

                Assert.NotNull(list);
            });

            Assert.Null(ex);
        }