<commit_before>/* Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 * 
 *      http://www.apache.org/licenses/LICENSE-2.0
 * 
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */
package org.flowable.spring.boot;

import java.time.Duration;
import java.util.Arrays;
import java.util.List;

import org.flowable.common.engine.impl.history.HistoryLevel;
import org.springframework.boot.context.properties.ConfigurationProperties;
import org.springframework.boot.context.properties.DeprecatedConfigurationProperty;

/**
 * @author <NAME>
 * @author <NAME>
 * @author <NAME>
 */
@ConfigurationProperties(prefix = "flowable")
public class FlowableProperties {

    /**
     * Whether process definitions need to be auto deployed.
     */
    private boolean checkProcessDefinitions = true;

    /**
     * Whether the async executor should be activated.
     */
    private boolean asyncExecutorActivate = true;
    
    /**
     * Whether the async history executor should be activated.
     */
    private boolean asyncHistoryExecutorActivate = true;
    
    private boolean restApiEnabled;
    
    private String activityFontName = "Arial";
    
    private String labelFontName = "Arial";
    
    private String annotationFontName = "Arial";

    /**
     * The name of the auto deployment.
     */
    private String deploymentName = "SpringBootAutoDeployment";

    /**
     * The strategy that should be used for the database schema.
     */
    private String databaseSchemaUpdate = "true";

    /**
     * In some situations you want to set the schema to use for table checks / generation if the database metadata doesn't return that correctly.
     */
    private String databaseSchema;

    /**
     * Whether to use a lock when performing the database schema create or update operations.
     */
    private boolean useLockForDatabaseSchemaUpdate = false;

    /**
     * @deprecated use {@link org.flowable.spring.boot.idm.FlowableIdmProperties#isEnabled}
     */
    @Deprecated
    private boolean isDbIdentityUsed = true;

    /**
     * Whether db history should be used.
     */
    private boolean isDbHistoryUsed = true;

    /**
     * The history level that needs to be used.
     */
    private HistoryLevel historyLevel = HistoryLevel.AUDIT;

    /**
     * The folder in which processes need to be searched for auto deployment.
     */
    private String processDefinitionLocationPrefix = "classpath*:/processes/";

    /**
     * The suffixes (extensions) of the files that needs to be deployed from the 'processDefinitionLocationPrefix' location.
     */
    private List<String> processDefinitionLocationSuffixes = Arrays.asList("**.bpmn20.xml", "**.bpmn");
    private boolean jpaEnabled = true; // true by default

    /**
     * The FQN of custom Mybatis mappers that need to be added to the engine.
     */
    private List<String> customMybatisMappers;

    /**
     * The location of the custom Mybatis XML Mappers that need to be added to the engine.
     */
    private List<String> customMybatisXMLMappers;

    /**
     * Enable form field validation after form submission on the engine level
     */
    protected boolean formFieldValidationEnabled = false;

    /**
     * Duration between the checks when acquiring a lock.
     */
    private Duration lockPollRate = Duration.ofSeconds(10);

    /**
     * Duration to wait for the DB Schema lock before giving up.
     */
    private Duration schemaLockWaitTime = Duration.ofMinutes(5);

    private boolean enableHistoryCleaning = false;
    private String historyCleaningCycle = "0 0 1 * * ?";
    private Duration historyCleaningAfter = Duration.ofDays(365);
    private int historyCleaningBatchSize = 100;
    private boolean historyCleaningSequential = false;

