6 Replies Latest reply on Mar 17, 2014 1:58 AM by manish12nov

    How to make it work : Two plugins with cron job expression

    manish12nov

      Hi,

       

      I have two plugins which are having cron expressions in their respective spring.xml files. But, While uploading them together, only one of the cron jobs is getting executed.

      However, both of the cron jobs are working fine while uploading separately (without presence of the other plugin). Any inputs, how to make those work together ??

       

      I am providing the spring references for them :

       

      Plugin1 spring xml :

       

      <bean id="xxxCronTasks"

        class="com.jivesoftware.community.lifecycle.spring.task.CronTaskDefinitionBean">

        <property name="task">

        <bean class="com.XXX.BlogPostCronTask">

        <property name="xxxAction" ref="xxxAction" />

        </bean>

        </property>

        <property name="cronExpression" value="0 0 3 * * ?" />

        </bean>

       

        <bean id="tasks" class="com.jivesoftware.community.util.spring.MergeableCollection">

              <property name="source">

                  <util:list value-type="com.jivesoftware.community.lifecycle.spring.task.TaskDefinitionBean">

                      <ref bean="xxxTasks" />

                  </util:list>

              </property>

          </bean>




      Plugin2 Spring xml :


      <bean id="yyyCronTasks"

        class="com.jivesoftware.community.lifecycle.spring.task.CronTaskDefinitionBean">

        <property name="task">

        <bean class="com.yyy.tasks.InventoryCronTask">

        <property name="yyyAction" ref="yyyAction" />

        </bean>

        </property>

        <property name="cronExpression" value="0 1 * * * ?" />

        </bean>

       

        <bean id="tasks" class="com.jivesoftware.community.util.spring.MergeableCollection">

              <property name="source">

                  <util:list value-type="com.jivesoftware.community.lifecycle.spring.task.TaskDefinitionBean">

                      <ref bean="yyyCronTasks" />

                  </util:list>

              </property>

          </bean>



      Ryan Rutan : Can u provide ur inputs on this?