예제 #1
0
        public override EverLivingJobEntity reconfigure(HistoryCleanupContext context, EverLivingJobEntity job)
        {
            HistoryCleanupJobHandlerConfiguration configuration = resolveJobHandlerConfiguration(context);

            job.JobHandlerConfiguration = configuration;
            return(job);
        }
예제 #2
0
 public HistoryCleanupSchedulerCmd(bool isRescheduleNow, IDictionary <string, long> reports, HistoryCleanupJobHandlerConfiguration configuration, string jobId)
 {
     this.isRescheduleNow = isRescheduleNow;
     this.configuration   = configuration;
     this.jobId           = jobId;
     this.reports         = reports;
 }
예제 #3
0
        protected internal override HistoryCleanupJobHandlerConfiguration resolveJobHandlerConfiguration(HistoryCleanupContext context)
        {
            HistoryCleanupJobHandlerConfiguration config = new HistoryCleanupJobHandlerConfiguration();

            config.ImmediatelyDue = context.ImmediatelyDue;
            config.MinuteFrom     = context.MinuteFrom;
            config.MinuteTo       = context.MinuteTo;
            return(config);
        }
예제 #4
0
        /// <summary>
        /// Creates next batch object for history cleanup. First searches for historic process instances ready for cleanup. If there is still some place left in batch (configured batch
        /// size was not reached), searches for historic decision instances and also adds them to the batch. Then if there is still some place left in batch, searches for historic case
        /// instances and historic batches - and adds them to the batch.
        /// </summary>
        /// <param name="commandContext">
        /// @return </param>
        public static void prepareNextBatch(HistoryCleanupBatch historyCleanupBatch, CommandContext commandContext)
        {
//JAVA TO C# CONVERTER WARNING: The original Java variable was marked 'final':
//ORIGINAL LINE: final HistoryCleanupJobHandlerConfiguration configuration = historyCleanupBatch.getConfiguration();
            HistoryCleanupJobHandlerConfiguration configuration = historyCleanupBatch.Configuration;
//JAVA TO C# CONVERTER WARNING: The original Java variable was marked 'final':
//ORIGINAL LINE: final System.Nullable<int> batchSize = getHistoryCleanupBatchSize(commandContext);
            int?batchSize = getHistoryCleanupBatchSize(commandContext);
            ProcessEngineConfigurationImpl processEngineConfiguration = commandContext.ProcessEngineConfiguration;

            //add process instance ids
//JAVA TO C# CONVERTER WARNING: The original Java variable was marked 'final':
//ORIGINAL LINE: final java.util.List<String> historicProcessInstanceIds = commandContext.getHistoricProcessInstanceManager().findHistoricProcessInstanceIdsForCleanup(batchSize, configuration.getMinuteFrom(), configuration.getMinuteTo());
            IList <string> historicProcessInstanceIds = commandContext.HistoricProcessInstanceManager.findHistoricProcessInstanceIdsForCleanup(batchSize, configuration.MinuteFrom, configuration.MinuteTo);

            if (historicProcessInstanceIds.Count > 0)
            {
                historyCleanupBatch.HistoricProcessInstanceIds = historicProcessInstanceIds;
            }

            //if batch is not full, add decision instance ids
            if (historyCleanupBatch.size() < batchSize.Value && processEngineConfiguration.DmnEnabled)
            {
//JAVA TO C# CONVERTER WARNING: The original Java variable was marked 'final':
//ORIGINAL LINE: final java.util.List<String> historicDecisionInstanceIds = commandContext.getHistoricDecisionInstanceManager().findHistoricDecisionInstanceIdsForCleanup(batchSize - historyCleanupBatch.size(), configuration.getMinuteFrom(), configuration.getMinuteTo());
                IList <string> historicDecisionInstanceIds = commandContext.HistoricDecisionInstanceManager.findHistoricDecisionInstanceIdsForCleanup(batchSize - historyCleanupBatch.size(), configuration.MinuteFrom, configuration.MinuteTo);
                if (historicDecisionInstanceIds.Count > 0)
                {
                    historyCleanupBatch.HistoricDecisionInstanceIds = historicDecisionInstanceIds;
                }
            }

            //if batch is not full, add case instance ids
            if (historyCleanupBatch.size() < batchSize.Value && processEngineConfiguration.CmmnEnabled)
            {
//JAVA TO C# CONVERTER WARNING: The original Java variable was marked 'final':
//ORIGINAL LINE: final java.util.List<String> historicCaseInstanceIds = commandContext.getHistoricCaseInstanceManager().findHistoricCaseInstanceIdsForCleanup(batchSize - historyCleanupBatch.size(), configuration.getMinuteFrom(), configuration.getMinuteTo());
                IList <string> historicCaseInstanceIds = commandContext.HistoricCaseInstanceManager.findHistoricCaseInstanceIdsForCleanup(batchSize - historyCleanupBatch.size(), configuration.MinuteFrom, configuration.MinuteTo);
                if (historicCaseInstanceIds.Count > 0)
                {
                    historyCleanupBatch.HistoricCaseInstanceIds = historicCaseInstanceIds;
                }
            }

            //if batch is not full, add batch ids
            IDictionary <string, int> batchOperationsForHistoryCleanup = processEngineConfiguration.ParsedBatchOperationsForHistoryCleanup;

            if (historyCleanupBatch.size() < batchSize.Value && batchOperationsForHistoryCleanup != null && batchOperationsForHistoryCleanup.Count > 0)
            {
                IList <string> historicBatchIds = commandContext.HistoricBatchManager.findHistoricBatchIdsForCleanup(batchSize - historyCleanupBatch.size(), batchOperationsForHistoryCleanup, configuration.MinuteFrom, configuration.MinuteTo);
                if (historicBatchIds.Count > 0)
                {
                    historyCleanupBatch.HistoricBatchIds = historicBatchIds;
                }
            }
        }
예제 #5
0
        public static HistoryCleanupJobHandlerConfiguration fromJson(JsonObject jsonObject)
        {
            HistoryCleanupJobHandlerConfiguration config = new HistoryCleanupJobHandlerConfiguration();

            if (jsonObject.has(JOB_CONFIG_COUNT_EMPTY_RUNS))
            {
                config.CountEmptyRuns = JsonUtil.getInt(jsonObject, JOB_CONFIG_COUNT_EMPTY_RUNS);
            }
            if (jsonObject.has(JOB_CONFIG_EXECUTE_AT_ONCE))
            {
                config.ImmediatelyDue = JsonUtil.getBoolean(jsonObject, JOB_CONFIG_EXECUTE_AT_ONCE);
            }
            config.MinuteFrom = JsonUtil.getInt(jsonObject, JOB_CONFIG_MINUTE_FROM);
            config.MinuteTo   = JsonUtil.getInt(jsonObject, JOB_CONFIG_MINUTE_TO);
            return(config);
        }
예제 #6
0
 protected internal virtual void cancelCountEmptyRuns(HistoryCleanupJobHandlerConfiguration configuration, JobEntity jobEntity)
 {
     configuration.CountEmptyRuns      = 0;
     jobEntity.JobHandlerConfiguration = configuration;
 }
예제 #7
0
 public virtual HistoryCleanupHandler setConfiguration(HistoryCleanupJobHandlerConfiguration configuration)
 {
     this.configuration = configuration;
     return(this);
 }