Configuring the Scheduler Component

The scheduler component determines how often the system runs the Background Process scheduler used for batch processes. To configure this component, you need to edit the web.xml file and the JPO DSC_BackgroundScheduler.

The scheduler component reads the list of queues specified as a comma-separated list in the queneNames variable of the DSC_BackgroundScheduler JPO, at the interval defined in the web.xml file. For each queue, it reads the DSCPeriodicMessageIndex attribute of the DSCQueue object to obtain the DSCPeriodicMessage object name. For each DSCPeriodicMessage, it determines if the start date is earlier than the current date, and if the DSCPeriodicMessageLastRun attribute is blank. If so, it adds this message to the DSCPendingMessageIndex of the DSCQueue object.

If the DSCPeriodicMessageLastRun attribute is not blank, it determines the difference between the current time and the last run time. If this difference is greater than the value of the DSCPeriodicMessageInterval attribute on the DSCPeriodicMessage object, and the value of the DSCPeriodicMessageRunCount attribute is less than or equal to the value of the DSCPeriodicMessageLimit attribute, it adds the message to the DSCPendingMessageIndex of the DSCQueue object.

After the periodic message is processed, the DSCPeriodicMessageLastRun and DSCPeriodicMessageRunCount attributes on the messages are updated.

  1. Open the web.xml file and locate this section. You must add the section by moving the --> at the end of the code to the first line, as shown below:

    <!-- legacy servlet properties-->
    
          <context-param id="ContextParam_13">
    
             <param-name>ematrix.servlet.ui</param-name>
    
             <param-value>true</param-value>
    
          </context-param>
    
          <context-param id="ContextParam_14">
    
             <param-name>ematrix.timer.agent</param-name>
    
             <param-value>Test Everything</param-value>
    
          </context-param>
    
          <context-param id="ContextParam_15">
    
             <param-name>ematrix.timer.agent.key</param-name>
    
             <param-value></param-value>
    
          </context-param>
    
          <context-param id="ContextParam_16">
    
             <param-name>ematrix.timer.interval</param-name>
    
             <param-value>20</param-value>
    
          </context-param>
    
          <context-param id="ContextParam_17">
    
             <param-name>ematrix.timer.command</param-name>
    
             <param-value>execute program DSC_BackgroundScheduler -method 
    runScheduler</param-value>
    
          </context-param>
    

  2. Enter values for the parameters shown in green:

    • ematrix.timer.agent--Username of the context user
    • ematrix.timer.agent.key--password of the context user (optional)
    • ematrix.timer.interval--interval at which the timer servlet runs (in seconds)

  3. Add the TimerServlet mapping so that it appears as shown here (the --> is moved from the end of the code section to the end of the Timer Servlet line):

    <!-- Timer Servlet - see mapping below -->
    
    <servlet id="Servlet_19">
    
    <servlet-name>TimerServlet</servlet-name>
    
        <servlet-class>com.matrixone.servlet.TimerServlet</servlet-class>
    
        <load-on-startup>2</load-on-startup>
    
    </servlet>
    

  4. Update the variable queueNames in the JPO DSC_BackgroundScheduler to define a comma-separated list of DSCQueue objects to be polled at the intervals specified in the web.xml file:
    MQL>extract program DSC_BackgroundScheduler source <USER_READ_WRITE_DIR> where <USER_READ_WRITE_DIR> is the directory with read-write access for the current user.

    For example, MQL>extract program DSC_BackgroundScheduler source C:\temp

  5. update the value of the queueNames variable to include the names of the DSCQueue objects to be polled by the scheduler in <USER_READ_WRITE_DIR>\DSC_BackgroundScheduler_mxJPO.java
    MQL>modify program DSC_BackgroundScheduler file <USER_READ_WRITE_DIR>\DSC_BackgroundScheduler_mxJPO.java;

    For example, MQL>modify program DSC_BackgroundScheduler file C:\temp\DSC_BackgroundScheduler_mxJPO.java;

    MQL>compile program DSC_BackgroundScheduler -force update;