Пример #1
0
        protected internal virtual IList <MigrationInstruction> generateInstructions(CommandContext commandContext, ProcessDefinitionImpl sourceProcessDefinition, ProcessDefinitionImpl targetProcessDefinition, bool updateEventTriggers)
        {
            ProcessEngineConfigurationImpl processEngineConfiguration = commandContext.ProcessEngineConfiguration;

            // generate instructions
            MigrationInstructionGenerator   migrationInstructionGenerator = processEngineConfiguration.MigrationInstructionGenerator;
            ValidatingMigrationInstructions generatedInstructions         = migrationInstructionGenerator.generate(sourceProcessDefinition, targetProcessDefinition, updateEventTriggers);

            // filter only valid instructions
            generatedInstructions.filterWith(processEngineConfiguration.MigrationInstructionValidators);

            return(generatedInstructions.asMigrationInstructions());
        }
Пример #2
0
        public virtual void generate(ScopeImpl sourceScope, ScopeImpl targetScope, ProcessDefinitionImpl sourceProcessDefinition, ProcessDefinitionImpl targetProcessDefinition, ValidatingMigrationInstructions existingInstructions, bool updateEventTriggers)
        {
            IList <ValidatingMigrationInstruction> flowScopeInstructions = generateInstructionsForActivities(sourceScope.Activities, targetScope.Activities, updateEventTriggers, existingInstructions);

            existingInstructions.addAll(flowScopeInstructions);

            IList <ValidatingMigrationInstruction> eventScopeInstructions = generateInstructionsForActivities(sourceScope.EventActivities, targetScope.EventActivities, updateEventTriggers, existingInstructions);

            existingInstructions.addAll(eventScopeInstructions);

            existingInstructions.filterWith(migrationInstructionValidators_Renamed);

            foreach (ValidatingMigrationInstruction generatedInstruction in flowScopeInstructions)
            {
                if (existingInstructions.contains(generatedInstruction))
                {
                    generate(generatedInstruction.SourceActivity, generatedInstruction.TargetActivity, sourceProcessDefinition, targetProcessDefinition, existingInstructions, updateEventTriggers);
                }
            }
        }