Ejemplo n.º 1
0
        public async Task <DeploymentEntity> CreateDeploymentAsync(string deploymentId, string tenantId, string bpmnFile)
        {
            using (var dbContextTransaction = Context.Database.BeginTransaction())
            {
                try
                {
                    DeploymentEntity deployment = new DeploymentEntity()
                    {
                        DeploymentId      = deploymentId,
                        DeploymentName    = deploymentId,
                        TenantId          = tenantId,
                        Source            = bpmnFile,
                        UtcDeploymentTime = DateTime.UtcNow
                    };
                    deploymentStore.Create(deployment);
                    await SaveChangesAsync();

                    BpmnNetDefinition bpmnDefinition = new BpmnNetDefinition(bpmnFile);

                    // Set Item Definitions
                    await SaveItemDefintionAsync(deployment.Id, bpmnDefinition.GetAllItemDefinition());

                    //SaveAllProcess
                    await SaveProcessAsync(deployment.Id, bpmnDefinition.GetAllProcess(), tenantId);


                    dbContextTransaction.Commit();
                    return(deployment);
                }
                catch (System.Exception ex)
                {
                    dbContextTransaction.Rollback();
                    throw ex;
                }
            }
        }
Ejemplo n.º 2
0
 public void GetAllProcessTest()
 {
     Assert.IsNotNull(def.GetAllProcess());
 }