cancel
Showing results for 
Search instead for 
Did you mean: 

Update Due Date Business Calender for Spring Boot Project

jindal8787
Champ in-the-making
Champ in-the-making
We are using Spring Boot Activiti project using Activiti-Rest as an dependency. Can anybody suggest the spring-boot configurations we can make to update the Due date calendar at the application-startup, as per our business calendar which excludes weekends and National Holidays from due dates. Any sample would be much appreciated.

Regards
Amit Jindal
3 REPLIES 3

jindal8787
Champ in-the-making
Champ in-the-making
I tried something like this in the Main application however without any success -

@Bean
  InitializingBean setCalender(
      final ProcessEngineConfigurationImpl processEngineConfiguration) {

    return new InitializingBean() {
      @Override
      public void afterPropertiesSet() throws Exception {
        Clock clock = processEngineConfiguration.getClock();
        System.out.println("\n\n\n\n+++++++++++++++++\n\n\n\n\n"
            + clock.getCurrentTime() + "\n\n\n\n+++++++++++++++++\n\n\n\n\n");
        clock.setCurrentCalendar(new GregorianCalendar(2015, 0, 1));
        MapBusinessCalendarManager mapBusinessCalendarManager =
            new MapBusinessCalendarManager();
        mapBusinessCalendarManager.addBusinessCalendar(
            DurationBusinessCalendar.NAME, new DurationBusinessCalendar(clock));
        mapBusinessCalendarManager.addBusinessCalendar(
            DueDateBusinessCalendar.NAME, new DueDateBusinessCalendar(clock));
        mapBusinessCalendarManager.addBusinessCalendar(
            CycleBusinessCalendar.NAME, new CycleBusinessCalendar(clock));
        processEngineConfiguration
            .setBusinessCalendarManager(mapBusinessCalendarManager);
        Clock clock1 = processEngineConfiguration.getClock();
        System.out.println("\n\n\n\n+++++++++++++++++\n\n\n\n\n"
            + clock1.getCurrentTime() + "\n\n\n\n+++++++++++++++++\n\n\n\n\n");
      }
    };
  }

jindal8787
Champ in-the-making
Champ in-the-making
Anyone?

jbarrez
Star Contributor
Star Contributor
Here's some unit tests that test the custom business calendar functionality: https://github.com/Activiti/Activiti/tree/master/modules/activiti-engine/src/test/java/org/activiti/...