コード例 #1
0
        public static MigrationPlan toMigrationPlan(ProcessEngine processEngine, MigrationPlanDto migrationPlanDto)
        {
            MigrationPlanBuilder migrationPlanBuilder = processEngine.RuntimeService.createMigrationPlan(migrationPlanDto.SourceProcessDefinitionId, migrationPlanDto.TargetProcessDefinitionId);

            if (migrationPlanDto.Instructions != null)
            {
                foreach (MigrationInstructionDto migrationInstructionDto in migrationPlanDto.Instructions)
                {
                    MigrationInstructionBuilder migrationInstructionBuilder = migrationPlanBuilder.mapActivities(migrationInstructionDto.SourceActivityIds[0], migrationInstructionDto.TargetActivityIds[0]);
                    if (true.Equals(migrationInstructionDto.UpdateEventTrigger))
                    {
                        migrationInstructionBuilder = migrationInstructionBuilder.updateEventTrigger();
                    }

                    migrationPlanBuilder = migrationInstructionBuilder;
                }
            }

            return(migrationPlanBuilder.build());
        }
コード例 #2
0
        public static MigrationPlanDto from(MigrationPlan migrationPlan)
        {
            MigrationPlanDto dto = new MigrationPlanDto();

            dto.SourceProcessDefinitionId = migrationPlan.SourceProcessDefinitionId;
            dto.TargetProcessDefinitionId = migrationPlan.TargetProcessDefinitionId;

            List <MigrationInstructionDto> instructionDtos = new List <MigrationInstructionDto>();

            if (migrationPlan.Instructions != null)
            {
                foreach (MigrationInstruction migrationInstruction in migrationPlan.Instructions)
                {
                    MigrationInstructionDto migrationInstructionDto = MigrationInstructionDto.from(migrationInstruction);
                    instructionDtos.Add(migrationInstructionDto);
                }
            }
            dto.Instructions = instructionDtos;

            return(dto);
        }