psdi.app.location

Class Location

  • All Implemented Interfaces:
    AutoLocatable, GISable, AddressableMbo, java.rmi.Remote, AncMbo, LocationRemote, AppActionInterface, HierarchicalMboRemote, MboConstants, MboRemote, StatefulMboRemote, MaxRemoteProxy


    public class Location
    extends StatefulMbo
    implements LocationRemote, HierarchicalMboRemote, AddressableMbo, AncMbo
    MBO to represent Locations. See the Location package description for details.

    This is a site level object.

    The key attributes for this object are SiteId and Location.

    The attributes in this object are as follows:

    Attribute Name Description
    BillToAddressCode Default bill to address code for storerooms only.
    BillToLaborCode Default bill to labor code for storerooms only.
    CalNum Non-persistent attribute used to maintain LocOper.CalNum through the Location object. For operating locations only. See the CalNum attribute defined in LocOper for more information.
    ChangeBy, ChangeDate Name of the user who last updated this object and date of last change.
    ClassStructureId Identifier of the class structure associated with this location.
    ControlAcc Inventory Control Account. Used to track the material issues and receipts for the location. When receving an item, this account is debited. When issuing an item, this account is credited. For STOREROOM, LABOR, and COURIER types of locations only.
    CurVarAcc Currency Variance Account. Used to track the differences between the receipt price and the invoice price that result from changes in the exchange rate. This account is paired with the inventory control account; when the currency variance account's value decreases, the inventory control account's value decreases. For storeroom locations only. Tracked by storeroom location, not by item.
    Description Description of the location. Long description enabled.
    Disabled Indicates whether or not the location is disabled.
    FailureCode Non-persistent attribute used to maintain LocOper.FailureCode through the Location object. For operating locations only. See the FailureCode attribute defined in LocOper for more information.
    GISParam1 thru GISParam3 Unused attributes. Will be removed in a future release.
    GLAccount General Ledger Account. Used to track expenses for this location.
    InvCostAdjAcc Inventory Cost Adjustment Account. Used to track changes in either the average price or the standard price, resulting from using the Adjust Average Cost and Adjust Standard Cost actions, respectively. For storeroom locations only. Tracked by storeroom location, not by item.
    InvoiceVarAcc Invoice Variance Account. Used to track variances in the price, expressed in the vendor's currency, between receipt and invoice for the location. The transaction amount is positive when the invoice line cost is greater than the receipt cost. For storeroom locations only. Tracked by storeroom location, not by item.
    ItemNum Non-persistant attribute used to maintain LocOper.ItemNum through the Location object. For operating locations only. See the ItemNum attribute defined in LocOper for more information.
    LDKey Long Description Key. This is a link to text stored in the LongDescription table.
    Location The identifier for the location.
    LocPriority Non-persistent attribute used to maintain LocOper.LocPriority through the Location object. For operating locations only. See the LocPriority attribute defined in LocOper for more information.
    NewPercent Non-persistent attribute to maintain LocLeadTime.NewpPrcent through the Location object. For storeroom locations only. See the NewPercent attribute defined in LocLeadTime for more information.
    OldControlAcc Last Inventory/Transit Control Account. See ControlAcc.
    OldInvCostAdjAcc Last Inventory Cost Adjustment Account. See InvCostAdjAcc.
    OldShrinkageAcc Last Shrinkage Cost Account. See ShrinkageAcc.
    OrgId Identifier of the organization for this location.
    Parent Non-persistent attribute used to maintain LocHierarchy.Parent through the Location object. This column is used mainly for the insert of a new operating location. See the Parent attribute defined in LocHierarchy for more information.
    PurchVarAcc Purchasing Variance Account. Used to track variances in purchasing costs for items, resulting from differences between the PO and receipt costs. Not used for any MAXIMO transaction as the business rule requires receipt costs be the same as the PO costs.
    ReceiptVarAcc Receipt Variance Account. Used to track inventory standard receipt adjustment transactions, resulting from differences between the inventory standard cost and the receipt cost. For standard costing and storeroom locations only. Tracked by storeroom location, not by item.
    ShipToAddressCode Default ship to address code for storerooms only.
    ShipToLaborCode Default ship to labor code for storerooms only.
    ShrinkageAcc Shrinkage Account. Used to track current balance adjustment transactions. The transaction is positive when the actual inventory quantity is greater than the MAXIMO-calculated current balance. For storeroom locations only.
    SiteId Identifier of the site for this location.
    Status Attribute used to maintain status.
    SystemId Non-persistent attribute used to interact with LocHierarchy.Systemid. This column represents the system the location is currently associated with. For operating locations only. Although an operating location can belong to multiple systems, the SystemId here represents the current system the user has selected.
    Type The type of location such as Operating, Storeroom, Repair, etc. Validated against the ValueList table where value list name is LOCTYPE.
    WarrentyExpDate Non-persistent attribute used to maintain LocOper.WarrentyExpDate through the Location object. For operating locations only. See the WarrentyExpDate attribute defined in LocOper for more information.
    ExternalRefId, OwnerSysId, SourceSysId,SenderSysId Columns used by the MAXIMO E-commerce Adaptor (MEA).
    See Also:
    LocHierarchy, LocAncestor, LocSystem, psdi.app.location.LocAuth, LocStatus, LocOper, LocationSpec
    • Field Detail

      • dontAppendFlag

        public boolean dontAppendFlag
        Flag is set in transfer in , transfer out page, is used to filter locations in appendToWhere() method
      • onwalkuphierarchy

        protected boolean onwalkuphierarchy
      • isDuplicated

        public boolean isDuplicated
        Creates a duplicate location with its related objects.
        See Also:
        psdi.mbo.Mbo#isAutoKeyed.
    • Constructor Detail

      • Location

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

      • init

        public void init()
                  throws MXException
        init routine Fields type and disabled are readonly after insert
        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
      • setReadonlyForOperORStoreAfterAdd

        public void setReadonlyForOperORStoreAfterAdd()
                                               throws MXException,
                                                      java.rmi.RemoteException
        06-16999:set the attributes specific for operating locations or storeroom locations readonly depends on the app (Locations App or Storeroom App)
        Throws:
        MXException
        java.rmi.RemoteException
      • add

        public void add()
                 throws MXException,
                        java.rmi.RemoteException
        Add a new Location Field defaults are set
        Specified by:
        add in interface MboRemote
        Overrides:
        add in class Mbo
        Throws:
        MXException
        java.rmi.RemoteException
      • getLocationMeterNowDate

        public java.util.Date getLocationMeterNowDate()
                                               throws MXException,
                                                      java.rmi.RemoteException
        called to establish a current date to be used when obtaining the most recent historical meter readings for all of this Location's LocationMeters. This is so the date used in the SQL WHERE clause is the same for all LocationMeters belonging to this Location.
        Specified by:
        getLocationMeterNowDate in interface LocationRemote
        Throws:
        MXException
        java.rmi.RemoteException
        See Also:
        psdi.app.location.LocationMeter.getPreviousMeterReading()
      • delete

        public void delete(long access)
                    throws MXException,
                           java.rmi.RemoteException
        Delete the Location record and delete associated records in the other tables.
        Specified by:
        delete in interface MboRemote
        Overrides:
        delete in class Mbo
        Parameters:
        access - access modifier such as NOACCESCHECK.
        Throws:
        MXException
        java.rmi.RemoteException
        See Also:
        Mbo.delete(long)
      • cannotChangeStatus

        public void cannotChangeStatus(MboSetRemote msr)
                                throws MXException,
                                       java.rmi.RemoteException
        handles error message creation for most of the tables checked in the canChangeStatus method. The key for the current Location MBO and the table containing it are passed to the exception.
        Specified by:
        cannotChangeStatus in interface LocationRemote
        Parameters:
        msr - MboSet obtained from the table that contains the current Location MBO
        Throws:
        MXAccessException - ("locations","chgstatlocrf",params) when the current MBO is found to exist in a related table by the canDelete method
        MXException
        java.rmi.RemoteException
        See Also:
        canDelete
      • isStore

        public boolean isStore()
                        throws MXException,
                               java.rmi.RemoteException
        Is the current object a store room location ?
        Specified by:
        isStore in interface LocationRemote
        Returns:
        Boolean value depending on the location type, if it is storeroom.
        Throws:
        MXException
        java.rmi.RemoteException
        See Also:
        Location.isStore()
      • isCourier

        public boolean isCourier()
                          throws MXException,
                                 java.rmi.RemoteException
        Is the current object a Courier location ?
        Specified by:
        isCourier in interface LocationRemote
        Returns:
        Boolean value depending on the the object , if it is courier location or not
        Throws:
        MXException
        java.rmi.RemoteException
        See Also:
        Location.isCourier()
      • isHolding

        public boolean isHolding()
                          throws MXException,
                                 java.rmi.RemoteException
        Is the current object a Holding location ?
        Specified by:
        isHolding in interface LocationRemote
        Returns:
        Boolean value depending on the the object , if it is holding location or not
        Throws:
        MXException
        java.rmi.RemoteException
        See Also:
        Location.isHolding()
      • getChildrenInAllSystems

        public MboSetRemote getChildrenInAllSystems()
                                             throws MXException,
                                                    java.rmi.RemoteException
        Retrieve the child locations associated with this location in all systems
        Returns:
        Mbo children set
        Throws:
        MXException
        java.rmi.RemoteException
      • getHierarchies

        public java.lang.String[] getHierarchies()
                                          throws MXException,
                                                 java.rmi.RemoteException
        Returns the array of systemids with which the location is associated.
        Specified by:
        getHierarchies in interface LocationRemote
        Returns:
        Array of systemids with which the location is associated.
        Throws:
        MXException
        java.rmi.RemoteException
        See Also:
        Location.getHierarchies()
      • walkUpHierarchy

        public java.util.Vector walkUpHierarchy()
                                         throws MXException,
                                                java.rmi.RemoteException
        Get a vector of this locations ancestors.
        Returns:
        Vector The current location's ancestors, found by traversing back to the top level and storing each parent in a Vector.
        Throws:
        MXException
        java.rmi.RemoteException
      • getLocItem

        public java.lang.String getLocItem()
                                    throws MXException,
                                           java.rmi.RemoteException
        Returns the item number for a location. The location is assumed to exist, but it's not known if it has a locoper record with an itemnum. Returns null if a record with an itemnum doesn't exist or is null.
        Specified by:
        getLocItem in interface LocationRemote
        Returns:
        Item number for a location
        Throws:
        MXException - is caught and returned value is set to null.
        java.rmi.RemoteException
        See Also:
        Location.getLocItem()
      • isLocationOccupied

        public boolean isLocationOccupied(MboRemote asset)
                                   throws MXException,
                                          java.rmi.RemoteException
        Return true if the location in a given site , associated with a rotating item and the rotating item or alternate item matches a rotating asset, and the location is currently occupied by some asset other than asset is being passed or the parent of asset is being passed.
        Specified by:
        isLocationOccupied in interface LocationRemote
        Parameters:
        loc - - location mbo
        Returns:
        Boolean value
        Throws:
        MXException
        java.rmi.RemoteException
        See Also:
        doCheckForLocationOccupied, placeAssetChildren
      • isLocationOccupied

        public boolean isLocationOccupied(java.lang.String itemnum)
                                   throws MXException,
                                          java.rmi.RemoteException
        Return true if the location in a given site , associated with a rotating item and the rotating item or alternate item matches a rotating asset
        Specified by:
        isLocationOccupied in interface LocationRemote
        Parameters:
        itemnum - Itemnum associated with location
        Returns:
        Boolean value
        Throws:
        MXException
        java.rmi.RemoteException
        See Also:
        doCheckForLocationOccupied, placeAssetChildren
      • doesHoldingLocationExistForSite

        public boolean doesHoldingLocationExistForSite(java.lang.String siteid)
                                                throws MXException,
                                                       java.rmi.RemoteException
        Throws:
        MXException
        java.rmi.RemoteException
      • updateDesc

        public void updateDesc()
                        throws MXException,
                               java.rmi.RemoteException
        set the description field to be the generated value obtained from the setup of the classstructureid (in asset catalog setup) and the values/measureunits in the locationspec set.
        Specified by:
        updateDesc in interface LocationRemote
        Throws:
        MXException
        java.rmi.RemoteException
        See Also:
        Location.updateDesc()
      • appValidate

        public void appValidate()
                         throws MXException,
                                java.rmi.RemoteException
        last minute validate before save(). Validate if the isdefault flag is properly set.
        Overrides:
        appValidate in class Mbo
        Throws:
        MXException
        java.rmi.RemoteException
      • save

        public void save()
                  throws MXException,
                         java.rmi.RemoteException
        Save the location object Need to update the description based upon classstructure and locationspec.
        Overrides:
        save in class StatefulMbo
        Throws:
        MXException
        java.rmi.RemoteException
      • updateGLInfo

        public void updateGLInfo()
                          throws MXException,
                                 java.rmi.RemoteException
        If an location's IntLabrec is updated, update controlaccount of all LaborCraftRate records that refer to that Location as a Work Location.
        Throws:
        MXException
        java.rmi.RemoteException
      • generateLocationMetersForMeterGroup

        public void generateLocationMetersForMeterGroup()
                                                 throws MXException,
                                                        java.rmi.RemoteException
        creates LocationMeters for this Location from the Location's new GroupName value.
        Throws:
        MXException
        java.rmi.RemoteException
      • getClearDupSeqNumsOnMeterGroupChange

        public boolean getClearDupSeqNumsOnMeterGroupChange()
                                                     throws MXException,
                                                            java.rmi.RemoteException
        Throws:
        MXException
        java.rmi.RemoteException
      • checkForDuplicateMeterSequenceValues

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

        public void appendDescription(java.lang.String descSpec)
                               throws MXException,
                                      java.rmi.RemoteException
        append the passed description from an LocationSpec to the location.description;need to get classtructure related description first and only one time.
        Parameters:
        descSpec - the numvalue/alnvalue + measureunitid/abbreviation from one locationspec.
        Throws:
        MXException
        java.rmi.RemoteException
      • canApplyIAS

        public boolean canApplyIAS()
                            throws MXException,
                                   java.rmi.RemoteException
        public method to determine if apply IAS can be performed for this location.
        Specified by:
        canApplyIAS in interface LocationRemote
        Returns:
        boolean true to indicate if IAS can be applied false otherwise.
        Throws:
        MXException
        java.rmi.RemoteException
        See Also:
        Location.canApplyIAS()
      • applyIAS

        public java.lang.Object[] applyIAS(boolean autokey)
                                    throws MXException,
                                           java.rmi.RemoteException
        Apply IAS to this location based on the assembly structure of the item.
        Specified by:
        applyIAS in interface LocationRemote
        Parameters:
        autokey - true will assign autokey to the new mbo's false will leave it blank for callers to assign autokey.
        Returns:
        Object[] Array of Objects containing the new MboSets just created: Object[0]: the new LocationSetRemote Object[1]: a hashtable containing the information: key: the new location mbo value: the new LocHierarchySetRemote instantied by the new location, Object[2]: the new PMSetRemote; These may not be autokeyed; caller can take these sets, assign autokeys, and save.
        Throws:
        MXException
        java.rmi.RemoteException
        See Also:
        psdi.app.location.Location#applyIAS()
      • applyIASCreateChild

        public MboRemote applyIASCreateChild(MboRemote itemStruct,
                                             boolean autokey)
                                      throws MXException,
                                             java.rmi.RemoteException
        Applies IAS for the location based on the next level rotating item specified in the passed ItemStruct; ie, create a child location.
        Specified by:
        applyIASCreateChild in interface LocationRemote
        Parameters:
        itemStruct - the location.item's rotating child.
        autokey - true to autokey the new location and the new pms.
        Throws:
        MXException
        java.rmi.RemoteException
        See Also:
        psdi.app.location.Location#applyIASCreatechild()
      • applyIASGenPMs

        public MboSetRemote applyIASGenPMs(boolean autokey)
                                    throws MXException,
                                           java.rmi.RemoteException
        Applies IAS for the location; create pms if there is master pm for this item.
        Specified by:
        applyIASGenPMs in interface LocationRemote
        Parameters:
        autokey - true to autokey the new location and the new pms.
        Throws:
        MXException
        java.rmi.RemoteException
        See Also:
        psdi.app.location.Location#applyIASGenPMs()
      • canChangeStatus

        public void canChangeStatus(java.lang.String changeToStatus,
                                    long accessModifier)
                             throws MXException,
                                    java.rmi.RemoteException
        Identifies whether the status of this object be changed to the specified value. If status change is not allowed, an exception is thrown. Status changes to same status as the current status are denied. Status changes to another synonym of the current status's MaxValue are always allowed.
        Overrides:
        canChangeStatus in class StatefulMbo
        Parameters:
        changeToStatus - The new desired status. This is the translated status (that is, the status code as it would have been entered by a user, or valuelist.value), not the internal status value ( valuelist.maxvalue).
        accessModifier - If set to NOACCESSCHECK, allows status changes when not normally allowed.
        Throws:
        MXException - Thrown if the status cannot be changed.
        java.rmi.RemoteException
      • changeStatus

        public void changeStatus(java.lang.String status,
                                 java.util.Date asOfDate,
                                 java.lang.String memo,
                                 long accessModifier)
                          throws MXException,
                                 java.rmi.RemoteException
        Description copied from class: StatefulMbo
        Changes the status of the object. This method compares the requested status and the current status by calling canChangeStatus before the change is performed. If the status change is allowed, the status change is performed and a status history record is written. If the status change is not allowed, an exception is thrown.

        If the new status has the same MaxValue as the current status, then only the status and statusDate attributes are updated, and the StatusHandler is not used.

        Specified by:
        changeStatus in interface StatefulMboRemote
        Overrides:
        changeStatus in class StatefulMbo
        Parameters:
        status - The new desired status. This is the translated status (that is, the status code as it would have been entered by a user, or valuelist.value), not the internal status value (valuelist.maxvalue).
        asOfDate - The effective date of the new status (java.util.Date). If this value is null, the current date/time of the server will be used.
        memo - A string briefly describing the circumstances of the change. The memo can be null.
        accessModifier - A value of NOACCESSCHECK will cause the method not to call canChangeStatus. Callers using this flag are responsible for ensuring that they are attempting a valid status change.
        Throws:
        MXException - Thrown if there is a problem, or the status cannot be changed, as determined by canChangeStatus(String).
        java.rmi.RemoteException
        See Also:
        StatefulMbo.canChangeStatus(String)
      • changeStatus

        public void changeStatus(java.lang.String changedStatus,
                                 java.util.Date asOfDate,
                                 java.lang.String memo,
                                 boolean rolltoallchildren,
                                 boolean removefromallroutes,
                                 boolean rolltoallassets,
                                 boolean removefromalljp,
                                 boolean removefromactivesp,
                                 boolean changepmstatus)
                          throws MXException,
                                 java.rmi.RemoteException
        Method to change status from the specified state to a desired state for operating location. User provides this information. Valid statuses are: Values stored in the ValueList table where listname is "LOCASSETSTATUS". These statuses pertain only to locations of type OPERATING.
        Specified by:
        changeStatus in interface LocationRemote
        Parameters:
        changedStatus - provided by UI. Values stored in the ValueList table where listname is "LOCSTAT".
        asOfDate - The date as of the status change is to be made. If null, set to the default mxserver date/time.
        memo - Memo text.
        Throws:
        MXApplicationException - ("locations", "StatusNull")is thrown when status of the location is null.
        MXApplicationException("locations", "SameStatus")is thrown when the changedStatus is same as currentStatus
        MXException
        java.rmi.RemoteException
        See Also:
        psdi.app.location.Location#changeStatus()
      • deletePMForecast

        protected void deletePMForecast()
                                 throws MXException,
                                        java.rmi.RemoteException
        If the status of the location is changing to NOT READY or OPERATING, check if the PM's are in 'ACTIVE' status and have forecast and delete the PM forecast.
        Throws:
        MXException
        java.rmi.RemoteException
      • rollStatusToAllChildren

        protected void rollStatusToAllChildren(java.lang.String status,
                                               java.util.Date asOfDate,
                                               java.lang.String memo,
                                               boolean rolltoallchildren,
                                               boolean removefromallroutes,
                                               boolean rolltoallassets,
                                               boolean removefromalljp,
                                               boolean removefromactivesp,
                                               boolean changepmstatus,
                                               java.util.HashSet allLocations)
                                        throws MXException,
                                               java.rmi.RemoteException
        Change the status of all children locations
        Parameters:
        status -
        asOfDate -
        memo -
        rolltoallchildren -
        removefromallroutes -
        rolltoallassets -
        removefromalljp -
        removefromactivesp -
        changepmstatus -
        Throws:
        MXException
        java.rmi.RemoteException
      • rollStatusToAllAssets

        protected void rollStatusToAllAssets(java.lang.String status,
                                             boolean rolltoallchildren)
                                      throws MXException,
                                             java.rmi.RemoteException
        Change the status of all assets in this location
        Parameters:
        status -
        Throws:
        MXException
        java.rmi.RemoteException
      • removeReferenceFromAllRoutes

        protected void removeReferenceFromAllRoutes()
                                             throws MXException,
                                                    java.rmi.RemoteException
        Remove location reference from all routes
        Throws:
        MXException
        java.rmi.RemoteException
      • removeReferenceFromAllJP

        protected void removeReferenceFromAllJP()
                                         throws MXException,
                                                java.rmi.RemoteException
        Remove location reference from all job plans
        Throws:
        MXException
        java.rmi.RemoteException
      • removeReferenceFromActiveSP

        protected void removeReferenceFromActiveSP()
                                            throws MXException,
                                                   java.rmi.RemoteException
        Remove location reference from all active safety plans
        Throws:
        MXException
        java.rmi.RemoteException
      • changeStatusPMStatus

        protected void changeStatusPMStatus()
                                     throws MXException,
                                            java.rmi.RemoteException
        make location's PM inactive
        Throws:
        MXException
        java.rmi.RemoteException
      • isReferencedByOpenWO

        public boolean isReferencedByOpenWO()
                                     throws MXException,
                                            java.rmi.RemoteException
        Check if this location is referenced by open Work Order
        Throws:
        MXException
        java.rmi.RemoteException
      • isReferencedByPM

        public boolean isReferencedByPM()
                                 throws MXException,
                                        java.rmi.RemoteException
        Check if this location is referenced by active PMs
        Throws:
        MXException
        java.rmi.RemoteException
      • isReferencedByActiveRoutes

        public boolean isReferencedByActiveRoutes()
                                           throws MXException,
                                                  java.rmi.RemoteException
        Check if the location is referenced by active routes
        Throws:
        MXException
        java.rmi.RemoteException
      • isReferencedByActiveSP

        public boolean isReferencedByActiveSP()
                                       throws MXException,
                                              java.rmi.RemoteException
        Check if the location is referenced by active SPs
        Throws:
        MXException
        java.rmi.RemoteException
      • isReferencedByJobPlans

        public boolean isReferencedByJobPlans()
                                       throws MXException,
                                              java.rmi.RemoteException
        Check if the location is referenced by active Job Plans
        Throws:
        MXException
        java.rmi.RemoteException
      • skipCopyField

        protected boolean skipCopyField(MboValueInfo mvi)
                                 throws java.rmi.RemoteException,
                                        MXException
        Overrides the skipCopyField() in the Mbo. Since this method takes the MboValueInfo as its parameter just check to see if this field needs to be copied or skipped by using the data from the static HashSet. If this field does not need to be copied return true. The following are location fields that will be skipped without being copied to the newly duplicated location
        1. LOCATION
        2. CHANGEBY
        3. CHANGEDATE
        4. DISABLED
        5. SOURCESYSID
        6. OWNERSYSID
        7. EXTERNALREFID
        8. SENDERSYSID
        Overrides:
        skipCopyField in class Mbo
        Parameters:
        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:
        java.rmi.RemoteException
        MXException
        See Also:
        Location.loadSkipFieldCopyHashSet()
      • copyInvReserveSetForIssues

        public void copyInvReserveSetForIssues(MboSetRemote invReserveSet)
                                        throws java.rmi.RemoteException,
                                               MXException
        Loops an InvReserveSet and create new MatUseTrans based on the selected rows of the passed InvReserveSet. The new MatUseTrans are created in the "MATUSETRANSISSUE" mboset. Work of copying InvReserve onto new MatUseTrans is done in MatUseTransSet.
        Specified by:
        copyInvReserveSetForIssues in interface LocationRemote
        Parameters:
        invReserveSet - the MboSetRemote of InvReserveSetRemote instance. Only process the selected rows.
        Throws:
        java.rmi.RemoteException
        MXException
        See Also:
        psdi.app.location.Location#copyInvReserveSetForIssues()
      • copyInvReserveSetForTransferOut

        public void copyInvReserveSetForTransferOut(MboSetRemote invReserveSet)
                                             throws java.rmi.RemoteException,
                                                    MXException
        Loops an InvReserveSet and create new MatRecTrans based on the selected rows of the passed InvReserveSet. This copies InvReserves to process "transfer out" task from the storeroom. The new MatRecTrans are created in the "MATRECTRANSOUT" mboset. Work of copying InvReserve onto new MatRecTrans is done in MatRecTransSet.
        Specified by:
        copyInvReserveSetForTransferOut in interface LocationRemote
        Parameters:
        invReserveSet - the MboSetRemote of InvReserveSetRemote instance. Only process the selected rows.
        Throws:
        java.rmi.RemoteException
        MXException
        See Also:
        psdi.app.location.Location#copyInvReserveSetForTransferOut()
      • copyInvReserveSetForTransferIn

        public void copyInvReserveSetForTransferIn(MboSetRemote invReserveSet)
                                            throws java.rmi.RemoteException,
                                                   MXException
        Loops an InvReserveSet and create new MatRecTrans based on the selected rows of the passed InvReserveSet. This copies InvReserves to process "transfer IN" task from the storeroom. The new MatRecTrans are created in the "MATRECTRANSOUT" mboset. Work of copying InvReserve onto new MatRecTrans is done in MatRecTransSet.
        Specified by:
        copyInvReserveSetForTransferIn in interface LocationRemote
        Parameters:
        invReserveSet - the MboSetRemote of InvReserveSetRemote instance. Only process the selected rows.
        Throws:
        java.rmi.RemoteException
        MXException
        See Also:
        psdi.app.location.Location#copyInvReserveSetForTransferIn()
      • copyMatUseTransSetForReturn

        public void copyMatUseTransSetForReturn(MboSetRemote matUseSet)
                                         throws java.rmi.RemoteException,
                                                MXException
        Loops an MatUseTrans Set(ISSUE type) and create new MatRecTrans(RETURN) based on the selected rows of the passed MatUseTrans set. This copies MatUseTrans to process "Select Items for Returns" task from the storeroom. The new MatUseTrans are created in the "MATUSETRANSISSUE" mboset. Work of copying InvReserve onto new MatRecTrans is done in MatRecTransSet.
        Specified by:
        copyMatUseTransSetForReturn in interface LocationRemote
        Parameters:
        invReserveSet - the MboSetRemote of InvReserveSetRemote instance. Only process the selected rows.
        Throws:
        java.rmi.RemoteException
        MXException
        See Also:
        psdi.app.location.Location#copyMatUseTransSetForReturn()
      • receiveRotableAssetOnMoveFromNonInventory

        public MboRemote receiveRotableAssetOnMoveFromNonInventory(MboRemote asset,
                                                                   java.lang.String glCredit,
                                                                   java.lang.String glDebit)
                                                            throws java.rmi.RemoteException,
                                                                   MXException
        creates the MATRECTRANS object associated with a rotating asset moving from a non-inventory type location to an inventory type location. This MatRecTrans.IssueType is a TRANSFER. The method also notifies this new MATRECTRANS object that the transfer is from a non-inventory to an inventory type location because transfers of this type need to be handled differently.
        Specified by:
        receiveRotableAssetOnMoveFromNonInventory in interface LocationRemote
        Parameters:
        assetnum - rotating asset being moved
        location - non-inventory type originating location
        itemnum - rotating asset is a single instance of this rotating item
        dateMoved - date on which move is occuring
        movedBy - user performing the move
        moveBinNum - destination bin
        glCredit - rotating suspense account for the asset
        glDebit - control account for this inventory location
        Throws:
        java.rmi.RemoteException
        MXException
        See Also:
        MatRecTrans.setTransferFromNonInventory, MoveModify.doMove
      • copySparePartSetForIssues

        public void copySparePartSetForIssues(MboSetRemote sparePartSet)
                                       throws java.rmi.RemoteException,
                                              MXException
        Loops through the passed SparePartSet and creates a new MatUseTrans based on the selected rows of the passed set. The new MatUseTrans are created in the "MATUSETRANSISSUE" mboset. The work of copying SparePart onto new MatUseTrans is done in MatUseTransSet.
        Specified by:
        copySparePartSetForIssues in interface LocationRemote
        Parameters:
        SparePartSet - the MboSetRemote of the SparePartSetRemote instance. Only selected rows are processed.
        Throws:
        java.rmi.RemoteException
        MXException
        See Also:
        psdi.app.location.Location#copySparePartSetForIssues()
      • copySparePartSetForTransferOut

        public void copySparePartSetForTransferOut(MboSetRemote sparePartSet)
                                            throws java.rmi.RemoteException,
                                                   MXException
        Loops through a SparePartSet and creates a new MatRecTrans based on the selected rows of the passed set. This copies SpareParts to process a "transfer out" from the current storeroom. The new MatRecTrans are created in the "MATRECTRANSOUT" mboset. The work of copying SparePart onto new MatRecTrans is done in MatRecTransSet.
        Specified by:
        copySparePartSetForTransferOut in interface LocationRemote
        Parameters:
        SparePartSet - the MboSetRemote of SparePartSetRemote instance. Only selected rows are processed.
        Throws:
        java.rmi.RemoteException
        MXException
        See Also:
        psdi.app.location.Location#copySparePartSetForTransferOut()
      • copySparePartSetForTransferIn

        public void copySparePartSetForTransferIn(MboSetRemote sparePartSet)
                                           throws java.rmi.RemoteException,
                                                  MXException
        Loops through a SparePartSet and creates a new MatRecTrans based on the selected rows of the passed set. This copies SpareParts to process a "transfer IN" to the current storeroom. The new MatRecTrans are created in the "MATRECTRANSIN" mboset. The work of copying SparePart onto new MatRecTrans is done in MatRecTransSet.
        Specified by:
        copySparePartSetForTransferIn in interface LocationRemote
        Parameters:
        SparePartSet - the MboSetRemote of SparePartSetRemote instance. Only selected rows are processed.
        Throws:
        java.rmi.RemoteException
        MXException
        See Also:
        psdi.app.location.Location#copySparePartSetForTransferIn()
      • copyInvBalancesSetForTransferOut

        public void copyInvBalancesSetForTransferOut(MboSetRemote invBalancesSet)
                                              throws java.rmi.RemoteException,
                                                     MXException
        Loops through an InvBalancesSet and creates new MatRecTrans based on the selected rows of the passed InvBalancesSet. This copies InvBalances to process a "transfer out" task from the storeroom. The new MatRecTrans are created in the "MATRECTRANSOUT" mboset. The work of copying InvBalances onto new MatRecTrans is done in MatRecTransSet.
        Specified by:
        copyInvBalancesSetForTransferOut in interface LocationRemote
        Parameters:
        invBalancesSet - the MboSetRemote of InvBalancesSetRemote instance. Only process the selected rows.
        Throws:
        java.rmi.RemoteException
        MXException
        See Also:
        psdi.app.location.Location#copyInvBalancesSetForTransferOut()
      • copyInvBalancesSetForTransferIn

        public void copyInvBalancesSetForTransferIn(MboSetRemote invBalancesSet)
                                             throws java.rmi.RemoteException,
                                                    MXException
        Loops through an InvBalancesSet and creates new MatRecTrans based on the selected rows of the passed InvBalancesSet. This copies InvBalances to process a "transfer IN" task from the storeroom. The new MatRecTrans are created in the "MATRECTRANSOUT" mboset. The work of copying InvBalances onto new MatRecTrans is done in MatRecTransSet.
        Specified by:
        copyInvBalancesSetForTransferIn in interface LocationRemote
        Parameters:
        invBalancesSet - the MboSetRemote of InvBalancesSetRemote instance. Only process the selected rows.
        Throws:
        java.rmi.RemoteException
        MXException
        See Also:
        psdi.app.location.Location#copyInvBalancesSetForTransferIn()
      • copyPOLineSetForTransferOut

        public void copyPOLineSetForTransferOut(MboSetRemote poLineSet)
                                         throws java.rmi.RemoteException,
                                                MXException
        Loops through a POLineSet and creates new MatRecTrans based on the selected rows of the passed POLineSet. This copies POLines to process a "transfer out" task from the storeroom. The new MatRecTrans are created in the "MATRECTRANSOUT" mboset. The work of copying POLines onto new MatRecTrans is done in MatRecTransSet.
        Specified by:
        copyPOLineSetForTransferOut in interface LocationRemote
        Parameters:
        poLineSet - the MboSetRemote of POLineSetRemote instance. Only process the selected rows.
        Throws:
        java.rmi.RemoteException
        MXException
        See Also:
        psdi.app.location.Location#copyPOLineSetForTransferOut()
      • copyPOLineSetForTransferIn

        public void copyPOLineSetForTransferIn(MboSetRemote poLineSet)
                                        throws java.rmi.RemoteException,
                                               MXException
        Loops through a POLineSet and creates new MatRecTrans based on the selected rows of the passed POLineSet. This copies POLines to process a "transfer IN" task from the storeroom. The new MatRecTrans are created in the "MATRECTRANSOUT" mboset. The work of copying POLines onto new MatRecTrans is done in MatRecTransSet.
        Specified by:
        copyPOLineSetForTransferIn in interface LocationRemote
        Parameters:
        poLineSet - the MboSetRemote of POLineSetRemote instance. Only process the selected rows.
        Throws:
        java.rmi.RemoteException
        MXException
        See Also:
        psdi.app.location.Location#copyPOLineSetForTransferIn()
      • copyMatRecTransSetForTransferIn

        public void copyMatRecTransSetForTransferIn(MboSetRemote matRecTransSet)
                                             throws java.rmi.RemoteException,
                                                    MXException
        Loops through a MatRecTransSet and creates new MatRecTrans based on the selected rows of the passed MatRecTransSet. This copies MatRecTrans records to process a "transfer IN" task from the storeroom. The new MatRecTrans are created in the "MATRECTRANSOUT" mboset. The work of copying MatRecTrans onto new MatRecTrans is done in MatRecTransSet.
        Specified by:
        copyMatRecTransSetForTransferIn in interface LocationRemote
        Parameters:
        matRecTransSet - the MboSetRemote of MatRecTransSetRemote instance. Only process the selected rows.
        Throws:
        java.rmi.RemoteException
        MXException
        See Also:
        psdi.app.location.Location#copyMatRecTransSetForTransferIn()
      • getStatusHistory

        protected MboSetRemote getStatusHistory()
                                         throws MXException,
                                                java.rmi.RemoteException
        Return the locationstatus object. Required for statefullness.
        Specified by:
        getStatusHistory in class StatefulMbo
        Returns:
        The set of LOCSTATUS records
        Throws:
        MXException
        java.rmi.RemoteException
      • getStatusHandler

        protected StatusHandler getStatusHandler()
        Return a status handler with the help of which the asset status changes can be done.
        Specified by:
        getStatusHandler in class StatefulMbo
      • initRelationship

        public void initRelationship(java.lang.String relationName,
                                     MboSetRemote mboSet)
                              throws MXException,
                                     java.rmi.RemoteException
        SafetyLexicon needs to behave differently depending on the relationship it was obtained with (hazards and precautions, hazardous materials, or tagouts). This method saves the relationship name on the SafetyLexiconSet.
        Overrides:
        initRelationship in class Mbo
        Parameters:
        relationName - The relationship name of the related MboSet which need to initialize.
        mboSet - The related MboSet which need to initialize.
        Throws:
        MXException
        java.rmi.RemoteException
        See Also:
        SafetyLexiconSet.setThisRelationName(java.lang.String)
      • canAssociateSystem

        public boolean canAssociateSystem()
                                   throws MXException,
                                          java.rmi.RemoteException
        Public methed used to determine if a system can be associated with this location. A system may be associated with a location only if the location is of type operating.
        Specified by:
        canAssociateSystem in interface LocationRemote
        Throws:
        MXApplicationException - ("locations", "cannotassociatesystem")is thrown if this location is not an operating location.
        MXException
        java.rmi.RemoteException
        See Also:
        Location.canAssociateSystem()
      • clearClassification

        public void clearClassification()
                                 throws java.rmi.RemoteException,
                                        MXException
        This method clears the classtructureid and delete locationspecs
        Specified by:
        clearClassification in interface LocationRemote
        Throws:
        java.rmi.RemoteException
        MXException
        See Also:
        psdi.app.asset.Location#clearClassification
      • setMemo

        protected void setMemo(java.lang.String memo)
        Method to set Memo attribute
        Parameters:
        memo - Memo text.
      • setStatusDate

        protected void setStatusDate(java.util.Date date)
        Method to set statusDate attribute
        Parameters:
        statusDate - The date as of the status change is made.
      • getWarrantyInfo

        public java.util.List getWarrantyInfo(java.util.Date woDate,
                                              boolean isParent,
                                              java.lang.String type)
                                       throws MXException,
                                              java.rmi.RemoteException
        For a given date, get warranty information for this asset
        Parameters:
        Date - woDate date warranty applis to
        isParent - true if is a parent asset
        Returns:
        List Lists of CONTRACTASSET
        Throws:
        MXException
        java.rmi.RemoteException
      • createWorkorder

        public MboRemote createWorkorder(java.lang.String jpnum)
                                  throws MXException,
                                         java.rmi.RemoteException
        creates a Workorder with WOCLASS=WORKORDER from Location.
        Specified by:
        createWorkorder in interface AppActionInterface
        Parameters:
        jpnum - -job plan need be apply to the new work order.
        Returns:
        Throws:
        MXException
        java.rmi.RemoteException
      • createChange

        public MboRemote createChange(java.lang.String jpnum)
                               throws MXException,
                                      java.rmi.RemoteException
        creates a Workorder with WOCLASS=CHANGE from Location.
        Specified by:
        createChange in interface AppActionInterface
        Parameters:
        jpnum - -job plan need be apply to the new work order.
        Returns:
        Throws:
        MXException
        java.rmi.RemoteException
      • createRelease

        public MboRemote createRelease(java.lang.String jpnum)
                                throws MXException,
                                       java.rmi.RemoteException
        creates a Workorder with WOCLASS=RELEASE from Location.
        Specified by:
        createRelease in interface AppActionInterface
        Parameters:
        jpnum - -job plan need be apply to the new work order.
        Returns:
        Throws:
        MXException
        java.rmi.RemoteException
      • createServiceRequest

        public MboRemote createServiceRequest(java.lang.String tickettemplateid)
                                       throws MXException,
                                              java.rmi.RemoteException
        creates a Ticket with Ticket Type = Service Request from Location.
        Specified by:
        createServiceRequest in interface AppActionInterface
        Parameters:
        tickettemplateid - - Ticket Template ID to be applied when this ticket is created.
        Returns:
        Throws:
        MXException
        java.rmi.RemoteException
      • createProblem

        public MboRemote createProblem(java.lang.String tickettemplateid)
                                throws MXException,
                                       java.rmi.RemoteException
        creates a Ticket with Ticket Type = Problem from Location.
        Specified by:
        createProblem in interface AppActionInterface
        Parameters:
        tickettemplateid - - Ticket Template ID to be applied when this ticket is created.
        Returns:
        Throws:
        MXException
        java.rmi.RemoteException
      • createIncident

        public MboRemote createIncident(java.lang.String tickettemplateid)
                                 throws MXException,
                                        java.rmi.RemoteException
        creates a Ticket with Ticket Type = Incident from Location.
        Specified by:
        createIncident in interface AppActionInterface
        Parameters:
        tickettemplateid - - Ticket Template ID to be applied when this ticket is created.
        Returns:
        Throws:
        MXException
        java.rmi.RemoteException
      • queryDataSheets

        public void queryDataSheets(PlusCWODSSetRemote woDsSet,
                                    boolean loopCalibrations,
                                    java.util.Date fromDate,
                                    java.util.Date toDate)
                             throws java.rmi.RemoteException,
                                    MXApplicationException,
                                    MXException
        Sets up the where clause of the given WO DS MBO Set to return the list of calibrations in a given time frame for this location
        Specified by:
        queryDataSheets in interface LocationRemote
        Parameters:
        woDsSet - WO DS set whose where clause will be changed
        loopCalibrations - whether to include only loop calibrations
        fromDate - start date to be used when filtering results
        toDate - end date to be used when filtering results
        Throws:
        java.rmi.RemoteException
        MXApplicationException
        MXException
      • canBeUsedAsTagId

        public boolean canBeUsedAsTagId()
                                 throws java.rmi.RemoteException,
                                        MXException
        Checks if this location can be used as a tag id. The rule is that the location must have one, and only one, asset associated with it.
        Specified by:
        canBeUsedAsTagId in interface LocationRemote
        Returns:
        true if this location meets the criteria
        Throws:
        java.rmi.RemoteException
        MXException
      • getAssociatedAsset

        public AssetRemote getAssociatedAsset()
                                       throws java.rmi.RemoteException,
                                              MXException
        Returns the asset associated with this location, if and only if there is only one. This is meant to be used with tag id locations.
        Specified by:
        getAssociatedAsset in interface LocationRemote
        Returns:
        associated asset if there is only one, null otherwise.
        Throws:
        java.rmi.RemoteException
        MXException
      • getMbosThatReferToThisRepairFacility

        protected MboSetRemote getMbosThatReferToThisRepairFacility()
                                                             throws java.rmi.RemoteException,
                                                                    MXException
        Checks if this repair facility is referred by any active WORKORDER, MAXUSER, REPFACAUTH or ASSET record
        Returns:
        a mboset with mbos that refer to this repair facility
        Throws:
        java.rmi.RemoteException
        MXException
      • getMboSet

        public MboSetRemote getMboSet(java.lang.String name)
                               throws MXException,
                                      java.rmi.RemoteException
        Per FSM spec if the location does not have any Service Address associated
        it will 'use' its parent's service address (based on the selected Address System) if any.
        Specified by:
        getMboSet in interface MboRemote
        Overrides:
        getMboSet in class Mbo
        Parameters:
        name - The relationship provided to retrieve a related mboSet, usually using foreign keys. For example, "psdi.app.workorder.WOSetRemote.ASSET" is a relationship for the work order object to access the asset Set where "workorder.assetnum=asset.assetnum". The relationship can also be chained. Such as ASSET.ASSETSTATUS.
        Returns:
        The returned related set specified through the relationship.
        Throws:
        MXException - "A relationship called {0} does not exist for the {1} business object" exception will be thrown if the relationship was not found. "Unknown Object" exception will be thrown if the database object can not be found through the relationship.
        java.rmi.RemoteException
        See Also:
        Mbo.getMboSet(String)
      • getServiceAddress

        public ServiceAddressRemote getServiceAddress()
                                               throws MXException,
                                                      java.rmi.RemoteException
        Return the service address associated with this Location.
        If no Service address is associated
        to this location it tries to return its parent service address
        Specified by:
        getServiceAddress in interface AddressableMbo
        Throws:
        MXException
        java.rmi.RemoteException
      • saveGISData

        public void saveGISData(java.lang.String address,
                                java.lang.String lat,
                                java.lang.String lng)
                         throws MXException,
                                java.rmi.RemoteException
        Description copied from interface: GISable
        Implement the logic to save the GIS Data
        Specified by:
        saveGISData in interface GISable
        Throws:
        MXException
        java.rmi.RemoteException
        See Also:
        GISAbleCommon#saveGISData
      • getLatitudeY

        public java.lang.Double getLatitudeY()
                                      throws MXException,
                                             java.rmi.RemoteException
        Description copied from interface: GISable
        Return a double value with the the Latitude (or Y) coordinate of the current entitty.
        Specified by:
        getLatitudeY in interface GISable
        Returns:
        Double or null
        Throws:
        MXException
        java.rmi.RemoteException
      • getLongitudeX

        public java.lang.Double getLongitudeX()
                                       throws MXException,
                                              java.rmi.RemoteException
        Description copied from interface: GISable
        Return a double value with the the Longitude (or X) coordinate of the current entitty.
        Specified by:
        getLongitudeX in interface GISable
        Returns:
        Double or null
        Throws:
        MXException
        java.rmi.RemoteException
      • isGISDataReadonly

        public boolean isGISDataReadonly()
                                  throws MXException,
                                         java.rmi.RemoteException
        Description copied from interface: GISable
        Indicate if the current GIS entity is editable or not. Usefull when the coordinates are populated using an external system.
        Specified by:
        isGISDataReadonly in interface GISable
        Returns:
        Throws:
        MXException
        java.rmi.RemoteException
      • getAddressString

        public java.lang.String getAddressString()
                                          throws MXException,
                                                 java.rmi.RemoteException
        Description copied from interface: GISable
        Return a string with the address of the current entitty.
        Specified by:
        getAddressString in interface GISable
        Returns:
        Double or null
        Throws:
        MXException
        java.rmi.RemoteException
      • addMoreLocationsToSet

        public void addMoreLocationsToSet(MboSetRemote selectedMoreMboSet,
                                          MboSetRemote selectedMboSet)
                                   throws java.rmi.RemoteException,
                                          MXException
        Adds the more selected locations to the existing selected set
        Specified by:
        addMoreLocationsToSet in interface LocationRemote
        Parameters:
        selectedMoreMboSet - The more selected locations
        selectedMboSet - The selected locations
        Throws:
        java.rmi.RemoteException
        MXException
        See Also:
        psdi.app.location.Location#addMoreLocationsToSet()
      • hasCoords

        public java.lang.Boolean hasCoords()
                                    throws MXException,
                                           java.rmi.RemoteException
        Description copied from interface: GISable
        Check if this autolocatable object has coordinates filled (LAT,LONG)
        Specified by:
        hasCoords in interface GISable
        Returns:
        the boolean
        Throws:
        MXException - the mX exception
        java.rmi.RemoteException - the remote exception
      • getAutoLocateObject

        public MboRemote getAutoLocateObject()
                                      throws MXException,
                                             java.rmi.RemoteException
        Description copied from interface: AutoLocatable
        Returns an autolocate object instance if present.
        Specified by:
        getAutoLocateObject in interface AutoLocatable
        Returns:
        the auto locate object
        Throws:
        MXException - the mX exception
        java.rmi.RemoteException - the remote exception
      • getParents

        public MboSetRemote getParents(java.lang.String SystemId)
                                throws MXException,
                                       java.rmi.RemoteException
        Retrieve the parent locations associated with this location and systemid
        Specified by:
        getParents in interface LocationRemote
        Parameters:
        SystemId - System ID
        Returns:
        Mbo Parents set
        Throws:
        MXException
        java.rmi.RemoteException
      • getTopParentInSystem

        public MboRemote getTopParentInSystem(java.lang.String SystemId)
                                       throws MXException,
                                              java.rmi.RemoteException
        Get location's top parent in a given system
        Specified by:
        getTopParentInSystem in interface LocationRemote
        Parameters:
        SystemId - System ID
        Returns:
        Location's top parent in a given system
        Throws:
        MXException
        java.rmi.RemoteException
      • getPMMeterTally

        public int getPMMeterTally(MboRemote pmMeter)
                            throws MXException,
                                   java.rmi.RemoteException
        used when deleting a meter from the location to determine whether PM flags PMASSETWOGEN and PMACTMETER need to be set to false. This depends on whether or or not there are any PMs impacted by the deletion of the meter. When all PMMETERs are removed from a PM via meter deletion, these PM flags are set to false.
        Specified by:
        getPMMeterTally in interface LocationRemote
        Throws:
        MXException
        java.rmi.RemoteException
        See Also:
        Location.getPMMeterTally(MboRemote)