All Downloads are FREE. Search and download functionalities are using the official Maven repository.

org.activiti.spring.SpringAdvancedBusinessCalendarManagerFactory Maven / Gradle / Ivy

There is a newer version: 7.1.0.M6
Show newest version
package org.activiti.spring;

import org.activiti.engine.impl.calendar.*;
import org.activiti.engine.impl.util.DefaultClockImpl;
import org.activiti.engine.runtime.Clock;

/**
 * Creates an advanced cycle business calendar manager (ACBCM). The ACBCM can handle daylight savings changes when the scheduled time zone is different than the server time zone.
 * 

* Create a factory bean * *

 * <bean id="businessCalendarManagerFactory" class="org.activiti.spring.SpringAdvancedBusinessCalendarManagerFactory" />
 * 
* * Add the manager to your org.activiti.spring.SpringProcessEngineConfiguration bean * *
 *  <bean id="processEngineConfiguration" class="org.activiti.spring.SpringProcessEngineConfiguration">
 *    ...
 *    <property name="businessCalendarManager">
 *      <bean id="advancedBusinessCalendarManager" factory-bean="businessCalendarManagerFactory" factory-method="getBusinessCalendarManager" />
 *    </property>
 *    ...
 *  </bean>
 * 
* * @see AdvancedCycleBusinessCalendar */ public class SpringAdvancedBusinessCalendarManagerFactory { private Integer defaultScheduleVersion; private Clock clock; public Integer getDefaultScheduleVersion() { return defaultScheduleVersion; } public void setDefaultScheduleVersion(Integer defaultScheduleVersion) { this.defaultScheduleVersion = defaultScheduleVersion; } public Clock getClock() { if (clock == null) { clock = new DefaultClockImpl(); } return clock; } public void setClock(Clock clock) { this.clock = clock; } public BusinessCalendarManager getBusinessCalendarManager() { MapBusinessCalendarManager mapBusinessCalendarManager = new MapBusinessCalendarManager(); mapBusinessCalendarManager.addBusinessCalendar(DurationBusinessCalendar.NAME, new DurationBusinessCalendar(getClock())); mapBusinessCalendarManager.addBusinessCalendar(DueDateBusinessCalendar.NAME, new DueDateBusinessCalendar(getClock())); mapBusinessCalendarManager.addBusinessCalendar(AdvancedCycleBusinessCalendar.NAME, new AdvancedCycleBusinessCalendar(getClock(), defaultScheduleVersion)); return mapBusinessCalendarManager; } }




© 2015 - 2024 Weber Informatics LLC | Privacy Policy