Search in sources :

Example 1 with BPMNActivitiConfiguration

use of org.wso2.carbon.bpmn.core.utils.BPMNActivitiConfiguration in project carbon-business-process by wso2.

the class SubstitutionDataHolder method isSubstitutionFeatureEnabled.

/**
 * Get the substitution feature enabled config value or default value
 * @return true if substitution enabled
 */
public boolean isSubstitutionFeatureEnabled() {
    if (substitutionFeatureEnabled == null) {
        substitutionFeatureEnabled = false;
        BPMNActivitiConfiguration activitiConfiguration = BPMNActivitiConfiguration.getInstance();
        if (activitiConfiguration != null) {
            String enabledString = activitiConfiguration.getBPMNPropertyValue(BPMNConstants.SUBSTITUTION_CONFIG, BPMNConstants.SUBSTITUTION_ENABLED);
            if (TRUE.equalsIgnoreCase(enabledString)) {
                substitutionFeatureEnabled = true;
            }
        }
    }
    return substitutionFeatureEnabled;
}
Also used : BPMNActivitiConfiguration(org.wso2.carbon.bpmn.core.utils.BPMNActivitiConfiguration)

Example 2 with BPMNActivitiConfiguration

use of org.wso2.carbon.bpmn.core.utils.BPMNActivitiConfiguration in project carbon-business-process by wso2.

the class UserSubstitutionUtils method getActivationInterval.

/**
 * Return the maximum activation interval for a substitution.
 * @return activation interval in milliseconds
 */
public static long getActivationInterval() {
    long activationInterval = BPMNConstants.DEFAULT_SUBSTITUTION_INTERVAL_IN_MINUTES * 60 * 1000;
    BPMNActivitiConfiguration bpmnActivitiConfiguration = BPMNActivitiConfiguration.getInstance();
    if (bpmnActivitiConfiguration != null) {
        String activationIntervalString = bpmnActivitiConfiguration.getBPMNPropertyValue(BPMNConstants.SUBSTITUTION_CONFIG, BPMNConstants.SUBSTITUTION_SCHEDULER_INTERVAL);
        if (activationIntervalString != null) {
            activationInterval = Long.parseLong(activationIntervalString) * 60 * 1000;
            if (log.isDebugEnabled()) {
                log.debug("Using the substitution activation interval : " + activationIntervalString + " minutes");
            }
        }
    }
    return activationInterval;
}
Also used : BPMNActivitiConfiguration(org.wso2.carbon.bpmn.core.utils.BPMNActivitiConfiguration)

Example 3 with BPMNActivitiConfiguration

use of org.wso2.carbon.bpmn.core.utils.BPMNActivitiConfiguration in project carbon-business-process by wso2.

the class SubstitutionDataHolder method isTransitivityEnabled.

/**
 * Get the transitivity enabled value for substitution from configuration.
 * @return true if transitivity enabled
 */
public boolean isTransitivityEnabled() {
    if (transitivityEnabled != null) {
        return transitivityEnabled;
    } else {
        transitivityEnabled = BPMNConstants.SUBSTITUTION_TRANSITIVITY_DEFAULT;
        BPMNActivitiConfiguration bpmnActivitiConfiguration = BPMNActivitiConfiguration.getInstance();
        if (bpmnActivitiConfiguration != null) {
            String transitivityEnabledProperty = bpmnActivitiConfiguration.getBPMNPropertyValue(BPMNConstants.SUBSTITUTION_CONFIG, BPMNConstants.SUBSTITUTION_TRANSITIVITY_PROPERTY);
            if (transitivityEnabledProperty != null) {
                if (transitivityEnabledProperty.trim().equalsIgnoreCase("true") || transitivityEnabledProperty.trim().equalsIgnoreCase("false")) {
                    transitivityEnabled = Boolean.parseBoolean(transitivityEnabledProperty);
                    if (log.isDebugEnabled()) {
                        log.debug("User substitution transitivity enabled : " + transitivityEnabled);
                    }
                } else {
                    log.warn("Invalid value for the property: " + BPMNConstants.SUBSTITUTION_TRANSITIVITY_PROPERTY + ". Transitivity is being disabled by default.");
                }
            }
        }
        return transitivityEnabled;
    }
}
Also used : BPMNActivitiConfiguration(org.wso2.carbon.bpmn.core.utils.BPMNActivitiConfiguration)

Aggregations

BPMNActivitiConfiguration (org.wso2.carbon.bpmn.core.utils.BPMNActivitiConfiguration)3