psdi.app.pm

Class PM

  • All Implemented Interfaces:
    java.rmi.Remote, AncMbo, PMRemote, PMAppActionInterface, LinkedMboRemote, MboConstants, MboRemote, StatefulMboRemote, MaxRemoteProxy


    public class PM
    extends StatefulMbo
    implements PMRemote, LinkedMboRemote, AncMbo
    MBO to represent PM. See the PM package description for details.

    This is a site level object.

    The key attributes for this object are SiteId and Pmnum.

    The attributes in this object are as follows:

    Attribute NameDescription
    AdjNextDueA boolean flag that indicates whether the extdate will be used for calculating the next due date for the generation of workorders from this PM.
    AlertLeadAcceptable period (in days), prior to the PM due date, during which the PM may be performed.
    AssetnumIdentifier of the asset associated with this PM. Foreign Key to Assetnum.
    CalendarCalendar to determine shift work is to be done on. Foreign key to Calendar
    ChangeBy, ChangeDateName of the user who last updated this object and date of last change.
    CrewIdIdentifies the crew which is assigned to the workorders generated by this PM.
    DescriptionDescription of the PM.
    DownTimeA boolean field that indicates whether the asset has to be down or not to perform the work.
    ERLSTWOGENDATEIt is a non-persistant attribute. Earliest Next Work Order Generation Date
    ExtDateIdentifier of the date that overrides the PM's next due date for generating the workorders.
    FirstDateIdenfier of the First start date when the workorder is generated from this PM. This initiates the PM work generation cycle.
    FrequencyIdentifies the number of time units to elapse between the workorders generated from PM. The time units can be Days, Weeks, Months or Years.
    FreqUnitThe time units for the frequency attribute.
    FridayIndicates whether Friday is a active Day for a PM.
    GLAccountThe account which will be charged for the costs on the workorders generated from this PM.
    HasChildrenA boolean flag that indentifies whether this PM has any child PM or not.
    InterruptibleA boolean field that indicates whether work orders generated by this PM can be interrupted or not when they are in progress. This information will be copied from the first jobplan in the sequence on this PM.
    JpnumThe jobplan which will be assigned to the work oder generated by this PM.
    JpSeqInUseA boolean field that indicates whether the PM uses a jobplan sequnce or not.
    LastCompDateIndicates the completion date of the last workorder generated from this PM.
    LastMeterDateIndicates the date of Meter Reading at last WorkOrder generation.
    LastStartDateIndicates the date on which the last workorder generated from this PM was scheduled to start. This date gets copied over to all workoders which are generated from this PM.
    LDKeyLong Description Key. This is a link to text stored in the LongDescription table.
    LeadThis defines the lead laborer for the work order created by this PM.
    LeadTimeIdentifies the number of days in advance of the next due date when this PM generates the work orders.
    LeadTimeActiveNon-persistent attribute that specifies whether LeadTime can be applied to PM for generating the work orders.
    LocationIdentifies the location where the work will be done when workorders are generated by this PM.
    MasterPM Identifies the master PM which can be used as template to create associated PM records.
    MondayIndicates whether Monday is a active Day for a PM.
    NextDateThe date on which the next work order will be generated by this PM.
    OrgIdIdentifier of the organization for this PM.
    OverrideMasterUpdA boolean field that indicates whether this PM's schedule information can be updated by its Master or not.
    OwnerThe person who will be responsible for the work order created with this PM.
    OwnerGroupThe person group who will be responsible for the work order created with this PM.
    ParentIdentifier of the Parent for a given PM.
    ParentChgsStatusFlags whether the parent of this generated work order should change this generated work order's status.
    PersonGroupPersongroup identifier.
    PmActMeterA boolean field that indicates whether work orders can be generated based on absolute meter reading.
    PMCounterIdentifier of the number of work orders generated from a PM.
    PMAssetWogenA boolean field that indicates whether work orders will be generated automatically when PM meter frequency is reached, due to the updates to the asset's meter reading.
    PMNumIdentifier for the Preventive Maintenance record.
    PriorityIdentifies the priority level used by the system when scheduling the work orders generated from this PM.
    Identifier of the route that is associated with a PM.
    SaturdayIndicates whether Saturday is a active Day for a PM.
    SiteIdIdentifier of the site for the PM.
    StatusIndicates status of a PM.
    StoreLocIdentifies the storeroom to get materials from, if the storeroom is not specified on the Job Plan Materials.
    StoreLocSiteIdentifies the storeroom's site to get materials from.
    SundayIndicates whether Sunday is a active Day for a PM.
    SupervisorIdentifier of the person responsible for implementing the work order. This information will be copied from the first jobplan in the sequence on this PM.
    ThursdayIndicates whether Thursday is a active Day for a PM.
    TuesdayIndicates whether Tuesday is a active Day for a PM.
    UpdExtDateA boolean field that indicates whether the Master PM updates extended date and adjust next due date fields on the associated PM records or not.
    UseFrequencyA boolean field that indicates whether this PM has frequency criteria to decide the next work order generation date.
    UseTargetDateA boolean field that indicates which date begins the PM Frequency Count. If this is set to 'True', the measurement of time between the work order generation from thisPM will begin at 'LastStartDate'. If this is 'false',the measurement will begin at 'LastCompDate'.
    WednesdayIndicates whether Wednesday is a active Day for a PM.
    WorkTypeType of the work order that will be generated from a PM.
    WOSequenceThe sequence number of work orders generated by the PM.
    WoStatusThe status of the work orders generated by the PM.
    InclForecastIndicates if this PM should be included in the forecast
    LTDPMCounterIdentifier of the number of work orders generated from a PM. Life to Date counter cannot be reset.
    PMEQ1 through PMEQ3Extra Fields.

    • Field Detail

      • TIMEZONE_PM_WOGEN_PROCESS

        public static final java.lang.String TIMEZONE_PM_WOGEN_PROCESS
        The Process Name for Time Zone selection for Work Orders generation
        See Also:
        Constant Field Values
      • hasCalibration

        protected boolean hasCalibration
        The has calibration.
      • existingReforecast

        public boolean existingReforecast
      • forecastFlag

        public boolean forecastFlag
        Flag indicates if it is PM forecast
      • inViewJpSequence

        public boolean inViewJpSequence
      • inGenerateForecast

        protected boolean inGenerateForecast
      • pmForecastNonEditable

        public boolean pmForecastNonEditable
      • pmForecastWithRegenerate

        public Mbo pmForecastWithRegenerate
      • REFORECASTNA

        public static int REFORECASTNA
      • REFORECASTNOW

        public static int REFORECASTNOW
      • REFORECASTLATER

        public static int REFORECASTLATER
      • REFORECASTCANCEL

        public static int REFORECASTCANCEL
      • DELETEREFORECASTNA

        public static int DELETEREFORECASTNA
      • DELETEREFORECASTNOW

        public static int DELETEREFORECASTNOW
      • DELETEREFORECASTLATER

        public static int DELETEREFORECASTLATER
      • DELETEREFORECASTCANCEL

        public static int DELETEREFORECASTCANCEL
    • Constructor Detail

      • PM

        public PM(MboSet ms)
           throws MXException,
                  java.rmi.RemoteException
        Construct the PM object
        Throws:
        MXException
        java.rmi.RemoteException
    • Method Detail

      • init

        public void init()
                  throws MXException
        Initialize the PM object. This sets the PMForecast object to READONLY if it is a child PM.
        Overrides:
        init in class Mbo
        Throws:
        MXException
      • initFieldFlagsOnMbo

        public void initFieldFlagsOnMbo(java.lang.String attrName)
                                 throws MXException
        Description copied from class: Mbo
        The logic of setting the readonly and required field flags to the mbo. Any setting of the field flags that require expensive operation, such as database query should be moved from init() to this method. However, those which don't require steps such as fetching Mbos can be left in init(). You can group the logic for a few attributes together if logic of deciding their flag is the same, or in other words, can be handled at once.
        Overrides:
        initFieldFlagsOnMbo in class Mbo
        Throws:
        MXException
      • add

        public void add()
                 throws MXException,
                        java.rmi.RemoteException
        Sets default values for a new PM object.
        Specified by:
        add in interface MboRemote
        Overrides:
        add in class Mbo
        Throws:
        MXException
        java.rmi.RemoteException
      • hasUnsavedChildren

        protected boolean hasUnsavedChildren()
                                      throws MXException
        Checks for unsaved children.
        Returns:
        true, if successful
        Throws:
        MXException - the mX exception
      • getUnsavedChildrenCount

        protected int getUnsavedChildrenCount()
                                       throws MXException
        Gets the unsaved children count.
        Returns:
        the unsaved children count
        Throws:
        MXException - the mX exception
      • getUnsavedChildren

        protected java.util.Iterator getUnsavedChildren()
                                                 throws MXException
        Gets the unsaved children.
        Returns:
        the unsaved children
        Throws:
        MXException - the mX exception
      • addUnsavedChild

        protected void addUnsavedChild(java.lang.String child)
                                throws MXException
        Adds the unsaved child.
        Parameters:
        child - the child
        Throws:
        MXException - the mX exception
      • removeUnsavedChild

        protected void removeUnsavedChild(java.lang.String child)
                                   throws MXException
        Removes the unsaved child.
        Parameters:
        child - the child
        Throws:
        MXException - the mX exception
      • getUnsavedChildrenCopy

        protected java.util.Vector getUnsavedChildrenCopy()
                                                   throws MXException
        Gets the unsaved children copy.
        Returns:
        the unsaved children copy
        Throws:
        MXException - the mX exception
      • unsavedChildrenModifiedSinceThisChildAdded

        protected boolean unsavedChildrenModifiedSinceThisChildAdded(java.util.Vector childVectorCopyForThisChild)
                                                              throws MXException
        Unsaved children modified since this child added.
        Parameters:
        childVectorCopyForThisChild - the child vector copy for this child
        Returns:
        true, if successful
        Throws:
        MXException - the mX exception
      • modify

        public void modify()
                    throws MXException,
                           java.rmi.RemoteException
        The first time a field of a PM object is modified, the ChangeBy & ChangeDate attributes are updated.
        Overrides:
        modify in class Mbo
        Throws:
        MXException
        java.rmi.RemoteException
      • canDelete

        public void canDelete()
                       throws MXException,
                              java.rmi.RemoteException
        Method that checks whether a PM can be deleted or not.
        PM can only be deleted if it is not refrenced in the following objects
        Measurepoint, Workorder(if wo status is 'Open') or if it does not belong to a hierarchy. If the relationship between child and parent is deleted, throws interactive message warning about the deletion of the PM forecast
        Overrides:
        canDelete in class Mbo
        Throws:
        MXException - If PM references a open work order, then MXApplicationException("PM", "OpenWoForPM")
        MXException - If PM belongs to a hierarchy, then MXApplicationException("PM", "BelongToHierarchy")
        java.rmi.RemoteException
      • delete

        public void delete(long modifier)
                    throws MXException,
                           java.rmi.RemoteException
        Deletes a PM record.
        when a pm is deleted, all records in PMMETER, PMSEASONS, PMSEQUENCE, PMFORECAST, PMFORECASTJP will also be deleted for that PMNUM Calibration roll-in comment Deletion of records from the PLUSCPMEXTDATE table if the PM record is also deleted End of calibration roll-in comment
        Specified by:
        delete in interface MboRemote
        Overrides:
        delete in class Mbo
        Parameters:
        modifier - access modifier
        Throws:
        MXException
        java.rmi.RemoteException
        See Also:
        Mbo.delete(long)
      • changeStatus

        public void changeStatus(java.lang.String status,
                                 boolean rollToAllChildren,
                                 java.util.Hashtable changedStatusPMs)
                          throws MXException,
                                 java.rmi.RemoteException
        Change the status of the PM(s) Depending on the value of check box on the Status dialog box, It will change the status of all Children Throws interactive message in case of UI to delete the PM Hierarchy forecast if the status of the PM is changed. If owner is asset , don't throw exception , set the canDeleteForecast flag to true if the forecast exits which will delete the forecast on save.
        Specified by:
        changeStatus in interface PMRemote
        Parameters:
        status - New status
        rollToAllChildren - Flag indicate if the status is rolled to all children
        changedStatusPMs - Hashtable with the PM's whose status is changed
        Throws:
        MXException - Thrown if there is a problem, or the status cannot be changed, as determined by canChangeStatus(String).
        java.rmi.RemoteException
        See Also:
        PM.changeStatus(java.lang.String,boolean,java.util.Hashtable)
      • checkAssetOrLocationActive

        protected void checkAssetOrLocationActive(java.lang.String status)
                                           throws MXException,
                                                  java.rmi.RemoteException
        Check asset or location active.
        Parameters:
        status - the status
        Throws:
        MXException - the mX exception
        java.rmi.RemoteException - the remote exception
      • checkJobPlanActive

        protected void checkJobPlanActive(java.lang.String status)
                                   throws MXException,
                                          java.rmi.RemoteException
        IJ00314: If changing the PM status to ACTIVE, check that its job plans are still active
        Parameters:
        status - The new PM status
        Throws:
        MXException - The MX exception
        java.rmi.RemoteException - The remote exception
      • updateUponCompletion

        public void updateUponCompletion(MboRemote completedWO)
                                  throws MXException,
                                         java.rmi.RemoteException
        Updates the PM record when the work order is completed. PM also updates the work order's PMNextDueDate. This method will be called by the work order status change handler when a PM generated work order is completed. This also updates the PM's LastCompDate and maybe meter and NextDate attributes.
        Specified by:
        updateUponCompletion in interface PMRemote
        Parameters:
        completedWO - The work order that was completed.
        Throws:
        MXException
        java.rmi.RemoteException
        See Also:
        PM.updateUponCompletion(MboRemote completedWO)
      • addMonths

        protected java.util.Date addMonths(int addMonths,
                                           java.util.Date fromDate)
                                    throws MXException,
                                           java.rmi.RemoteException
        Calculates a date a number of months from the given date. If the day number of the given date is greater than the number of days in the resulting month, the end of the month is used. For example, adding 1 month to 3/31/00 will return 4/30/00.
        Parameters:
        addMonths - Number of months to add to the date.
        fromDate - The date to add the months to.
        Returns:
        The date equal to the fromDate plus the added months.
        Throws:
        MXException
        java.rmi.RemoteException
        See Also:
        PM.getNextDate(boolean)
      • addYears

        protected java.util.Date addYears(int addYears,
                                          java.util.Date fromDate)
        Calculates a date a number of years from the given date. If going from a Leap Year Day (Feb. 29th) to a non-leap year, Feb. 28th will be used instead.
        Parameters:
        addYears - Number of years to add to the date.
        fromDate - The date to add the years to.
        Returns:
        The date equal to the fromDate plus the added years.
        Throws:
        MXException
        java.rmi.RemoteException
        See Also:
        PM.getNextDate(boolean)
      • updateForecastUponCancellation

        public void updateForecastUponCancellation(MboRemote cancelledWO)
                                            throws MXException,
                                                   java.rmi.RemoteException
        Update the PM forecast records and LTDPMCounter when a work order generated by the PM is cancelled.
        Parameters:
        cancelledWO - The work order that was cancelled.
        Throws:
        MXException
        java.rmi.RemoteException
      • appValidate

        public void appValidate()
                         throws MXException,
                                java.rmi.RemoteException
        This method will be called just before save() in order to make sure it is a valid PM record.
        Overrides:
        appValidate in class Mbo
        Throws:
        MXException - If Assetnum, Location, and GLAccount are null, then MXApplicationException("PM","selectAssetLocation")
        java.rmi.RemoteException
      • save

        public void save()
                  throws MXException,
                         java.rmi.RemoteException
        Saves the PM record. For a new PM, ensure that pmnum is set on pmsequence records. Delete the PM hierarchy forecast if the flag canDeleteForecast is set to true.
        Overrides:
        save in class StatefulMbo
        Throws:
        MXException
        java.rmi.RemoteException
      • canGenerateWork

        public void canGenerateWork()
                             throws java.rmi.RemoteException,
                                    MXException
        Determines if the user can generate work orders. Master PM records and PM records which are not top level, cannot generate work orders. The PM cannot have unsaved modifications and generate work. The PM may still not generate work orders based on frequency criteria.
        Specified by:
        canGenerateWork in interface PMRemote
        Throws:
        MXException - if there are any unsaved modifications for this PM, then MXApplicationException("pm", "UnsavedNoGen", param)
        MXException - if this is a Master PM record, then MXApplicationException("pm", "MasterNoGen", param)
        MXException - if this is not top level PM, then MXApplicationException("pm", "NoTopNoGen", param)
        java.rmi.RemoteException
        See Also:
        PM.canGenerateWork()
      • generateWork

        public MboSetRemote generateWork(boolean useFreqCrit,
                                         int leadTime,
                                         boolean forecast)
                                  throws java.rmi.RemoteException,
                                         MXException
        Generates work orders from this PM. If the forecast flag is false,after each work order is created, it is saved. If the forecast flag is true, workorders are not saved. The log records the generation process. If the generation process fails in mid-generation use the log to correct your records.
        After this method completes, the PMSet and PM should be refreshed in order to reflect the changes.
        Parameters:
        useFreqCrit - Flag whether to use the PM's frequency criteria or not.
        leadTime - If using frequency criteria, this is the number of days ahead to generate work orders or forecast for.
        forecast - Flag to indicate if the wogen is called for forecasting or work order generation
        Returns:
        wogen records
        Throws:
        MXException
        java.rmi.RemoteException
      • generateWork

        public void generateWork(boolean useFreqCrit,
                                 int leadTime,
                                 MboRemote measurement)
                          throws java.rmi.RemoteException,
                                 MXException
        Generates work orders from this PM. After each work order is created, it is saved. The log records the generation process. If the generation process fails in mid-generation use the log to correct your records.
        Although this method may set the value of the Parent attribute, it ignores that field's validation and business rules.
        After this method completes, the PMSet and PM should be refreshed in order to reflect the changes. ***** Calibration roll-in comment Once the WO is generated the Extend Date on the PM becomes null. At this time all of the associated records with that PM value in the PLUSCPMEXTDATE table will have the History Flag set to '1' and this pluscpmextdate flag in the asset table will be reset to '0'. ****** End of Calibration roll-in comment
        Specified by:
        generateWork in interface PMRemote
        Parameters:
        useFreqCrit - Flag whether to use the PM's frequency criteria or not.
        leadTime - If using frequency criteria, this is the number of days ahead to generate work orders for.
        measurement - measurement for which PM work order is being generated.
        Throws:
        MXException
        java.rmi.RemoteException
        See Also:
        PM.generateWork(boolean, int, MboRemote)
      • calculateWork

        public MboSetRemote calculateWork(boolean useFreqCrit,
                                          java.util.Date generateUntil)
                                   throws MXException,
                                          java.rmi.RemoteException
        Generate work orders for this PM, but do not save them. This form takes a generation cut-off date.
        Specified by:
        calculateWork in interface PMRemote
        Parameters:
        generateUntil - Work Orders are generated for target dates until this date is reached.
        useFreqCrit - Flag whether to use frequency criteria to generate PMs. If this flag is false, the PM hierarchy will generate only one set of work orders, for today's date. If this flag is true, the PM's frequency will determine the dates and number of work orders to generate. In this case, there may be no work orders generated.
        Returns:
        MboSet containing the generated work orders. This set may be empty. This will be a set of Wogen records.
        Throws:
        MXException
        java.rmi.RemoteException
        See Also:
        calculateWork(String,int,boolean)
      • calcWork

        public MboSetRemote calcWork(boolean useFreqCrit,
                                     int leadTime)
                              throws java.rmi.RemoteException,
                                     MXException
        Calculates what work orders would be generated if generateWork was called.

        Although this method may set the value of the Parent attribute, it ignores that field's validation and business rules.

        Specified by:
        calcWork in interface PMRemote
        Parameters:
        useFreqCrit - Flag whether to use the PM's frequency criteria or not.
        leadTime - If using frequency criteria, this is the number of days ahead to generate work orders for.
        Returns:
        The MboSet containing the generated work orders. This will be a set of Wogen records.
        Throws:
        MXException
        java.rmi.RemoteException
        See Also:
        psdi.app.pm.PMService#calculateWork
      • calculateTodaysDateWithObjectTimeZoneRule

        public java.util.Date calculateTodaysDateWithObjectTimeZoneRule()
                                                                 throws MXException,
                                                                        java.rmi.RemoteException
        IJ17711: Calculate today's date with the object time zone if a time zone rule applies
        Throws:
        MXException
        java.rmi.RemoteException
      • checkSeason

        public java.util.Date checkSeason(java.util.Date origGenDate,
                                          int totalLeadTime)
                                   throws java.rmi.RemoteException,
                                          MXException
        used for work order generation to check the season
        Specified by:
        checkSeason in interface PMRemote
        Parameters:
        origGenDate - This date was calculated from frequency data.
        totalLeadTime - Total leadtime in days(leadtime plus runtime leadtime)
        Returns:
        The date is passed back unmodified when it is in season null when there is No Active Day. If the original date wasn't in the season, the first date of the next season is returned.
        Throws:
        MXException
        java.rmi.RemoteException
      • setLinearAssetFieldsReadOnly

        public void setLinearAssetFieldsReadOnly(boolean readonlystate)
                                          throws MXException,
                                                 java.rmi.RemoteException
        Set the linear asset fields as a group to ReadOnly or not.
        Throws:
        MXException
        java.rmi.RemoteException
      • clearLinearAssetFields

        public void clearLinearAssetFields()
                                    throws MXException,
                                           java.rmi.RemoteException
        Clear all the linear asset fields.
        Throws:
        MXException
        java.rmi.RemoteException
      • fillWOGen

        protected void fillWOGen(java.util.Date generationDate,
                                 MboRemote retWOGen,
                                 int priority,
                                 java.lang.String parentWO,
                                 boolean forecast)
                          throws java.rmi.RemoteException,
                                 MXException
        Generate information to create a work order from this PM. This method sets the values of a WOGen Mbo, which can be used for forecasting or to generate a work order. Increment the LTDPMCounter when workorder is generated and not when forecasting Calibration roll-in comment Overrides method to capture NEXDATE before recalculation. End of calibration roll-in comment
        Parameters:
        generationDate - The date to generate the workorder for.
        retWOGen - The new wogen for storing the workorder info.
        priority - Priority to be set for the generated work order -1 if the PM's priroity is copied to workorder's 'wopriority' else value passed in by the user from generateWork() method
        forecast - True, if the workorders are created for forecasting False, if the workorders are created for real and saved to the database
        Throws:
        MXException
        java.rmi.RemoteException
        See Also:
        PM.generateWorkOrderInformation(java.util.Date, boolean, psdi.mbo.MboSetRemote, int, java.lang.String, java.util.Hashtable, psdi.mbo.MboRemote)
      • updateMeterValues

        protected void updateMeterValues(java.lang.String relationship,
                                         boolean fromWoComplete,
                                         boolean forecast)
                                  throws java.rmi.RemoteException,
                                         MXException
        Throws:
        java.rmi.RemoteException
        MXException
      • getJobPlanToUse

        public void getJobPlanToUse()
                             throws java.rmi.RemoteException,
                                    MXException
        Figures out which JobPlan to use based on the PMCounter & PMSequence records. Sets the PM's JPNum attribute and copies the extra fields. The PM uses the jobplan with smallest interval that divides evenly into the value in the PMCounter.
        Throws:
        MXException
        java.rmi.RemoteException
      • validateAssetLoc

        public void validateAssetLoc(boolean newAssetNum,
                                     boolean newLocation)
                              throws MXException,
                                     java.rmi.RemoteException
        validates the assetnum and location.
        if assetnum -> entered, location is set to null
        if location -> entered, assetnum is set to null
        Specified by:
        validateAssetLoc in interface PMRemote
        Parameters:
        newAssetNum - Flag to indicate whether Assetnum attribute is changed.
        newLocation - Flag to indicate whether location attribute is changed.
        Throws:
        MXException
        java.rmi.RemoteException
        See Also:
        PM.validateAssetLoc(boolean newAssetNum, boolean newLocation)
      • updateTimeBasedNextDueDate

        public void updateTimeBasedNextDueDate()
                                        throws MXException,
                                               java.rmi.RemoteException
        Updates the PM.NEXTDATE when necessary. This method will be called by the post validation action of the following attributes: FIRSTDATE, FREQUENCY, FREQUNIT, and USETARGETDATE.
        Specified by:
        updateTimeBasedNextDueDate in interface PMRemote
        Throws:
        MXException
        java.rmi.RemoteException
        See Also:
        PM.updateTimeBasedNextDueDate()
      • checkDate

        public java.util.Date checkDate()
                                 throws MXException,
                                        java.rmi.RemoteException
        Calculates the date of the next date plus the frequency.
        Specified by:
        checkDate in interface PMRemote
        Throws:
        MXException
        java.rmi.RemoteException
      • setPMCounter

        public void setPMCounter(int count)
                          throws MXException,
                                 java.rmi.RemoteException
        updates/sets the pmcounter to the specified value. The pmcounter can be set through only PM methods.
        Specified by:
        setPMCounter in interface PMRemote
        Parameters:
        count - The value to which the pmcounter should be set to.
        Throws:
        java.rmi.RemoteException
        MXException - Thrown with ("PM", "CountNonNegative") if count is negative.
        See Also:
        PM.setPMCounter(int count)
      • updateJpSeqInUse

        public void updateJpSeqInUse()
                              throws MXException,
                                     java.rmi.RemoteException
        sets/clears the 'jpseqinuse' attribute depending on the pmsequence record
        when the PM has multiple jobplans listed, or a single jobplan with interval greater than 1, the 'jpseqinuse' flag is set.
        When the PM doesnot have any jobplan in use, the 'jpseqinuse' flag is cleared.
        Throws:
        MXException
        java.rmi.RemoteException
      • copyNextJobPlan

        public void copyNextJobPlan()
                             throws MXException,
                                    java.rmi.RemoteException
        Whenever there is a jobplan/multiple jobplans listed for a PM, this method is called to copy the next jobplan to be used. The jobplan with lower interval is copied to the PM's jobplan field.
        Throws:
        MXException
        java.rmi.RemoteException
        See Also:
        PM.getJobPlanToUse()
      • canViewJpSequence

        public void canViewJpSequence()
                               throws MXException,
                                      java.rmi.RemoteException
        Method to find whether jobplan sequence can be viewed or not.
        Specified by:
        canViewJpSequence in interface PMRemote
        Throws:
        MXException - If jpseqinuse is 'false' then MXApplicationException("PM","noJpSequence")
        java.rmi.RemoteException
        See Also:
        PM.viewJpSequence()
      • viewJpSequence

        public MboSetRemote viewJpSequence()
                                    throws MXException,
                                           java.rmi.RemoteException
        Method to show a projected list of the job plan sequencing for a PM. This method can only be called when 'jpseqinuse' is true.
        There may be empty strings("") for jpnum and '0' for interval in the returned MboSet
        Specified by:
        viewJpSequence in interface PMRemote
        Returns:
        A MboSetRemote A MboSet that contains record with jpnum and interval values.
        Throws:
        MXException
        java.rmi.RemoteException
        See Also:
        PM.canViewJpSequence()
      • clearNextDueDate

        public void clearNextDueDate()
                              throws java.rmi.RemoteException,
                                     MXException
        clears/sets the nextduedate (PM.Nextdate), depending on the frequency.
        Throws:
        MXException
        java.rmi.RemoteException
      • getGeneratedWonum

        public java.lang.String getGeneratedWonum(int priority)
                                           throws java.rmi.RemoteException,
                                                  MXException
        Method that gets the wonum of a workorder generated by a top level PM.
        sets the WORKORDER.priority and WORKORDER.calcpriority to the input priority value if it is greater than zero. Else copies the PM's priority info to both WORKORDER.priority and WORKORDER.calcpriority attributes
        Specified by:
        getGeneratedWonum in interface PMRemote
        Parameters:
        priority - The priority to be set to the newly generated workorder's wopriority and Calcpriority
        Returns:
        Work order number of the generated Workorder
        Throws:
        MXException
        java.rmi.RemoteException
        See Also:
        psdi.app.pm.PM#generateWork()
      • duplicate

        public MboRemote duplicate()
                            throws MXException,
                                   java.rmi.RemoteException
        This method creates a duplicate record for PM and related objects(PMSequence). The duplicated PM's pmnum will be an autokeyed value or blank if the autokey is switched "off".
        Specified by:
        duplicate in interface MboRemote
        Overrides:
        duplicate in class Mbo
        Returns:
        MboRemote The newly duplicated PM
        Throws:
        MXException
        java.rmi.RemoteException
      • isChangeByUserWhenSetFromLookup

        public boolean isChangeByUserWhenSetFromLookup(java.lang.String lookupAttrName,
                                                       java.lang.String attributeName)
        Indicates whether the CHANGEDBY_USER flag should be set for attributes on this Mbo when their values are set (along with other key fields) via lookup.
        Overrides:
        isChangeByUserWhenSetFromLookup in class Mbo
        Parameters:
        lookupAttrName - the attribute whose lookup is being called.
        attributeName - the attribute that is not the lookup attribute.
        Returns:
      • skipCopyField

        protected boolean skipCopyField(MboValueInfo mvi)
                                 throws java.rmi.RemoteException,
                                        MXException
        This method overrides the skipCopyField() in the PM. This method takes the MboValueInfo as its parameter to see if this field needs to be copied or skipped.If this field does not need to be copied, it returns true. The following fields donot get copied from the source PM to the target PM.
        • pmnum
        • pmcounter
        • firstdate
        • laststartdate
        • lastcompdate
        • nextdate
        • extdate
        • haschildren
        • parent
        • changeDate
        • forecastexists
        • LtdPMCounter
        Overrides:
        skipCopyField in class Mbo
        Parameters:
        mvi - The MboValueInfo object of the MboValue that needs to be copied.
        Returns:
        True,if the field does not need to be copied.In all other cases return false.
        Throws:
        MXException
        java.rmi.RemoteException
      • getHierGenDate

        protected java.util.Date getHierGenDate(boolean useFreqCrit,
                                                MboSetRemote pmHierSet,
                                                MboSetRemote woInfo,
                                                java.util.Date slackDate,
                                                boolean woCreated)
                                         throws MXException,
                                                java.rmi.RemoteException
        Throws:
        MXException
        java.rmi.RemoteException
      • checkForOpenWO

        public boolean checkForOpenWO()
                               throws java.rmi.RemoteException,
                                      MXException
        Throws:
        java.rmi.RemoteException
        MXException
      • origGetHierGenDate

        protected java.util.Date origGetHierGenDate(boolean useFreqCrit,
                                                    MboSetRemote pmHierSet,
                                                    MboSetRemote woInfo,
                                                    java.util.Date slackDate,
                                                    boolean woCreated)
                                             throws MXException,
                                                    java.rmi.RemoteException
        This method calculates the next workorder generation date for the PM hierarchy. This method gets called from wogen().
        Parameters:
        useFreqCrit - Flag whether to use the PM's frequency criteria or not.
        pmHierSet - This is the PMSet for which the next genertion date needs to be calculated. This PMSet can be obtained using the relationtship HIERARCHY.
        woInfo - If this work generation is done just to get the work order information, this set stores the work infomation. This is a set of Wogen. If this parameter is null, the work orders are saved in the database.
        slackDate - Slack Time
        Returns:
        hierGenDate The next generation date for the PM hierarchy.
        Throws:
        MXException
        java.rmi.RemoteException
        See Also:
        PM.wogen(boolean, int, boolean, psdi.mbo.MboRemote)
      • isTop

        public boolean isTop()
                      throws MXException,
                             java.rmi.RemoteException
        This method indicates if the Mbo is at the top level of a hierarchy.
        Returns:
        Returns true if Mbo is top level.
        Throws:
        MXException
        java.rmi.RemoteException
      • hasChildren

        public boolean hasChildren()
                            throws MXException,
                                   java.rmi.RemoteException
        Indicates that this Mbo has Mbos underneath it in the hierarchy
        Returns:
        Returns true if the Mbo has sub-Mbos
        Throws:
        MXException
        java.rmi.RemoteException
      • hasParents

        public boolean hasParents()
                           throws MXException,
                                  java.rmi.RemoteException
        Indicates that this Mbo is owned by another Mbo in the hierarchy.
        Returns:
        Returns true if the Mbo has a parent.
        Throws:
        MXException
        java.rmi.RemoteException
      • getChildren

        public MboSetRemote getChildren()
                                 throws MXException,
                                        java.rmi.RemoteException
        Gets the MboSet representing the children of this Mbo in the hierarchy. Uses the relationship "CHILDREN".
        Returns:
        Children MboSet.
        Throws:
        MXException
        java.rmi.RemoteException
      • getParents

        public MboSetRemote getParents()
                                throws MXException,
                                       java.rmi.RemoteException
        Gets the MboSet representing the parents of this Mbo in the hierarchy. Usually this set consists of zero or one members. Uses the relationship "PARENT".
        Returns:
        Parent MboSet
        Throws:
        MXException
        java.rmi.RemoteException
      • getTop

        public MboSetRemote getTop()
                            throws MXException,
                                   java.rmi.RemoteException
        Gets the MboSet representing top-level Mbos above this Mbo in the hierarchy. Usually this set consists of one member. If the Mbo is top-level the set will contain this Mbo.
        Specified by:
        getTop in interface PMRemote
        Returns:
        Top-Level MboSet
        Throws:
        MXException
        java.rmi.RemoteException
        See Also:
        PM.getTop()
      • getHierarchies

        public java.lang.String[] getHierarchies()
                                          throws MXException,
                                                 java.rmi.RemoteException
        For Mbos that support multiple hiearchies, this method returns the names of all the hierarchy this Mbo is a member of. There may be zero to many values in the array returned.
        Returns:
        Array of hierarchy names. Null if multiple hierarchies is not supported.
        Throws:
        MXException
        java.rmi.RemoteException
      • calculateGenerationDate

        protected java.util.Date calculateGenerationDate(java.util.Date slackDate,
                                                         boolean doGenWO)
                                                  throws java.rmi.RemoteException,
                                                         MXException
        used for work order generation, calculates work order generation date for this PM
        Parameters:
        slackDate - This is the last day of the user supplied slack time. A PM may return a value greater than this given it's internal lead time.
        doGenWO - If only calculating work, ignore the PM's internal lead time.
        Returns:
        Next due date for the PM. If the PM's next due date is outside of the total slack time (user parameter + PM's own lead time), null is returned.
        Throws:
        MXException
        java.rmi.RemoteException
      • getMeterNextDueDate

        public java.util.Date getMeterNextDueDate(MboRemote pmMeter,
                                                  boolean assetMeter)
                                           throws java.rmi.RemoteException,
                                                  MXException
        Finds the next generation date for a PMMeter. If no date can be generated for this PMMeter, null will be returned. If PM forecast generation then add (frequency/average) to the next due date if UseTargetDate is false and there are open workorders and next due date is today's date. If PM forecast generation then add job plan duration to the next due date if UseTargetDate is false .
        Parameters:
        pmMeter - PMMeter for which the due date is calculated
        assetMeter - flag that indicates whether the PMMeter is an assetmeter or locationmeter.
        Returns:
        Date Meter next due date
        Throws:
        MXException
        java.rmi.RemoteException
      • addJobPlanDuration

        public java.util.Date addJobPlanDuration(java.util.Date dueDate,
                                                 MboRemote retWOGen)
                                          throws java.rmi.RemoteException,
                                                 MXException
        Throws:
        java.rmi.RemoteException
        MXException
      • getMeterNextDueDateNoForecast

        public java.util.Date getMeterNextDueDateNoForecast(MboRemote pmMeter,
                                                            boolean assetMeter)
                                                     throws java.rmi.RemoteException,
                                                            MXException
        Finds the next generation date for a PMMeter. If no date can be generated for this PMMeter, null will be returned.
        Parameters:
        pmMeter - PMMeter for which the due date is calculated
        assetMeter - flag that indicates whether the PMMeter is an assetmeter or locationmeter.
        Returns:
        Date Meter next due date
        Throws:
        MXException
        java.rmi.RemoteException
      • getDueDateOnAbsoluteMeterReading

        protected java.util.Date getDueDateOnAbsoluteMeterReading()
                                                           throws java.rmi.RemoteException,
                                                                  MXException
        Returns the work order generation date for the PM just based on the absolute meter readings from the PM and the Asset Meter Readings.
        Returns:
        pmDueDate Work Order Generation date for the PM
        Throws:
        java.rmi.RemoteException - the remote exception
        MXException - the mX exception
      • getDueDateOnAbsoluteMeterReading

        protected java.util.Date getDueDateOnAbsoluteMeterReading(MboRemote assetLocMeterMbo)
                                                           throws java.rmi.RemoteException,
                                                                  MXException
        Returns the work order generation date for the PM just based on the absolute meter readings from the PM and the asset's or location's Meter Readings when work order generation is invoked automatically. Only use this method in code that is part of automatic asset @link AssetRemote.autoWogen(MboRemote) or location meter-based work order generation. Otherwise, use PM.getDueDateOnAbsoluteMeterReading().
        Parameters:
        assetLocMeterMbo - the asset loc meter mbo
        Returns:
        pmDueDate Work Order Generation date for the PM
        Throws:
        java.rmi.RemoteException - the remote exception
        MXException - the mX exception
        See Also:
        PMService.BackGroundWogen.run()
      • getTimeDate

        public java.util.Date getTimeDate()
                                   throws java.rmi.RemoteException,
                                          MXException
        calculates the time based Due Date for work order generation.
        Specified by:
        getTimeDate in interface PMRemote
        Returns:
        timebasedDueDate Time based due date for work order generation
        Throws:
        java.rmi.RemoteException - the remote exception
        MXException - the mX exception
        See Also:
        PM.getTimeDate()
      • checkFrequency

        public java.util.Date checkFrequency(int frequency,
                                             java.util.Date nextDueDate,
                                             int unit)
                                      throws java.rmi.RemoteException,
                                             MXException
        Return the next date.
        Parameters:
        frequency -
        nextDueDate -
        Returns:
        Date
        Throws:
        MXException
        java.rmi.RemoteException
      • validateTimeBasedFreq

        public void validateTimeBasedFreq(double frequency)
                                   throws MXException,
                                          java.rmi.RemoteException
        Validate time based frequency based on the frequncy units provided
        Parameters:
        frequency -
        Throws:
        MXException
        java.rmi.RemoteException
      • setEarliestNextDueDate

        public void setEarliestNextDueDate()
                                    throws MXException,
                                           java.rmi.RemoteException
        Set the Earliest next work order generation date. Get the earliest date of PM.Nextdate PM.extdate and PMMeter.DateOfNextWO
        Throws:
        MXException
        java.rmi.RemoteException
      • woCancel

        public void woCancel(WORemote newWO)
                      throws MXException,
                             java.rmi.RemoteException
        Wo cancel.
        Parameters:
        newWO - the new wo
        Throws:
        MXException - the mX exception
        java.rmi.RemoteException - the remote exception
      • truncateHierarchy

        public boolean truncateHierarchy(boolean forecast)
                                  throws java.rmi.RemoteException,
                                         MXException
        Determines if this PM and hierarchy below it can be included in the forecast. Will truncate hierarchy depending on the return value.
        Parameters:
        forecast - Flag indicates forecasting or work generation.
        Returns:
        false If this PM can be included in the forecast, true if this PM cannot be included in the forecast
        Throws:
        MXException
        java.rmi.RemoteException
      • includeInForecast

        public boolean includeInForecast()
                                  throws java.rmi.RemoteException,
                                         MXException
        Throws:
        java.rmi.RemoteException
        MXException
      • getDueDateForOpenWO

        public java.util.Date getDueDateForOpenWO(MboRemote openWo)
                                           throws java.rmi.RemoteException,
                                                  MXException
        Throws:
        java.rmi.RemoteException
        MXException
      • getDueDateForOpenWOWithoutFrequency

        public java.util.Date getDueDateForOpenWOWithoutFrequency(MboRemote openWo)
                                                           throws java.rmi.RemoteException,
                                                                  MXException
        Throws:
        java.rmi.RemoteException
        MXException
      • controlScheduleEarlyOnFreqConflictFlag

        public void controlScheduleEarlyOnFreqConflictFlag(boolean reset)
                                                    throws java.rmi.RemoteException,
                                                           MXException
        Checks if Schedule Early on Frequency Conflict flag is enabled
        Schedule Early on Frequency Conflict is not accessible in the following two cases: When PM Frequency < 7 Days When the PM carries a Meter-Based Frequency
        Parameters:
        reset - - true if wants to reset the flag to false if Schedule Early on Frequency Conflict is a readonly field.
        Throws:
        java.rmi.RemoteException
        MXException
      • isFrequencyValidForEarlySchedConflict

        public boolean isFrequencyValidForEarlySchedConflict()
                                                      throws java.rmi.RemoteException,
                                                             MXException
        Check if PM.Frequency value is valid for Early Schedule Conflicts Rule: Must be greater then 7 days to be valid
        Returns:
        Throws:
        java.rmi.RemoteException
        MXException
      • isFrequencyValidForEarlySchedConflict

        public boolean isFrequencyValidForEarlySchedConflict(long frequency)
                                                      throws java.rmi.RemoteException,
                                                             MXException
        Check if a given Frequency value is valid for Early Schedule Conflicts Rule: Must be greater then 7 days to be valid
        Returns:
        Throws:
        java.rmi.RemoteException
        MXException
      • enableScheduleEarlyOnFreqConflict

        public void enableScheduleEarlyOnFreqConflict(boolean enable,
                                                      boolean reset)
                                               throws java.rmi.RemoteException,
                                                      MXException
        Parameters:
        enable -
        reset -
        Throws:
        java.rmi.RemoteException
        MXException
      • getNextActiveStartDate

        protected java.util.Date getNextActiveStartDate(java.util.Date dtDate)
                                                 throws java.rmi.RemoteException,
                                                        MXException
        Return the Next Active Date for a start date if dtDate is not Active increments days until a Active Date be found. Used to figure out Season Start Date when Schedule Early on Frequency Conflict is TRUE
        Throws:
        java.rmi.RemoteException
        MXException
      • getActiveDaysAddOn

        public java.util.Date getActiveDaysAddOn(java.util.Date dtDate)
                                          throws java.rmi.RemoteException,
                                                 MXException
        Throws:
        java.rmi.RemoteException
        MXException
      • generateForecast

        public void generateForecast(java.lang.String genDuration)
                              throws java.rmi.RemoteException,
                                     MXException
        Description copied from interface: PMAppActionInterface
        Generates forecast records for this PM.
        Specified by:
        generateForecast in interface PMAppActionInterface
        Parameters:
        genDuration - The number of days ahead to generate forecast for in the format of string.
        Throws:
        java.rmi.RemoteException
        MXException
      • generateForecast

        public void generateForecast(int genDuration)
                              throws java.rmi.RemoteException,
                                     MXException
        Generates forecast records for this PM.
        Specified by:
        generateForecast in interface PMRemote
        Parameters:
        genDuration - The number of days ahead to generate forecast for.
        Throws:
        MXException
        java.rmi.RemoteException
        See Also:
        psdi.skd.app.pm.PM#generateForecast(int genDuration)
      • throwForecastWarning

        public void throwForecastWarning(MXException exception)
                                  throws MXException,
                                         java.rmi.RemoteException
        Throws:
        MXException
        java.rmi.RemoteException
      • setPMForReForecast

        public int setPMForReForecast(PM tempPM,
                                      int genDuration)
                               throws MXException,
                                      java.rmi.RemoteException
        Throws:
        MXException
        java.rmi.RemoteException
      • getReForecastingNextDate

        public java.util.Date getReForecastingNextDate(java.util.Date fromDate)
                                                throws MXException,
                                                       java.rmi.RemoteException
        Calculates the ReForecasting NextDate based on the PM's day frequency and the passed on fromDate. This is the date when this PM will next generate a forecast
        Parameters:
        fromDate - The last forecasted date
        Returns:
        The next date to forecast
        Throws:
        MXException
        java.rmi.RemoteException
      • getLastPMForecastRecord

        public MboRemote getLastPMForecastRecord()
                                          throws MXException,
                                                 java.rmi.RemoteException
        Throws:
        MXException
        java.rmi.RemoteException
      • getLastPMForecastDate

        public java.util.Date getLastPMForecastDate()
                                             throws MXException,
                                                    java.rmi.RemoteException
        Throws:
        MXException
        java.rmi.RemoteException
      • getFirstPMForecastRecord

        public MboRemote getFirstPMForecastRecord()
                                           throws MXException,
                                                  java.rmi.RemoteException
        Throws:
        MXException
        java.rmi.RemoteException
      • getFirstPMForecastDate

        public java.util.Date getFirstPMForecastDate()
                                              throws MXException,
                                                     java.rmi.RemoteException
        Throws:
        MXException
        java.rmi.RemoteException
      • isFirstForecastRecord

        public boolean isFirstForecastRecord(PMForecast pmForecast)
                                      throws MXException,
                                             java.rmi.RemoteException
        Throws:
        MXException
        java.rmi.RemoteException
      • canReforecastForUntilDate

        public void canReforecastForUntilDate(java.util.Date lastForecastDate,
                                              java.util.Date untilDate)
                                       throws MXException,
                                              java.rmi.RemoteException
        Throws:
        MXException
        java.rmi.RemoteException
      • deleteSetForecast

        public void deleteSetForecast()
                               throws MXException,
                                      java.rmi.RemoteException
        Throws:
        MXException
        java.rmi.RemoteException
      • canDeletePMForecast

        public void canDeletePMForecast()
                                 throws MXException,
                                        java.rmi.RemoteException
        Specified by:
        canDeletePMForecast in interface PMRemote
        Throws:
        MXException
        java.rmi.RemoteException
        See Also:
        psdi.skd.app.pm.PM#canDeletePMForecast()
      • deleteForecast

        public void deleteForecast()
                            throws MXException,
                                   java.rmi.RemoteException
        Specified by:
        deleteForecast in interface PMRemote
        Throws:
        MXException
        java.rmi.RemoteException
        See Also:
        psdi.skd.app.pm.PM#deleteForecast()
      • deletePMForecast

        public void deletePMForecast()
                              throws MXException,
                                     java.rmi.RemoteException
        Specified by:
        deletePMForecast in interface PMRemote
        Throws:
        MXException
        java.rmi.RemoteException
        See Also:
        psdi.skd.app.pm.PM#deletePMForecast()
      • deleteForecastForPMHierarchy

        public void deleteForecastForPMHierarchy()
                                          throws MXException,
                                                 java.rmi.RemoteException
        Throws:
        MXException
        java.rmi.RemoteException
      • deleteForecastForHierarchyChange

        public void deleteForecastForHierarchyChange()
                                              throws MXException,
                                                     java.rmi.RemoteException
        Throws:
        MXException
        java.rmi.RemoteException
      • canDeleteForecast

        public boolean canDeleteForecast(java.lang.String message)
                                  throws MXException,
                                         java.rmi.RemoteException
        Throws:
        MXException
        java.rmi.RemoteException
      • canDeleteForecast

        public boolean canDeleteForecast(java.lang.String message,
                                         MboValue fieldValue)
                                  throws MXException,
                                         java.rmi.RemoteException
        Throws:
        MXException
        java.rmi.RemoteException
      • canDisplayForecast

        public boolean canDisplayForecast()
                                   throws MXException,
                                          java.rmi.RemoteException
        Specified by:
        canDisplayForecast in interface PMRemote
        Throws:
        MXException
        java.rmi.RemoteException
        See Also:
        psdi.skd.app.pm.PM#canDisplayForecast()
      • rolldownLockForecastFlagToChildren

        public void rolldownLockForecastFlagToChildren(boolean torf)
                                                throws MXException,
                                                       java.rmi.RemoteException
        Throws:
        MXException
        java.rmi.RemoteException
      • rolldownInclForecastFlagToChildren

        public void rolldownInclForecastFlagToChildren(boolean torf)
                                                throws MXException,
                                                       java.rmi.RemoteException
        Throws:
        MXException
        java.rmi.RemoteException
      • rolldownFieldValueToChildrens

        public void rolldownFieldValueToChildrens(java.lang.String fieldname,
                                                  java.lang.String fieldvalue,
                                                  long accessModifier)
                                           throws MXException,
                                                  java.rmi.RemoteException
        Throws:
        MXException
        java.rmi.RemoteException
      • canGenerateChildPMForecast

        public void canGenerateChildPMForecast()
                                        throws MXException,
                                               java.rmi.RemoteException
        Specified by:
        canGenerateChildPMForecast in interface PMRemote
        Throws:
        MXException
        java.rmi.RemoteException
        See Also:
        psdi.skd.app.pm.PM#canGenerateChildPMForecast()
      • setCanDeleteForecastFlag

        public void setCanDeleteForecastFlag(boolean flag)
                                      throws MXException,
                                             java.rmi.RemoteException
        Specified by:
        setCanDeleteForecastFlag in interface PMRemote
        Throws:
        MXException
        java.rmi.RemoteException
        See Also:
        psdi.skd.app.pm.PM#setCanDeleteForecastFlag(boolean flag)
      • getCanDeleteForecastFlag

        public boolean getCanDeleteForecastFlag()
      • reforecastSubsequentDates

        public void reforecastSubsequentDates()
                                       throws java.rmi.RemoteException,
                                              MXException
        Specified by:
        reforecastSubsequentDates in interface PMRemote
        Throws:
        java.rmi.RemoteException
        MXException
        See Also:
        psdi.skd.app.pm.PM#reforecastSubsequentDates()
      • reforecastSubsequentDates

        public void reforecastSubsequentDates(PMForecast newDatePMForecast)
                                       throws java.rmi.RemoteException,
                                              MXException
        Throws:
        java.rmi.RemoteException
        MXException
      • reforecastSubsequentDates

        public void reforecastSubsequentDates(MboRemote newDatePMForecast,
                                              MboSetRemote pmForecastSet)
                                       throws java.rmi.RemoteException,
                                              MXException
        Specified by:
        reforecastSubsequentDates in interface PMRemote
        Throws:
        java.rmi.RemoteException
        MXException
        See Also:
        psdi.skd.app.pm.PM#reforecastSubsequentDates(MboRemote newDatePMForecast, MboSetRemote pmForecastSet)
      • setPMForReforecastSubsequentDates

        public void setPMForReforecastSubsequentDates(java.util.Date newDate)
                                               throws java.rmi.RemoteException,
                                                      MXException
        Throws:
        java.rmi.RemoteException
        MXException
      • getCalendarTime

        public java.util.Calendar getCalendarTime(java.util.Date date)
      • getDurationBetweenTwoDates

        public int getDurationBetweenTwoDates(java.util.Date toDate,
                                              java.util.Date fromDate)
      • canReforecast

        public boolean canReforecast()
                              throws MXException,
                                     java.rmi.RemoteException
        Specified by:
        canReforecast in interface PMRemote
        Throws:
        MXException
        java.rmi.RemoteException
        See Also:
        psdi.skd.app.pm.PM#canReforecast(boolean lockForecast)
      • setUserChoiceForReforecast

        public void setUserChoiceForReforecast(int userChoiceForReforecast)
                                        throws MXException,
                                               java.rmi.RemoteException
        Specified by:
        setUserChoiceForReforecast in interface PMRemote
        Throws:
        MXException
        java.rmi.RemoteException
        See Also:
        psdi.skd.app.pm.PM#setUserChoiceForReforecast(boolean lockForecast)
      • getUserChoiceForReforecast

        public int getUserChoiceForReforecast()
                                       throws MXException,
                                              java.rmi.RemoteException
        Specified by:
        getUserChoiceForReforecast in interface PMRemote
        Throws:
        MXException
        java.rmi.RemoteException
        See Also:
        psdi.skd.app.pm.PM#getUserChoiceForReforecast(boolean lockForecast)
      • canReforecastSubsequentDates

        public int canReforecastSubsequentDates(PMForecast newDatePMForecast)
                                         throws MXException,
                                                java.rmi.RemoteException
        Throws:
        MXException
        java.rmi.RemoteException
      • clearReforecast

        public void clearReforecast()
                             throws MXException,
                                    java.rmi.RemoteException
        Specified by:
        clearReforecast in interface PMRemote
        Throws:
        MXException
        java.rmi.RemoteException
        See Also:
        psdi.skd.app.pm.PM#clearReforecast()
      • isReforecastPending

        public boolean isReforecastPending()
                                    throws MXException,
                                           java.rmi.RemoteException
        Specified by:
        isReforecastPending in interface PMRemote
        Throws:
        MXException
        java.rmi.RemoteException
        See Also:
        psdi.skd.app.pm.PM#isReforecastPending()
      • editOnlyFirstPMForecastRecord

        public boolean editOnlyFirstPMForecastRecord()
                                              throws MXException,
                                                     java.rmi.RemoteException
        Throws:
        MXException
        java.rmi.RemoteException
      • throwOKCANCELMessage

        public boolean throwOKCANCELMessage(java.lang.String message)
                                     throws MXException,
                                            java.rmi.RemoteException
        Throws:
        MXException
        java.rmi.RemoteException
      • setOnSKDPMListTab

        public void setOnSKDPMListTab(boolean listTab)
                               throws java.rmi.RemoteException
        Specified by:
        setOnSKDPMListTab in interface PMRemote
        Throws:
        java.rmi.RemoteException
        See Also:
        psdi.skd.app.pm.PM#setonSKDPMListTab(boolean listTab)
      • onSKDPMListTab

        public boolean onSKDPMListTab()
                               throws java.rmi.RemoteException
        Specified by:
        onSKDPMListTab in interface PMRemote
        Throws:
        java.rmi.RemoteException
        See Also:
        psdi.skd.app.pm.PM#onSKDPMListTab()
      • resetlastPMForecastRecord

        public void resetlastPMForecastRecord()
      • setDeleteForecastFlag

        public void setDeleteForecastFlag(boolean flag)
                                   throws java.rmi.RemoteException
        Specified by:
        setDeleteForecastFlag in interface PMRemote
        Throws:
        java.rmi.RemoteException
        See Also:
        psdi.skd.app.pm.PM#setDeleteForecastFlag(boolean flag)
      • getDeleteForecastFlag

        public boolean getDeleteForecastFlag()
                                      throws java.rmi.RemoteException
        Specified by:
        getDeleteForecastFlag in interface PMRemote
        Throws:
        java.rmi.RemoteException
        See Also:
        psdi.skd.app.pm.PM#getDeleteForecastFlag()
      • editPMDeleteForecast

        public void editPMDeleteForecast()
                                  throws MXException,
                                         java.rmi.RemoteException
        Throws:
        MXException
        java.rmi.RemoteException
      • editPMDeleteForecast

        public void editPMDeleteForecast(MboValue fieldValue)
                                  throws MXException,
                                         java.rmi.RemoteException
        Throws:
        MXException
        java.rmi.RemoteException
      • canUpdateForecastJobPlans

        public boolean canUpdateForecastJobPlans()
                                          throws MXException,
                                                 java.rmi.RemoteException
        Specified by:
        canUpdateForecastJobPlans in interface PMRemote
        Throws:
        MXException
        java.rmi.RemoteException
        See Also:
        psdi.skd.app.pm.PM#canUpdateForecastJobPlans(boolean flag)
      • updateForecastJobPlans

        public void updateForecastJobPlans()
                                    throws MXException,
                                           java.rmi.RemoteException
        Specified by:
        updateForecastJobPlans in interface PMRemote
        Throws:
        MXException
        java.rmi.RemoteException
        See Also:
        psdi.skd.app.pm.PM#updateForecastJobPlans(boolean flag)
      • addPlusCPMExtDate

        public void addPlusCPMExtDate(boolean setPrevDate,
                                      java.util.Date extdate,
                                      boolean hasToSave,
                                      java.lang.String comments,
                                      java.lang.String commentsLD)
                               throws java.rmi.RemoteException,
                                      MXException
        Add a new register to PLUSCPMEXTDATE table.
        Specified by:
        addPlusCPMExtDate in interface PMRemote
        Parameters:
        setPrevDate -
        extdate -
        hasToSave -
        comments -
        Throws:
        java.rmi.RemoteException
        MXException
      • addPlusCPMExtDate

        public void addPlusCPMExtDate(boolean setPrevDate,
                                      java.util.Date extdate,
                                      boolean hasToSave,
                                      java.lang.String comments)
                               throws java.rmi.RemoteException,
                                      MXException
        Add a new register to PLUSCPMEXTDATE table.
        Specified by:
        addPlusCPMExtDate in interface PMRemote
        Parameters:
        setPrevDate -
        extdate -
        hasToSave -
        comments -
        Throws:
        java.rmi.RemoteException
        MXException
      • canAddPMExtDate

        public boolean canAddPMExtDate()
                                throws java.rmi.RemoteException,
                                       MXException
        Allow extdate to be overrided depending on PLUSCEXTDATE maxvar value.
        Specified by:
        canAddPMExtDate in interface PMRemote
        Returns:
        boolean
        Throws:
        java.rmi.RemoteException
        MXException
      • getAsset

        public AssetRemote getAsset()
                             throws MXException,
                                    java.rmi.RemoteException
        Get related asset mbo
        Returns:
        the related asset mbo
        Throws:
        MXException
        java.rmi.RemoteException
      • getLocation

        public LocationRemote getLocation()
                                   throws MXException,
                                          java.rmi.RemoteException
        Get related Location mbo
        Returns:
        the related Location mbo
        Throws:
        MXException
        java.rmi.RemoteException
      • canOverride

        public void canOverride()
                         throws java.rmi.RemoteException,
                                MXException
        Throws:
        java.rmi.RemoteException
        MXException
      • getWorkType

        public java.lang.String getWorkType()
                                     throws MXException,
                                            java.rmi.RemoteException
        Returns this workorder's WORKTYPE TYPE attribute value, converted to the internal (not translated) representation.
        Returns:
        TYPE of this workorder's WORKTYPE
        Throws:
        MXException
        java.rmi.RemoteException
      • getWorkTypeCal

        public java.lang.String getWorkTypeCal()
                                        throws java.rmi.RemoteException,
                                               MXException
        Returns the value of the PLUSCWORKTYPECAL maxvar, which determines the type of worktype that marks a workorder a calibration.
        Returns:
        value of the PLUSCWORKTYPECAL maxvar
        Throws:
        java.rmi.RemoteException
        MXException
      • isCalibrationInstalled

        public boolean isCalibrationInstalled()
                                       throws MXException,
                                              java.rmi.RemoteException
        Return true if License Key CALIBRATION is installed.
        Returns:
        Throws:
        MXException
        java.rmi.RemoteException
      • generateWork

        public void generateWork(java.lang.String useFreqCritLeadTime)
                          throws java.rmi.RemoteException,
                                 MXException
        Description copied from interface: PMAppActionInterface
        Generates work orders from this PM. After each work order is created, it is saved. The log records the generation process. If the generation process fails in mid-generation use the log to correct your records.
        Although this method may set the value of the Parent attribute, it ignores that field's validation and business rules.
        After this method completes, the PMSet and PM should be refreshed in order to reflect the changes.
        Specified by:
        generateWork in interface PMAppActionInterface
        Parameters:
        useFreqCritLeadTime - String value indicating PM's frequency criteria and lead time separated by :
        Throws:
        java.rmi.RemoteException
        MXException
      • regenerateForecast

        public int regenerateForecast(java.lang.String message)
                               throws MXException,
                                      java.rmi.RemoteException
        Throws:
        MXException
        java.rmi.RemoteException
      • forecastDateBeforeToday

        public boolean forecastDateBeforeToday(MboRemote pmforecast)
                                        throws java.rmi.RemoteException,
                                               MXException
        Throws:
        java.rmi.RemoteException
        MXException
      • checkForecastForGenWork

        public void checkForecastForGenWork()
                                     throws java.rmi.RemoteException,
                                            MXException
        Throws:
        java.rmi.RemoteException
        MXException
      • canGenerateForecastWork

        public int canGenerateForecastWork(boolean useFreqCrit)
                                    throws java.rmi.RemoteException,
                                           MXException
        Throws:
        java.rmi.RemoteException
        MXException
      • lockUnlockForecast

        public void lockUnlockForecast(boolean lockForecast)
                                throws java.rmi.RemoteException,
                                       MXException
        Specified by:
        lockUnlockForecast in interface PMRemote
        Throws:
        java.rmi.RemoteException
        MXException
        See Also:
        psdi.skd.app.pm.PM#lockUnlockForecast(boolean lockForecast)
      • checkJPSeq

        public boolean checkJPSeq()
                           throws MXException,
                                  java.rmi.RemoteException
        Throws:
        MXException
        java.rmi.RemoteException
      • AddPMForecastJPRecord

        public void AddPMForecastJPRecord(java.lang.String rootancestor,
                                          MboRemote cancelledWO)
                                   throws MXException,
                                          java.rmi.RemoteException
        Throws:
        MXException
        java.rmi.RemoteException
      • canLockUnlockChildPMForecast

        public void canLockUnlockChildPMForecast()
                                          throws MXException,
                                                 java.rmi.RemoteException
        Specified by:
        canLockUnlockChildPMForecast in interface PMRemote
        Throws:
        MXException
        java.rmi.RemoteException
        See Also:
        psdi.skd.app.pm.SKDPM#canLockUnlockChildPMForecast()
      • hasForecast

        public boolean hasForecast()
                            throws MXException,
                                   java.rmi.RemoteException
        Indicates if the PM has forecast.
        Returns:
        Returns true if the PM has forecast
        Throws:
        MXException
        java.rmi.RemoteException
      • clearPmDeleteForecastVector

        public void clearPmDeleteForecastVector()
      • validateFields

        protected void validateFields()
                               throws MXException,
                                      java.rmi.RemoteException
        Validate fields.
        Throws:
        MXException - the mX exception
        java.rmi.RemoteException - the remote exception
      • isListSelected

        public boolean isListSelected()
                               throws MXException,
                                      java.rmi.RemoteException
        Checks if is list selected.
        Specified by:
        isListSelected in interface PMRemote
        Returns:
        the isListSelected
        Throws:
        MXException - the mX exception
        java.rmi.RemoteException - the remote exception
      • setListSelected

        public void setListSelected(boolean isListSelected)
                             throws MXException,
                                    java.rmi.RemoteException
        Sets the list selected.
        Specified by:
        setListSelected in interface PMRemote
        Parameters:
        isListSelected - the isListSelected to set
        Throws:
        MXException - the mX exception
        java.rmi.RemoteException - the remote exception
      • isAssetLocationNotNull

        protected boolean isAssetLocationNotNull()
                                          throws MXException,
                                                 java.rmi.RemoteException
        Helper method, to facilitate IS override. Checks if is asset location not null.
        Returns:
        true, if is asset location not null
        Throws:
        MXException - the mX exception
        java.rmi.RemoteException - the remote exception
      • updateMeterValuesAssetLoc

        protected void updateMeterValuesAssetLoc(boolean fromWoComplete)
                                          throws MXException,
                                                 java.rmi.RemoteException
        Helper method, to facilitate IS override. Update meter values asset loc.
        Parameters:
        fromWoComplete - the from wo complete
        Throws:
        MXException - the mX exception
        java.rmi.RemoteException - the remote exception
      • updateMeterValuesAssetLocForecast

        protected void updateMeterValuesAssetLocForecast(PM thisPM)
                                                  throws MXException,
                                                         java.rmi.RemoteException
        Helper method, to facilitate IS override. Update meter values asset loc forecast.
        Parameters:
        thisPM - the this pm
        Throws:
        MXException - the mX exception
        java.rmi.RemoteException - the remote exception
      • checkAssetLocNotReadyException

        protected void checkAssetLocNotReadyException()
                                               throws MXException,
                                                      java.rmi.RemoteException
        Helper method, to facilitate IS override. Check asset loc not ready exception.
        Throws:
        MXException - the mX exception
        java.rmi.RemoteException - the remote exception
      • checkAssetLocNotReadyWarning

        protected boolean checkAssetLocNotReadyWarning(PM childPM,
                                                       MboSetRemote pmSet)
                                                throws MXException,
                                                       java.rmi.RemoteException
        Helper method, to facilitate IS override. Check asset loc not ready warning.
        Parameters:
        childPM - the child pm
        pmSet - the pm set
        Returns:
        true, if successful
        Throws:
        MXException - the mX exception
        java.rmi.RemoteException - the remote exception
      • checkAssetLocNotReady

        protected boolean checkAssetLocNotReady(PM thisPM)
                                         throws MXException,
                                                java.rmi.RemoteException
        Helper method, to facilitate IS override. Check asset loc not ready.
        Parameters:
        thisPM - the this pm
        Returns:
        true, if successful
        Throws:
        MXException - the mX exception
        java.rmi.RemoteException - the remote exception
      • setRetWOGenAssetLoc

        protected void setRetWOGenAssetLoc(MboRemote retWOGen)
                                    throws MXException,
                                           java.rmi.RemoteException
        Helper method, to facilitate IS override. Sets the ret wo gen asset loc.
        Parameters:
        retWOGen - the new ret wo gen asset loc
        Throws:
        MXException - the mX exception
        java.rmi.RemoteException - the remote exception
      • getDateWithServerTimeZone

        public java.util.Date getDateWithServerTimeZone(java.util.Date date)
                                                 throws MXException,
                                                        java.rmi.RemoteException
        Throws:
        MXException
        java.rmi.RemoteException
      • getDateWithObjectTimeZone

        public java.util.Date getDateWithObjectTimeZone(java.util.Date date)
                                                 throws MXException,
                                                        java.rmi.RemoteException
        Throws:
        MXException
        java.rmi.RemoteException
      • getResourcesForForecastSegement

        public void getResourcesForForecastSegement(MboRemote jobplan,
                                                    MboRemote pmforecastJP)
                                             throws MXException,
                                                    java.rmi.RemoteException
        Throws:
        MXException
        java.rmi.RemoteException
      • getEarliestOrLatestDate

        protected java.util.Date getEarliestOrLatestDate(java.util.Date Date1,
                                                         java.util.Date Date2)
                                                  throws MXException,
                                                         java.rmi.RemoteException
        Throws:
        MXException
        java.rmi.RemoteException
      • getJPNumWithDate

        public java.lang.String getJPNumWithDate(java.util.Date date,
                                                 java.lang.String jpnum)
                                          throws MXException,
                                                 java.rmi.RemoteException
        Throws:
        MXException
        java.rmi.RemoteException
      • getWOSavedInDB

        public MboRemote getWOSavedInDB(MboRemote woGenerated)
                                 throws MXException,
                                        java.rmi.RemoteException
        IJ23921: returns the same wo that has been saved in db
        Parameters:
        woGenerated - - new wo generated by pm generateworkorder.
        Returns:
        Throws:
        MXException
        java.rmi.RemoteException