2 Replies Latest reply on Sep 15, 2010 2:36 AM by Adwait Chitaley

    Business Calendar - Saturday Working Day

    Adwait Chitaley Newbie

      The following is the content of my jbpm.businesscalendar.cfg.xml


      <?xml version="1.0" encoding="UTF-8"?>
      <jbpm-configuration xmlns="http://jbpm.org/xsd/cfg">
          <process-engine-context>
              <business-calendar>
                  <monday    hours="9:00-12:00 and 12:30-17:00"/>
                  <tuesday   hours="9:00-12:00 and 12:30-17:00"/>
                  <wednesday hours="9:00-12:00 and 12:30-17:00"/>
                  <thursday  hours="9:00-12:00 and 12:30-17:00"/>
                  <friday    hours="9:00-12:00 and 12:30-17:00"/>
                  <saturday  hours="9:00-12:00 and 12:30-17:00"/>
                  <!--<holiday period="01/09/2010 - 30/09/2010"/>-->
              </business-calendar>
          </process-engine-context>
      </jbpm-configuration>
      

       

      We require SATURDAY as a working day.

       

      I have therefore appended saturday as a working day above, which, in the example in User Guide was restricted upto Friday only.

       

      When I execute the above settings and specify duedate="2 business hours" in a task, saturday is not considered as a working day.

       

      1) Is the method of including Saturday as a working day specified above incorrect?

       

      2) In what manner can the above be accomplished?

       

       

      Thanks in advance.

       

      Adwait Chitaley

        • 1. Re: Business Calendar - Saturday Working Day
          Alejandro Guizar Master

          1) Is the method of including Saturday as a working day specified above incorrect?

          The configuration is correct, the placement might be wrong.

          2) In what manner can the above be accomplished?

          jbpm.businesscalendar.cfg.xml is only read if your jbpm.cfg.xml file imports it explicitly. If your jbpm.cfg.xml resource does import jbpm.businesscalendar.cfg.xml, it is possible that the default resource in jbpm-pvm.jar precedes the custom resource in the classpath and thus hides your custom configuration. To avoid this problem, there are two choices.

          1. Rename your custom resource to a different name such as my.calendar.cfg.xml. Import my.calendar.cfg.xml from your jbpm.cfg.xml.
          2. Place your business calendar configuration directly in jbpm.cfg.xml and remove the jbpm.businesscalendar.cfg.xml import, if any. This is the approach taken in the CustomBusinessCalendarCfgTest, which reads the following configuration.

           

          <jbpm-configuration>
            <import resource="jbpm.default.cfg.xml" />
            <import resource="jbpm.tx.hibernate.cfg.xml" />
            <import resource="jbpm.jpdl.cfg.xml" />
            <import resource="jbpm.identity.cfg.xml" />
          
            <process-engine-context>
              <business-calendar>
                <monday    hours="9:00-18:00"/>
                <tuesday   hours="9:00-18:00"/>
                <wednesday hours="9:00-18:00"/>
                <thursday  hours="9:00-18:00"/>
                <friday    hours="9:00-18:00"/>
                <saturday  hours="9:00-18:00"/>
              </business-calendar>
            </process-engine-context>
           </jbpm-configuration>
          
          • 2. Re: Business Calendar - Saturday Working Day
            Adwait Chitaley Newbie

            Alejandro,

             

             

            1) Thanks for the solution. Renaming the file jbpm.businesscalendar.cfg.xml to myproject.businesscalendar.cfg.xml worked charm.

             

            2) Keep up the good work.

             

             

             

            Adwait Chitaley