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

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

There is a newer version: 7.0.1
Show newest version
package org.flowable.spring;

import org.flowable.engine.common.impl.util.DefaultClockImpl;
import org.flowable.engine.common.runtime.Clock;
import org.flowable.engine.impl.calendar.AdvancedCycleBusinessCalendar;
import org.flowable.engine.impl.calendar.BusinessCalendarManager;
import org.flowable.engine.impl.calendar.DueDateBusinessCalendar;
import org.flowable.engine.impl.calendar.DurationBusinessCalendar;
import org.flowable.engine.impl.calendar.MapBusinessCalendarManager;

/**
 * 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.flowable.spring.SpringAdvancedBusinessCalendarManagerFactory" />
 * 
* * Add the manager to your org.flowable.spring.SpringProcessEngineConfiguration bean * *
 *  <bean id="processEngineConfiguration" class="org.flowable.spring.SpringProcessEngineConfiguration">
 *    ...
 *    <property name="businessCalendarManager">
 *      <bean id="advancedBusinessCalendarManager" factory-bean="businessCalendarManagerFactory" factory-method="getBusinessCalendarManager" />
 *    </property>
 *    ...
 *  </bean>
 * 
* * @author mseiden * @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