    public boolean isAsyncExecutorActivate() {
        return asyncExecutorActivate;<commit_msg>Mark the history cleaning after in the FlowableProperties with a Days DurationUnit<commit_after>/* Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 * 
 *      http://www.apache.org/licenses/LICENSE-2.0
 * 
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */
package org.flowable.spring.boot;

import java.time.Duration;
import java.time.temporal.ChronoUnit;
import java.util.Arrays;
import java.util.List;

import org.flowable.common.engine.impl.history.HistoryLevel;
import org.springframework.boot.context.properties.ConfigurationProperties;
import org.springframework.boot.context.properties.DeprecatedConfigurationProperty;
import org.springframework.boot.convert.DurationUnit;

/**
 * @author <NAME>
 * @author <NAME>
 * @author <NAME>
 */
@ConfigurationProperties(prefix = "flowable")
public class FlowableProperties {

    /**
     * Whether process definitions need to be auto deployed.
     */
    private boolean checkProcessDefinitions = true;

    /**
     * Whether the async executor should be activated.
     */
    private boolean asyncExecutorActivate = true;
    
    /**
     * Whether the async history executor should be activated.
     */
    private boolean asyncHistoryExecutorActivate = true;
    
    private boolean restApiEnabled;
    
    private String activityFontName = "Arial";
    
    private String labelFontName = "Arial";
    
    private String annotationFontName = "Arial";

    /**
     * The name of the auto deployment.
     */
    private String deploymentName = "SpringBootAutoDeployment";

    /**
     * The strategy that should be used for the database schema.
     */
    private String databaseSchemaUpdate = "true";

    /**
     * In some situations you want to set the schema to use for table checks / generation if the database metadata doesn't return that correctly.
     */
    private String databaseSchema;

    /**
     * Whether to use a lock when performing the database schema create or update operations.
     */
    private boolean useLockForDatabaseSchemaUpdate = false;

    /**
     * @deprecated use {@link org.flowable.spring.boot.idm.FlowableIdmProperties#isEnabled}
     */
    @Deprecated
    private boolean isDbIdentityUsed = true;

    /**
     * Whether db history should be used.
     */
    private boolean isDbHistoryUsed = true;

    /**
     * The history level that needs to be used.
     */
    private HistoryLevel historyLevel = HistoryLevel.AUDIT;

    /**
     * The folder in which processes need to be searched for auto deployment.
     */
    private String processDefinitionLocationPrefix = "classpath*:/processes/";

    /**
     * The suffixes (extensions) of the files that needs to be deployed from the 'processDefinitionLocationPrefix' location.
     */
    private List<String> processDefinitionLocationSuffixes = Arrays.asList("**.bpmn20.xml", "**.bpmn");
    private boolean jpaEnabled = true; // true by default

    /**
     * The FQN of custom Mybatis mappers that need to be added to the engine.
     */
    private List<String> customMybatisMappers;

    /**
     * The location of the custom Mybatis XML Mappers that need to be added to the engine.
     */
    private List<String> customMybatisXMLMappers;

    /**
     * Enable form field validation after form submission on the engine level
     */
    protected boolean formFieldValidationEnabled = false;

    /**
     * Duration between the checks when acquiring a lock.
     */
    private Duration lockPollRate = Duration.ofSeconds(10);

    /**
     * Duration to wait for the DB Schema lock before giving up.
     */
    private Duration schemaLockWaitTime = Duration.ofMinutes(5);

    private boolean enableHistoryCleaning = false;
    private String historyCleaningCycle = "0 0 1 * * ?";
    @DurationUnit(ChronoUnit.DAYS)
    private Duration historyCleaningAfter = Duration.ofDays(365);
    private int historyCleaningBatchSize = 100;
    private boolean historyCleaningSequential = false;

    public boolean isAsyncExecutorActivate() {
        return asyncExecutorActivate;
{'fraction_non_alphanumeric': 0.07948010121923166, 'fraction_numerical': 0.004140786749482402, 'mean_word_length': 3.1385054735840074, 'pattern_counts': {'":': 0, '<': 15, '<?xml version=': 0, '>': 15, 'https://': 0, 'lorem ipsum': 0, 'www.': 2, 'xml': 2}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '4633842', 'n_tokens_mistral': 2268, 'n_tokens_neox': 2181, 'n_words': 817}