public class CommonContractStatusHandler extends StatusHandler
Modifier and Type | Field and Description |
---|---|
static boolean[][] |
statusChangeMatrix
A statusChangeMatrix for the legal status changes that can be made.
|
ALLROWS, CHANGEDBY_USER, COUNT_ADDITIONS, COUNT_AFTERSAVE, COUNT_DATABASE, COUNT_DELETED, COUNT_EXISTING, DBCONFIG, DELAYVALIDATION, DELAYVALIDATIONONLY, DISCARDABLE, GOTCOMPLETEWHERE, HIDDEN, NO_RELATEDMBOS_OF_OWNERSCHILDREN_FETCH, NOACCESSCHECK, NOACTION, NOADD, NOCOMMIT, NODELETE, NONE, NOOVERWRITE, NOSAVE, NOSETVALUE, NOUPDATE, NOVALIDATION, NOVALIDATION_AND_NOACTION, NOVALIDATION_AND_NOACTION_ALLOWCROSSOVER, READONLY, REBUILD, REQUIRED, SAMEVALUEVALIDATION, SETBYPARENT, USER
Constructor and Description |
---|
CommonContractStatusHandler(StatefulMbo sm) |
Modifier and Type | Method and Description |
---|---|
void |
approve(java.lang.String desiredStatus,
java.util.Date date)
Validates certain conditions before approving the contract.
|
void |
canApprove(java.lang.String currentMaxStatus)
Contains conditions to check if the status change is legal.
|
void |
canCancel(java.lang.String currentMaxStatus)
Contains conditions to check if the status change to Cancel is legal.
|
void |
cancel(java.lang.String desiredStatus,
java.util.Date date)
Sets the status of the contract to cancel.
|
void |
canChangeStatus(java.lang.String currentStatus,
java.lang.String desiredStatus,
long accessModifier)
Defines which status changes are legal.
|
void |
canClose(java.lang.String currentMaxStatus)
Contains conditions to check if the status change to close is legal.
|
void |
canDraft(java.lang.String currentMaxStatus)
Contains conditions to check if the status change is legal.
|
void |
canExpire(java.lang.String currentMaxStatus)
Contains conditions to check if the status change to Expire is legal.
|
void |
canPndRev(java.lang.String currentMaxStatus)
Contains conditions to check if the status change to Pending Revision is legal.
|
void |
canRevise(java.lang.String currentMaxStatus)
Contains conditions to check if the status change to Revised is legal.
|
void |
canSuspnd(java.lang.String currentMaxStatus)
Contains conditions to check if the status change to Suspend is legal.
|
void |
canUnapprove(java.lang.String currentMaxStatus)
Contains conditions to check if the status change to Unapproved is legal.
|
void |
canWStart(java.lang.String currentMaxStatus)
Contains conditions to check if the status change to Waiting to Start is legal.
|
void |
changeStatus(java.lang.String currentStatus,
java.lang.String desiredStatus,
java.util.Date date,
java.lang.String memo)
Change the status from the current state to a desired state.
|
void |
checkStatusChangeAuthorization(java.lang.String desiredExternalStatus)
Is a certain status change allowable?
This test determines whether a status change is possible by only checking
security.
|
void |
close(java.lang.String desiredStatus,
java.util.Date date)
When the status of the Contract is set to CLOSE, the linestatus of all the
ContractLines will also be set to CLOSE with the exception of Canceled lines.
|
void |
doesContractReferenceExistOnPO()
Returns true if the contract reference exists on any PO Header or POLine, false otherwise
|
void |
draft(java.lang.String desiredStatus,
java.util.Date date)
Sets the status of the contract to Draft.
|
void |
expire(java.lang.String desiredStatus,
java.util.Date date)
Sets the status of the Contract to expire.
|
MboRemote |
getNextRevision()
Returns the next revision reference if a next reference exists.
|
static java.lang.String |
getOptionName(java.lang.String status)
Given a PR Status, return the optionName
Note the status passed in is the INTERNAL status code.
|
void |
possibleStatusChange(java.lang.String currentMaxStatus,
java.lang.String desiredMaxStatus)
Determine if a change of status is legal using the statusChangeMatrix.
|
void |
postStatusChange(java.lang.String currentStatus,
java.lang.String status,
java.util.Date asOfDate,
java.lang.String memo)
Object can over override this method to process post status change logic.
|
void |
revise(java.lang.String desiredStatus,
java.util.Date date)
Sets the status of the Contract to Revised.
|
void |
setLineStatus(java.lang.String externalStatus)
Sets the status of the LINESTATUS to whatever status that is passed into this method.
|
void |
suspnd(java.lang.String desiredStatus,
java.util.Date date)
When the status of the Contract is set to SUSPND, the linestatus of all the
ContractLines will also be set to SUSPND with the exception of Canceled lines.
|
void |
unapprove(java.lang.String desiredStatus,
java.util.Date date)
Sets the status of the contract to Waiting for Approval.
|
preStatusChange, updateMboForStatus
public static boolean[][] statusChangeMatrix
Status |   DRAFT  |  WAPPR  |  APPR  |  CLOSE  |  CANCEL  |  PNDREV  |  REVISE  |  WSTART  |  EXPIRE  |  SUSPND  |
---|---|---|---|---|---|---|---|---|---|---|
DRAFT | false | true | true | true | true | false | false | false | false | false |
WAPPR | true | false | true | true | true | false | false | false | false | false |
APPR | false | false | false | true | true | false | true | false | true | true |
CLOSE | false | false | false | false | false | false | false | false | false | false |
CANCEL | false | false | false | false | false | false | false | false | false | false |
PNDREV | true | true | true | false | true | false | false | false | false | false |
REVISE | false | false | false | false | false | false | false | false | false | false |
WSTART | false | false | true | true | true | false | true | false | false | true |
EXPIRE | false | false | false | true | false | false | false | false | false | false |
SUSPND | true | true | true | true | true | false | false | false | false | false |
public CommonContractStatusHandler(StatefulMbo sm)
sm
- public void possibleStatusChange(java.lang.String currentMaxStatus, java.lang.String desiredMaxStatus) throws MXException, java.rmi.RemoteException
MXApplicationException(contract,
- invalidstatuschange) is thrown when a status change is illegal.MXException
java.rmi.RemoteException
statusChangeMatrix#matrix
public void canChangeStatus(java.lang.String currentStatus, java.lang.String desiredStatus, long accessModifier) throws MXException, java.rmi.RemoteException
canChangeStatus
in class StatusHandler
currentStatus
- The current external status of the Purchase ContractdesiredStatus
- The desired external status of the Purchase ContractaccessModifier
- MXApplicationException("contract",
- "invalidstatus")MXException
java.rmi.RemoteException
possibleStatusChange
,
statusChangeMatrix#matrix
public void checkStatusChangeAuthorization(java.lang.String desiredExternalStatus) throws MXException, java.rmi.RemoteException
StatusHandler
checkStatusChangeAuthorization
in class StatusHandler
MXException
java.rmi.RemoteException
This method is used to build the list of
permitted status changes.
public static java.lang.String getOptionName(java.lang.String status)
status
- The status to return the optionName of.public void canClose(java.lang.String currentMaxStatus) throws MXException, java.rmi.RemoteException
currentMaxStatus
- MXException
java.rmi.RemoteException
public void canExpire(java.lang.String currentMaxStatus) throws MXException, java.rmi.RemoteException
currentMaxStatus
- MXException
java.rmi.RemoteException
public void canSuspnd(java.lang.String currentMaxStatus) throws MXException, java.rmi.RemoteException
currentMaxStatus
- MXException
java.rmi.RemoteException
public void canPndRev(java.lang.String currentMaxStatus) throws MXException, java.rmi.RemoteException
currentMaxStatus
- MXException
java.rmi.RemoteException
public void canRevise(java.lang.String currentMaxStatus) throws MXException, java.rmi.RemoteException
currentMaxStatus
- MXException
java.rmi.RemoteException
public void canWStart(java.lang.String currentMaxStatus) throws MXException, java.rmi.RemoteException
currentMaxStatus
- MXException
java.rmi.RemoteException
public void canApprove(java.lang.String currentMaxStatus) throws MXException, java.rmi.RemoteException
currentMaxStatus
- MXException
java.rmi.RemoteException
public void canDraft(java.lang.String currentMaxStatus) throws MXException, java.rmi.RemoteException
currentMaxStatus
- MXException
java.rmi.RemoteException
public void canUnapprove(java.lang.String currentMaxStatus) throws MXException, java.rmi.RemoteException
currentMaxStatus
- MXException
java.rmi.RemoteException
public void canCancel(java.lang.String currentMaxStatus) throws MXException, java.rmi.RemoteException
currentMaxStatus
- MXException
java.rmi.RemoteException
public void changeStatus(java.lang.String currentStatus, java.lang.String desiredStatus, java.util.Date date, java.lang.String memo) throws MXException, java.rmi.RemoteException
changeStatus
in class StatusHandler
currentStatus
- The Purchase Contract's status now.desiredStatus
- The status to change to.date
- The date as of the status change is to be made.memo
- Memo text.MXException
java.rmi.RemoteException
public void revise(java.lang.String desiredStatus, java.util.Date date) throws MXException, java.rmi.RemoteException
MXException
java.rmi.RemoteException
public void expire(java.lang.String desiredStatus, java.util.Date date) throws MXException, java.rmi.RemoteException
MXException
java.rmi.RemoteException
public void unapprove(java.lang.String desiredStatus, java.util.Date date) throws MXException, java.rmi.RemoteException
approveDate
- MXException
java.rmi.RemoteException
setLineStatus
public void doesContractReferenceExistOnPO() throws MXException, java.rmi.RemoteException
MXException
java.rmi.RemoteException
public void cancel(java.lang.String desiredStatus, java.util.Date date) throws MXException, java.rmi.RemoteException
approveDate
- MXException
java.rmi.RemoteException
setLineStatus
public MboRemote getNextRevision() throws MXException, java.rmi.RemoteException
MXException
java.rmi.RemoteException
public void draft(java.lang.String desiredStatus, java.util.Date date) throws MXException, java.rmi.RemoteException
approveDate
- MXException
java.rmi.RemoteException
setLineStatus
public void close(java.lang.String desiredStatus, java.util.Date date) throws MXException, java.rmi.RemoteException
approveDate
- MXException
java.rmi.RemoteException
public void suspnd(java.lang.String desiredStatus, java.util.Date date) throws MXException, java.rmi.RemoteException
date
- MXException
java.rmi.RemoteException
public void approve(java.lang.String desiredStatus, java.util.Date date) throws MXException, java.rmi.RemoteException
approveDate
- MXException
java.rmi.RemoteException
public void setLineStatus(java.lang.String externalStatus) throws MXException, java.rmi.RemoteException
MXException
java.rmi.RemoteException
public void postStatusChange(java.lang.String currentStatus, java.lang.String status, java.util.Date asOfDate, java.lang.String memo) throws MXException, java.rmi.RemoteException
postStatusChange
in class StatusHandler
MXException
java.rmi.RemoteException