Search in sources :

Example 1 with SubstitutionScheduler

use of org.wso2.carbon.bpmn.people.substitution.scheduler.SubstitutionScheduler in project carbon-business-process by wso2.

the class BPMNEngineServerStartupObserver method completedServerStartup.

@Override
public void completedServerStartup() {
    if (!CarbonUtils.isChildNode() && TRUE.equalsIgnoreCase(BPMNActivitiConfiguration.getInstance().getBPMNPropertyValue(BPMNConstants.SUBSTITUTION_CONFIG, BPMNConstants.SUBSTITUTION_ENABLED))) {
        String activationIntervalString = BPMNActivitiConfiguration.getInstance().getBPMNPropertyValue(BPMNConstants.SUBSTITUTION_CONFIG, BPMNConstants.SUBSTITUTION_SCHEDULER_INTERVAL);
        long interval = BPMNConstants.DEFAULT_SUBSTITUTION_INTERVAL_IN_MINUTES * 60 * 1000;
        if (activationIntervalString != null) {
            interval = Long.parseLong(activationIntervalString) * 60 * 1000;
        }
        BPMNServerHolder.getInstance().setSubstitutionScheduler(new SubstitutionScheduler(interval));
        BPMNServerHolder.getInstance().getSubstitutionScheduler().start();
        log.info("BPMN Substitution scheduler started.");
    }
}
Also used : SubstitutionScheduler(org.wso2.carbon.bpmn.people.substitution.scheduler.SubstitutionScheduler)

Example 2 with SubstitutionScheduler

use of org.wso2.carbon.bpmn.people.substitution.scheduler.SubstitutionScheduler in project carbon-business-process by wso2.

the class BPMNEngineWaitBeforeShutdownObserver method startingShutdown.

@Override
public void startingShutdown() {
    log.info("Shutting down activiti process engine");
    SubstitutionScheduler scheduler = BPMNServerHolder.getInstance().getSubstitutionScheduler();
    if (scheduler != null) {
        log.info("Shutting down the BPMN Substitution Scheduler");
        scheduler.stop();
    }
    log.info("Beginning to close down the command context");
    if (Context.getCommandContext() != null) {
        Context.getCommandContext().close();
        log.info("Completed the closing of command context");
    }
    ProcessEngines.destroy();
    status = true;
}
Also used : SubstitutionScheduler(org.wso2.carbon.bpmn.people.substitution.scheduler.SubstitutionScheduler)

Aggregations

SubstitutionScheduler (org.wso2.carbon.bpmn.people.substitution.scheduler.SubstitutionScheduler)2