Exemplo n.º 1
0
        protected internal virtual BatchEntity createBatch(CommandContext commandContext, IList <string> ids)
        {
            ProcessEngineConfigurationImpl processEngineConfiguration = commandContext.ProcessEngineConfiguration;
            BatchJobHandler batchJobHandler = getBatchJobHandler(processEngineConfiguration);

            BatchConfiguration configuration = getAbstractIdsBatchConfiguration(ids);

            BatchEntity batch = new BatchEntity();

            batch.Type                   = batchJobHandler.Type;
            batch.TotalJobs              = BatchUtil.calculateBatchSize(processEngineConfiguration, configuration);
            batch.BatchJobsPerSeed       = processEngineConfiguration.BatchJobsPerSeed;
            batch.InvocationsPerBatchJob = processEngineConfiguration.InvocationsPerBatchJob;
            batch.ConfigurationBytes     = batchJobHandler.writeConfiguration(configuration);
            commandContext.BatchManager.insertBatch(batch);

            return(batch);
        }
Exemplo n.º 2
0
        protected internal virtual BatchEntity createBatch(CommandContext commandContext, ICollection <string> processInstanceIds)
        {
            ProcessEngineConfigurationImpl processEngineConfiguration      = commandContext.ProcessEngineConfiguration;
            BatchJobHandler <SetRetriesBatchConfiguration> batchJobHandler = getBatchJobHandler(processEngineConfiguration);

            SetRetriesBatchConfiguration configuration = new SetRetriesBatchConfiguration(new List <string>(processInstanceIds), builder.Retries);

            BatchEntity batch = new BatchEntity();

            batch.Type                   = batchJobHandler.Type;
            batch.TotalJobs              = BatchUtil.calculateBatchSize(processEngineConfiguration, configuration);
            batch.BatchJobsPerSeed       = processEngineConfiguration.BatchJobsPerSeed;
            batch.InvocationsPerBatchJob = processEngineConfiguration.InvocationsPerBatchJob;
            batch.ConfigurationBytes     = batchJobHandler.writeConfiguration(configuration);
            commandContext.BatchManager.insertBatch(batch);

            return(batch);
        }
Exemplo n.º 3
0
        protected internal virtual BatchEntity createBatch(CommandContext commandContext, IList <AbstractProcessInstanceModificationCommand> instructions, IList <string> processInstanceIds, ProcessDefinitionEntity processDefinition)
        {
            ProcessEngineConfigurationImpl processEngineConfiguration = commandContext.ProcessEngineConfiguration;
            BatchJobHandler <RestartProcessInstancesBatchConfiguration> batchJobHandler = getBatchJobHandler(processEngineConfiguration);

            RestartProcessInstancesBatchConfiguration configuration = new RestartProcessInstancesBatchConfiguration(processInstanceIds, instructions, builder.ProcessDefinitionId, builder.InitialVariables, builder.SkipCustomListeners, builder.SkipIoMappings, builder.WithoutBusinessKey);

            BatchEntity batch = new BatchEntity();

            batch.Type                   = batchJobHandler.Type;
            batch.TotalJobs              = BatchUtil.calculateBatchSize(processEngineConfiguration, configuration);
            batch.BatchJobsPerSeed       = processEngineConfiguration.BatchJobsPerSeed;
            batch.InvocationsPerBatchJob = processEngineConfiguration.InvocationsPerBatchJob;
            batch.ConfigurationBytes     = batchJobHandler.writeConfiguration(configuration);
            batch.TenantId               = processDefinition.TenantId;
            commandContext.BatchManager.insertBatch(batch);

            return(batch);
        }
Exemplo n.º 4
0
        protected internal virtual BatchEntity createBatch(CommandContext commandContext, MigrationPlan migrationPlan, ICollection <string> processInstanceIds, ProcessDefinitionEntity sourceProcessDefinition)
        {
            ProcessEngineConfigurationImpl processEngineConfiguration     = commandContext.ProcessEngineConfiguration;
            BatchJobHandler <MigrationBatchConfiguration> batchJobHandler = getBatchJobHandler(processEngineConfiguration);

            MigrationBatchConfiguration configuration = new MigrationBatchConfiguration(new List <string>(processInstanceIds), migrationPlan, executionBuilder.SkipCustomListeners, executionBuilder.SkipIoMappings);

            BatchEntity batch = new BatchEntity();

            batch.Type                   = batchJobHandler.Type;
            batch.TotalJobs              = BatchUtil.calculateBatchSize(processEngineConfiguration, configuration);
            batch.BatchJobsPerSeed       = processEngineConfiguration.BatchJobsPerSeed;
            batch.InvocationsPerBatchJob = processEngineConfiguration.InvocationsPerBatchJob;
            batch.ConfigurationBytes     = batchJobHandler.writeConfiguration(configuration);
            batch.TenantId               = sourceProcessDefinition.TenantId;
            commandContext.BatchManager.insertBatch(batch);

            return(batch);
        }