Exemple #1
0
        private async Task StopProductWorkflowAsync(Guid productId, int projectId, ProductTransitionType transitionType)
        {
            // Remove any future transition entries
            await ClearPreExecuteEntries(productId);

            // Remove any tasks
            await RemoveTasksByProductId(productId);

            var workflowDefinition = await GetExecutingWorkflowDefintion(productId);

            await createTransitionRecord(productId, transitionType, workflowDefinition.Type);

            // Delete the ProcessInstance
            DeleteWorkflowProcessInstance(productId, projectId);
        }
Exemple #2
0
 private async Task createTransitionRecord(Guid processId, ProductTransitionType transitionType, WorkflowType workflowType)
 {
     using (var scope = ServiceProvider.CreateScope())
     {
         var productTransitionsRepository = scope.ServiceProvider.GetRequiredService <IJobRepository <ProductTransition> >();
         var transition = new ProductTransition
         {
             ProductId        = processId,
             AllowedUserNames = String.Empty,
             TransitionType   = transitionType,
             WorkflowType     = workflowType,
             DateTransition   = DateTime.UtcNow
         };
         transition = await productTransitionsRepository.CreateAsync(transition);
     }
 }
Exemple #3
0
 public void StopProductWorkflow(Guid productId, int projectId, ProductTransitionType transitionType)
 {
     StopProductWorkflowAsync(productId, projectId, transitionType).Wait();
 }