public Task <Deployment> Draft(string tenantId, string name) { IDeploymentQuery query = this.repositoryService.CreateDeploymentQuery(); IList <IDeployment> defs = query.SetDeploymentName(name) .SetDeploymentTenantId(tenantId) .FindDrafts(); if (defs.Count > 1) { throw new Exception(); } return(Task.FromResult <Deployment>(defs?.Count == 0 ? null : deploymentConverter.From(defs[0]))); }
public Task <string> GetProcessModel(DeploymentQuery queryObj) { if (queryObj == null) { throw new ArgumentNullException("queryObj"); } IDeploymentQuery query = this.repositoryService.CreateDeploymentQuery(); IList <IDeployment> defs = query.SetDeploymentName(queryObj.Name) .SetDeploymentTenantId(queryObj.TenantId) .FindDrafts(); if (defs.Count != 1) { throw new ActivitiException("找到不止一个草稿"); } return(GetProcessModel(defs[0].Id)); }