public class ReorderService extends AppService implements ReorderServiceRemote
processQuantity()
method on the reorder set the service returned. It
calculates the reorder quantity for the items in the reorder set according to the pre-defined
rules. If the quantity needs to be overwritten, it is the time to do so by locating the
proper reorder object and setting its reorderquantity attribute. This step can be skipped
if the reorder quantity is set manually.
decideVendorAndCost()
method on the same reorder set. It chooses the most
suitable vendors and unit costs for the items in the set according to the pre-defined
rules which takes the contracts and the history pricing records into account. This step can
be skipped if the cost and vendor information is set manually.
reorder()
method on the same set to start the reordering process. After it is
done, getReorderWarnings()
can be called on the same set to check if any error messages
have been reported.
cancelReorder()
method on the returned set by the first step to clear the lock held by
this user on the storeroom and/or direct order items you tried to reorder.
DIRECTORDERONLY, REORDER, REORDEREXIT, VIEWONLY
APPLOGGER, CRONTASKLOGGER, CRONTASKMGRLOGGER, CRONTASKMGRSQLLOGGER, DBCONNECTIONLOGGER, DDLOGGER, DMLOGGER, EVENTLOGGER, EXCEPTIONLOGGER, MAILLOGGER, MAXIMOLOGGER, MTLOGGER, NULLMBOPOINTER, SECURITY, SENDFAILEDLOGGER, SERVICELOGGER, SQLLOGGER
appenderPrefix, LOGGERNAME_APP, LOGGERNAME_CRONTASK, LOGGERNAME_CRONTASKMGR, LOGGERNAME_DBCONNECTION, LOGGERNAME_DD, LOGGERNAME_DM, LOGGERNAME_DMPREVIEW, LOGGERNAME_EVENT, LOGGERNAME_EXCEPTION, LOGGERNAME_MAIL, LOGGERNAME_MAXIMO, LOGGERNAME_MT, LOGGERNAME_NULLMBOPOINTER, LOGGERNAME_SECURITY, LOGGERNAME_SENDFAILED, LOGGERNAME_SERVICE, LOGGERNAME_SQL, LOGGERNAME_SQL_CRONTASKMGR, LOGGERNAME_TXN, loggerPrefix
Constructor and Description |
---|
ReorderService()
Construct the reorder service.
|
ReorderService(MXServer mxServer)
Construct the reorder service
|
Modifier and Type | Method and Description |
---|---|
void |
addFromWPItem(DBShortcut dbShortcut,
UserInfo userInfo,
java.lang.String userForThisSet,
int allowanceDays,
java.lang.String siteIDForThisSet,
java.lang.String orgIDForThisSet)
Directly write items of direct orders to the reorder table from wpitem
The method bypasses MboSet and Mbo.
|
java.util.Date |
changeState(UserInfo userInfo,
int requestType,
java.lang.String targetType,
java.lang.String siteID,
java.lang.String orgID)
Overloaded form of int changeState(requestType, String targetType, String key).
|
java.util.Date |
changeState(UserInfo userInfo,
int requestType,
java.lang.String targetType,
java.lang.String key,
java.lang.String siteID,
java.lang.String orgID)
Handle state change request.
|
java.lang.String |
getMutexWhere(UserInfo userInfo,
java.lang.String targetType,
java.lang.String key,
java.lang.String siteID,
java.lang.String orgID)
Returns the where clause of the reorder mutex record
|
ReorderSetRemote |
getReorderSet(UserInfo userInfo,
boolean viewOnly,
InventoryRemote inv)
One form of the overloaded function of getReorderSet().
|
ReorderSetRemote |
getReorderSet(UserInfo userInfo,
boolean viewOnly,
InventoryRemote inv,
boolean ignoreReorderPoint) |
ReorderSetRemote |
getReorderSet(UserInfo userInfo,
boolean viewOnly,
InventorySetRemote invs,
java.lang.String storeRoom,
java.lang.String siteID,
int[] selected,
int allowanceDays,
boolean directOrder)
Deprecated.
as of 7.5
Use @link @link #getReorderSet(UserInfo, boolean, InventorySetRemote, String, String, int[], int, boolean, boolean, boolean )
|
ReorderSetRemote |
getReorderSet(UserInfo userInfo,
boolean viewOnly,
InventorySetRemote invs,
java.lang.String storeRoom,
java.lang.String siteID,
int[] selected,
int allowanceDays,
boolean directOrder,
boolean ignoreReorderPoint)
Deprecated.
as of 7.5
Use @link #getReorderSet(UserInfo, boolean, InventorySetRemote, String, String, int[], int, boolean, boolean, boolean )
|
ReorderSetRemote |
getReorderSet(UserInfo userInfo,
boolean viewOnly,
InventorySetRemote invs,
java.lang.String storeRoom,
java.lang.String siteID,
int[] selected,
int allowanceDays,
boolean directOrder,
boolean ignoreReorderPoint,
boolean includeSoftReservations)
One overloaded form of getReorderSet().
|
ReorderSetRemote |
getReorderSet(UserInfo userInfo,
boolean viewOnly,
InventorySetRemote invs,
java.lang.String storeRoom,
java.lang.String siteID,
int allowanceDays,
boolean directOrder)
Deprecated.
as of 7.5
Use @link #getReorderSet(UserInfo, boolean, InventorySetRemote, String, String, int, boolean, boolean, boolean)
|
ReorderSetRemote |
getReorderSet(UserInfo userInfo,
boolean viewOnly,
InventorySetRemote invs,
java.lang.String storeRoom,
java.lang.String siteID,
int allowanceDays,
boolean directOrder,
boolean ignoreReorderPoint)
Deprecated.
as of 7.5
Use @link #getReorderSet(UserInfo, boolean, InventorySetRemote, String, String, int, boolean, boolean, boolean)
|
ReorderSetRemote |
getReorderSet(UserInfo userInfo,
boolean viewOnly,
InventorySetRemote invs,
java.lang.String storeRoom,
java.lang.String siteID,
int allowanceDays,
boolean directOrder,
boolean ignoreReorderPoint,
boolean includeSoftReservations)
Returns the mbo set containing the requested reorder records.
|
ReorderSetRemote |
getReorderSet(UserInfo userInfo,
boolean viewOnly,
InventorySetRemote invs,
java.lang.String storeRoom,
java.lang.String siteID,
java.util.Vector selected,
int allowanceDays,
boolean directOrder)
Deprecated.
as of 7.5
Use @link @link #getReorderSet(UserInfo, boolean, InventorySetRemote, String, String, Vector, int, boolean, boolean, boolean)
|
ReorderSetRemote |
getReorderSet(UserInfo userInfo,
boolean viewOnly,
InventorySetRemote invs,
java.lang.String storeRoom,
java.lang.String siteID,
java.util.Vector selected,
int allowanceDays,
boolean directOrder,
boolean ignoreReorderPoint)
Deprecated.
as of 7.5
Use @link @link #getReorderSet(UserInfo, boolean, InventorySetRemote, String, String, Vector, int, boolean, boolean, boolean)
|
ReorderSetRemote |
getReorderSet(UserInfo userInfo,
boolean viewOnly,
InventorySetRemote invs,
java.lang.String storeRoom,
java.lang.String siteID,
java.util.Vector selected,
int allowanceDays,
boolean directOrder,
boolean ignoreReorderPoint,
boolean includeSoftReservations)
One overloaded form of getReorderSet().
|
ReorderSetRemote |
getReorderSetForDirectOrderOnly(UserInfo userInfo,
boolean viewOnly,
java.lang.String siteID)
Gets the reorder set for direct order items only.
|
ReorderSetRemote |
getReorderSetForMR(boolean viewOnly,
MRRemote mr)
Creates a reorder mbo set that corresponds to the specified mr item.
|
void |
init()
Overwritten the app service's init() to do additional things when the service is loaded.
|
void |
monitorThisLock(UserInfo ui,
java.lang.String type,
java.lang.String key,
java.util.Date lockDate,
java.lang.String siteID)
Spawn a thread to sleep the amount of time specified in mxserver.properties'
mxe.reorder.previewtimeout, and wake up to check if the reorder is being performed
on the request locked by the specified reordermutex record.
|
int |
releaseLocks(UserInfo userInfo,
java.lang.String siteID)
Release reordermutex locks of this user.
|
java.lang.String |
whoHasLock(UserInfo userInfo,
int requestType,
java.lang.String targetType,
java.lang.String key,
java.lang.String siteID,
java.lang.String orgID) |
checkSecurity, configure, destroy, freeDBConnection, freeMboSet, getCriteria, getCurrentState, getDBConnection, getLiveObjCount, getLoad, getMaximoDD, getMaxVar, getMboSet, getMXServer, getName, getProfile, getProxy, getSchemaOwner, getServiceInfo, getServiceLogger, getSetForRelationship, getSetFromKeys, getStateCmdList, getStateList, getURL, initCriteriaList, isAppService, isRunning, isSingletonService, restart, setProxy, setRunning, setURL, verifyUser, verifyUser
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
checkSecurity, getCriteria, getCurrentState, getLiveObjCount, getMboSet, getName, getSchemaOwner, getSetForRelationship, getSetFromKeys, getStateCmdList, getStateList, getURL, verifyUser, verifyUser
isAppService, isSingletonService, restart
public ReorderService() throws java.rmi.RemoteException
java.rmi.RemoteException
public ReorderService(MXServer mxServer) throws java.rmi.RemoteException
srvEnv
- -- the "Server Environment" this Service is being created in.mxServer
- java.rmi.RemoteException
public java.util.Date changeState(UserInfo userInfo, int requestType, java.lang.String targetType, java.lang.String siteID, java.lang.String orgID) throws MXException, java.rmi.RemoteException
changeState
in interface ReorderServiceRemote
MXException
java.rmi.RemoteException
changeState(UserInfo,int, String, String)
public java.util.Date changeState(UserInfo userInfo, int requestType, java.lang.String targetType, java.lang.String key, java.lang.String siteID, java.lang.String orgID) throws MXException, java.rmi.RemoteException
changeState
in interface ReorderServiceRemote
userInfo
- user information used to request a mbo setrequestType
- It can be one of the following intergers: VIEWONLY, REORDER or REORDEREXIT. targetType
- Indicate if reorder is for storeroom items, direct order items or are for MR only.
It can be "STOREROOM", ""DIRECTORDER", "MR".key
- The identifier to the reorder mutex table. It is the value of a field in reorder mutex table
which can be used to uniquely identify the entry by the value of this field.
Depends on different target type of the reorder, the field name can be different.
The key is the value of "mrnum" if the reorder process is called by MR, "location" if the reorder is for storeroom,
or null if the reorder is for direct orders.MXApplicationException
- Exception will be thrown if change state request cannot be granted.
GROUP | KEY | REASON | |
---|---|---|---|
reorder | InvalidArgument | if the change state request is not complete or is wrong | |
reorder | InvalidRequest | if the target type is not recognized | |
reorder | ConflictDBAccess | if the reorder control object cannot be accessed due to a database access conflict | |
reorder | ForbidOtherAccess | If the request is "viewonly" or "reorder" check if there is an excluding record for this storeroom. If yes, deny the access. | |
reorder | TryAgain | If a recoverable exception occured and the user can try again. |
MXException
java.rmi.RemoteException
psdi.app.inventory.ReorderService#changeState(UserInfo,int, String, String)
public java.lang.String getMutexWhere(UserInfo userInfo, java.lang.String targetType, java.lang.String key, java.lang.String siteID, java.lang.String orgID) throws MXException, java.rmi.RemoteException
MXException
java.rmi.RemoteException
public java.lang.String whoHasLock(UserInfo userInfo, int requestType, java.lang.String targetType, java.lang.String key, java.lang.String siteID, java.lang.String orgID) throws MXException, java.rmi.RemoteException
MXException
java.rmi.RemoteException
public void monitorThisLock(UserInfo ui, java.lang.String type, java.lang.String key, java.util.Date lockDate, java.lang.String siteID) throws MXException, java.rmi.RemoteException
monitorThisLock
in interface ReorderServiceRemote
MXException
java.rmi.RemoteException
monitorThisLock(UserInfo ui, String type, String key, java.util.Date lockDate, String)
@Deprecated public ReorderSetRemote getReorderSet(UserInfo userInfo, boolean viewOnly, InventorySetRemote invs, java.lang.String storeRoom, java.lang.String siteID, int allowanceDays, boolean directOrder) throws MXException, java.rmi.RemoteException
getReorderSet
in interface ReorderServiceRemote
MXException
java.rmi.RemoteException
getReorderSet(UserInfo, boolean, InventorySetRemote, String, String, int, boolean)
@Deprecated public ReorderSetRemote getReorderSet(UserInfo userInfo, boolean viewOnly, InventorySetRemote invs, java.lang.String storeRoom, java.lang.String siteID, int allowanceDays, boolean directOrder, boolean ignoreReorderPoint) throws MXException, java.rmi.RemoteException
getReorderSet
in interface ReorderServiceRemote
MXException
java.rmi.RemoteException
public ReorderSetRemote getReorderSet(UserInfo userInfo, boolean viewOnly, InventorySetRemote invs, java.lang.String storeRoom, java.lang.String siteID, int allowanceDays, boolean directOrder, boolean ignoreReorderPoint, boolean includeSoftReservations) throws MXException, java.rmi.RemoteException
userInfo
- UserInfo object of whom is performing this operation.directOrder
- Indicates if direct order is included in this reorder request. When it is true,
this method will include the direct order items specified in wpitem.viewOnly
- Indicates if the purpose of obtaining the reorder set is for viewing only.
If it is true, a lock won't be applied to the same set of records. Another user can
still view or reorder for the same storeroom or direct order items.invs
- The inventory mbo set. All the items specified in this set will be considered
reordering. This set has to only contain items in the storeroom specified in parameter storeroom.storeRoom
- The storeroom of the reorder. It can be null if the user only wants
to order for direct order items.allowanceDays
- Allowance days, considered for order's required date.MXApplicationException
- GROUP | KEY | REASON | |
---|---|---|---|
reorder | ForbidOtherAccess | if there is another user reordering for the same storeroom. | |
reorder | StoreRoomMissing | if the storeroom is not specified and it is not for direct order only. | |
reorder | StoreRoomNotGranted | if another user was exclusive access for this storeroom. | |
reorder | DirectOrderNotGranted | if the direct order request process was skiped. It is being processed already. | |
reorder | Abort | Failed to perform reorder due to exclusive access by another user. | |
reorder | TryAgain | If a recoverable exception occured and the user can try again. |
MXException
java.rmi.RemoteException
ReorderSetRemote.cancelReorder()
public ReorderSetRemote getReorderSetForMR(boolean viewOnly, MRRemote mr) throws MXException, java.rmi.RemoteException
getReorderSetForMR
in interface ReorderServiceRemote
viewOnly
- If this set is for preview only.mr
- MR object which needs to be ordered.MXApplicationException
- GROUP | KEY | REASON |
---|---|---|
reorder | MRBeingOrdered | if an exception is caught in changeState() |
reorder | TryAgain | If a recoverable exception occured and the user can try again. |
reorder | reorderFail | If something is wrong with more than one item. |
MXException
java.rmi.RemoteException
getReorderSet(UserInfo, boolean, InventorySetRemote, String, int, boolean)
public ReorderSetRemote getReorderSetForDirectOrderOnly(UserInfo userInfo, boolean viewOnly, java.lang.String siteID) throws MXException, java.rmi.RemoteException
getReorderSetForDirectOrderOnly
in interface ReorderServiceRemote
userInfo
- UserInfo object of whom is performing this operation.viewOnly
- This set if for preview only.none
MXException
java.rmi.RemoteException
getReorderSet(UserInfo, boolean, InventorySetRemote, String, String, int, boolean, boolean)
public ReorderSetRemote getReorderSet(UserInfo userInfo, boolean viewOnly, InventoryRemote inv) throws MXException, java.rmi.RemoteException
getReorderSet
in interface ReorderServiceRemote
userInfo
- UserInfo object of whom is performing this operation.viewOnly
- The request is preview only.inv
- The inventory record to be reordered.none
MXException
java.rmi.RemoteException
getReorderSet(UserInfo, boolean, InventorySetRemote, String, int, boolean)
public ReorderSetRemote getReorderSet(UserInfo userInfo, boolean viewOnly, InventoryRemote inv, boolean ignoreReorderPoint) throws MXException, java.rmi.RemoteException
getReorderSet
in interface ReorderServiceRemote
MXException
java.rmi.RemoteException
@Deprecated public ReorderSetRemote getReorderSet(UserInfo userInfo, boolean viewOnly, InventorySetRemote invs, java.lang.String storeRoom, java.lang.String siteID, int[] selected, int allowanceDays, boolean directOrder) throws MXException, java.rmi.RemoteException
getReorderSet
in interface ReorderServiceRemote
MXException
java.rmi.RemoteException
getReorderSet(UserInfo, boolean, InventorySetRemote, String, String, int[], int, boolean)
@Deprecated public ReorderSetRemote getReorderSet(UserInfo userInfo, boolean viewOnly, InventorySetRemote invs, java.lang.String storeRoom, java.lang.String siteID, int[] selected, int allowanceDays, boolean directOrder, boolean ignoreReorderPoint) throws MXException, java.rmi.RemoteException
getReorderSet
in interface ReorderServiceRemote
MXException
java.rmi.RemoteException
public ReorderSetRemote getReorderSet(UserInfo userInfo, boolean viewOnly, InventorySetRemote invs, java.lang.String storeRoom, java.lang.String siteID, int[] selected, int allowanceDays, boolean directOrder, boolean ignoreReorderPoint, boolean includeSoftReservations) throws MXException, java.rmi.RemoteException
userInfo
- UserInfo object of whom is performing this operation.viewOnly
- If the request is for preview onlyinvs
- The set of inventory record among which the selected ones are to be reorderedstoreRoom
- The storeroom which contains those specified inventory items.selected
- An array of int to identify the indexes of those objects in inventory set.
Only these items will be reordered.allowanceDays
- Allowance daysdirectOrder
- Whether direct order items will be reordered.MXApplicationException
- GROUP | KEY | REASON | |
---|---|---|---|
reorder | FailGetSet | if a where clause cannot be generated from the passed in inventory set and index array |
MXException
java.rmi.RemoteException
getReorderSet(UserInfo, boolean, InventorySetRemote, String, int, boolean)
public ReorderSetRemote getReorderSet(UserInfo userInfo, boolean viewOnly, InventorySetRemote invs, java.lang.String storeRoom, java.lang.String siteID, java.util.Vector selected, int allowanceDays, boolean directOrder) throws MXException, java.rmi.RemoteException
getReorderSet
in interface ReorderServiceRemote
MXException
java.rmi.RemoteException
getReorderSet(UserInfo, boolean, InventorySetRemote, String, String, Vector, int, boolean)
public ReorderSetRemote getReorderSet(UserInfo userInfo, boolean viewOnly, InventorySetRemote invs, java.lang.String storeRoom, java.lang.String siteID, java.util.Vector selected, int allowanceDays, boolean directOrder, boolean ignoreReorderPoint) throws MXException, java.rmi.RemoteException
getReorderSet
in interface ReorderServiceRemote
MXException
java.rmi.RemoteException
public ReorderSetRemote getReorderSet(UserInfo userInfo, boolean viewOnly, InventorySetRemote invs, java.lang.String storeRoom, java.lang.String siteID, java.util.Vector selected, int allowanceDays, boolean directOrder, boolean ignoreReorderPoint, boolean includeSoftReservations) throws MXException, java.rmi.RemoteException
userInfo
- UserInfo object of whom is performing this operation.viewOnly
- If the request is for preview onlyinvs
- The set of inventory record among which the selected ones are to be reorderedstoreRoom
- The storeroom which contains those specified inventory items.selected
- An vector of inventory mbos to identify those objects in inventory set.
Only those will be reordered.allowanceDays
- Allowance daysdirectOrder
- Whether direct order items will be reordered.MXApplicationException
- GROUP | KEY | REASON | |
---|---|---|---|
reorder | FailGetSet | if a where clause cannot be generated from the passed in inventory set and the selected inventory objects vector |
MXException
java.rmi.RemoteException
getReorderSet(UserInfo, boolean, InventorySetRemote, String, int, boolean)
public void addFromWPItem(DBShortcut dbShortcut, UserInfo userInfo, java.lang.String userForThisSet, int allowanceDays, java.lang.String siteIDForThisSet, java.lang.String orgIDForThisSet) throws MXException, java.rmi.RemoteException
userInfo
- userForThisSet
- allowanceDays
- extra lead time specified during reordernone
MXException
java.rmi.RemoteException
public void init()
init
in interface Service
init
in class AppService
Service
public int releaseLocks(UserInfo userInfo, java.lang.String siteID) throws MXException, java.rmi.RemoteException
releaseLocks
in interface ReorderServiceRemote
userInfo,
- the UserInfo object of the login userMXException
java.rmi.RemoteException
releaseLocks(UserInfo, String)