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, updateMboForStatuspublic 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.MXExceptionjava.rmi.RemoteExceptionstatusChangeMatrix#matrixpublic void canChangeStatus(java.lang.String currentStatus,
java.lang.String desiredStatus,
long accessModifier)
throws MXException,
java.rmi.RemoteException
canChangeStatus in class StatusHandlercurrentStatus - The current external status of the Purchase ContractdesiredStatus - The desired external status of the Purchase ContractaccessModifier - MXApplicationException("contract", - "invalidstatus")MXExceptionjava.rmi.RemoteExceptionpossibleStatusChange,
statusChangeMatrix#matrixpublic void checkStatusChangeAuthorization(java.lang.String desiredExternalStatus)
throws MXException,
java.rmi.RemoteException
StatusHandlercheckStatusChangeAuthorization in class StatusHandlerMXExceptionjava.rmi.RemoteExceptionThis 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 - MXExceptionjava.rmi.RemoteExceptionpublic void canExpire(java.lang.String currentMaxStatus)
throws MXException,
java.rmi.RemoteException
currentMaxStatus - MXExceptionjava.rmi.RemoteExceptionpublic void canSuspnd(java.lang.String currentMaxStatus)
throws MXException,
java.rmi.RemoteException
currentMaxStatus - MXExceptionjava.rmi.RemoteExceptionpublic void canPndRev(java.lang.String currentMaxStatus)
throws MXException,
java.rmi.RemoteException
currentMaxStatus - MXExceptionjava.rmi.RemoteExceptionpublic void canRevise(java.lang.String currentMaxStatus)
throws MXException,
java.rmi.RemoteException
currentMaxStatus - MXExceptionjava.rmi.RemoteExceptionpublic void canWStart(java.lang.String currentMaxStatus)
throws MXException,
java.rmi.RemoteException
currentMaxStatus - MXExceptionjava.rmi.RemoteExceptionpublic void canApprove(java.lang.String currentMaxStatus)
throws MXException,
java.rmi.RemoteException
currentMaxStatus - MXExceptionjava.rmi.RemoteExceptionpublic void canDraft(java.lang.String currentMaxStatus)
throws MXException,
java.rmi.RemoteException
currentMaxStatus - MXExceptionjava.rmi.RemoteExceptionpublic void canUnapprove(java.lang.String currentMaxStatus)
throws MXException,
java.rmi.RemoteException
currentMaxStatus - MXExceptionjava.rmi.RemoteExceptionpublic void canCancel(java.lang.String currentMaxStatus)
throws MXException,
java.rmi.RemoteException
currentMaxStatus - MXExceptionjava.rmi.RemoteExceptionpublic 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 StatusHandlercurrentStatus - 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.MXExceptionjava.rmi.RemoteExceptionpublic void revise(java.lang.String desiredStatus,
java.util.Date date)
throws MXException,
java.rmi.RemoteException
MXExceptionjava.rmi.RemoteExceptionpublic void expire(java.lang.String desiredStatus,
java.util.Date date)
throws MXException,
java.rmi.RemoteException
MXExceptionjava.rmi.RemoteExceptionpublic void unapprove(java.lang.String desiredStatus,
java.util.Date date)
throws MXException,
java.rmi.RemoteException
approveDate - MXExceptionjava.rmi.RemoteExceptionsetLineStatuspublic void doesContractReferenceExistOnPO()
throws MXException,
java.rmi.RemoteException
MXExceptionjava.rmi.RemoteExceptionpublic void cancel(java.lang.String desiredStatus,
java.util.Date date)
throws MXException,
java.rmi.RemoteException
approveDate - MXExceptionjava.rmi.RemoteExceptionsetLineStatuspublic MboRemote getNextRevision() throws MXException, java.rmi.RemoteException
MXExceptionjava.rmi.RemoteExceptionpublic void draft(java.lang.String desiredStatus,
java.util.Date date)
throws MXException,
java.rmi.RemoteException
approveDate - MXExceptionjava.rmi.RemoteExceptionsetLineStatuspublic void close(java.lang.String desiredStatus,
java.util.Date date)
throws MXException,
java.rmi.RemoteException
approveDate - MXExceptionjava.rmi.RemoteExceptionpublic void suspnd(java.lang.String desiredStatus,
java.util.Date date)
throws MXException,
java.rmi.RemoteException
date - MXExceptionjava.rmi.RemoteExceptionpublic void approve(java.lang.String desiredStatus,
java.util.Date date)
throws MXException,
java.rmi.RemoteException
approveDate - MXExceptionjava.rmi.RemoteExceptionpublic void setLineStatus(java.lang.String externalStatus)
throws MXException,
java.rmi.RemoteException
MXExceptionjava.rmi.RemoteExceptionpublic 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 StatusHandlerMXExceptionjava.rmi.RemoteException