Пример #1
0
        public virtual MigrationPlanDto generateMigrationPlan(MigrationPlanGenerationDto generationDto)
        {
            RuntimeService runtimeService = processEngine.RuntimeService;

            string sourceProcessDefinitionId = generationDto.SourceProcessDefinitionId;
            string targetProcessDefinitionId = generationDto.TargetProcessDefinitionId;

            try
            {
                MigrationInstructionsBuilder instructionsBuilder = runtimeService.createMigrationPlan(sourceProcessDefinitionId, targetProcessDefinitionId).mapEqualActivities();

                if (generationDto.UpdateEventTriggers)
                {
                    instructionsBuilder = instructionsBuilder.updateEventTriggers();
                }

                MigrationPlan migrationPlan = instructionsBuilder.build();

                return(MigrationPlanDto.from(migrationPlan));
            }
            catch (BadUserRequestException e)
            {
                throw new InvalidRequestException(Status.BAD_REQUEST, e, e.Message);
            }
        }
Пример #2
0
 public virtual MigrationPlanReportDto validateMigrationPlan(MigrationPlanDto migrationPlanDto)
 {
     try
     {
         createMigrationPlan(migrationPlanDto);
         // return an empty report if not errors are found
         return(MigrationPlanReportDto.emptyReport());
     }
     catch (MigrationPlanValidationException e)
     {
         return(MigrationPlanReportDto.form(e.ValidationReport));
     }
 }
Пример #3
0
 protected internal virtual MigrationPlan createMigrationPlan(MigrationPlanDto migrationPlanDto)
 {
     try
     {
         return(MigrationPlanDto.toMigrationPlan(processEngine, migrationPlanDto));
     }
     catch (MigrationPlanValidationException e)
     {
         throw e;
     }
     catch (BadUserRequestException e)
     {
         throw new InvalidRequestException(Status.BAD_REQUEST, e, e.Message);
     }
 }