psdi.app.inventory

Class ReorderCron

  • All Implemented Interfaces:
    CronTask


    public class ReorderCron
    extends SimpleCronTask
    ReorderCron implements the reorder crontask. It runs the reorder process for each listed storerooms and each listed sites for direct order items. A few properties need to be specified These properties are in the reorder serction of the file. in mxserver.properties in order to run it successfully. The detail of how to set up the property is explained as comments before each property. A few messages used in the log and email are included in reordercron.txt because the messages need to be translatable.
    • Constructor Detail

      • ReorderCron

        public ReorderCron()
        Creates a new instance of ReorderCron
    • Method Detail

      • getStoreRoomList

        public java.lang.String[][] getStoreRoomList()
        This method returns a array of all storeroom list needs to reorder. One returned array element contains two Strings in the sequence of siteid, storeroom.
      • getDirectIssueSites

        public java.lang.String[] getDirectIssueSites()
        This method returns an string array of the sites which the reorder for direct issue items is requested.
      • getLeadTime

        public int getLeadTime()
        This method returns the leadtime for the reorder process.
      • getUseAgreement

        public boolean getUseAgreement()
        This method returns a boolean value to indicate whther agreement will be considered during the process of reorder.
      • getToEmail

        public java.lang.String getToEmail()
        This method returns the email address the result of the reorder will be send to. If this returns empty, no email will be sent.
      • getFromEmail

        public java.lang.String getFromEmail()
        This method returns the email address where the result email will be send from. This is obtained from the mxe.adminEmail. This cannot return null.
      • getLogFilePath

        public java.lang.String getLogFilePath()
        This method returns the complete path of the log file.
      • getInoreReorderPoint

        public boolean getInoreReorderPoint()
        This method returns a boolean value indicating if reorder point will be ignored in the reorder process. This takes affect for all the storerooms.
      • getReorderSoft

        public boolean getReorderSoft()
        This method returns a boolean value indicating if reorder soft will be considered during the reorder process.
      • start

        public void start()
        Initialize the crontask, read in the configuration data and prepare a UserInfo object.
        Specified by:
        start in interface CronTask
        Overrides:
        start in class SimpleCronTask
        See Also:
        CronTask.stop(), startup()
      • readConfig

        public void readConfig()
                        throws java.rmi.RemoteException,
                               MXException
        Read in the configuration information from mxserver.properties.
        Throws:
        java.rmi.RemoteException
        MXException
      • cronAction

        public void cronAction()
        The action method of the cron task. It loop through the specified storerooms and/or sites for direct order and reorder for each of them. Logs will be written and seperate email messages will be sent to the receiver if specified in the property.
        Specified by:
        cronAction in interface CronTask
        Specified by:
        cronAction in class SimpleCronTask
      • getParameters

        public CrontaskParamInfo[] getParameters()
                                          throws MXException,
                                                 java.rmi.RemoteException
        Description copied from interface: CronTask
        This method provides an array of CrontaskParamInfo() object to describe all the parameters of the crontask. Parameter name, default values and the description of the parameter should be set to the CrontaskParamInfo object for each parameter. If default value and description is not set, null will be the values.
        Specified by:
        getParameters in interface CronTask
        Overrides:
        getParameters in class SimpleCronTask
        Returns:
        Throws:
        MXException
        java.rmi.RemoteException
        See Also:
        CrontaskParamInfo