public class HandleApprovalsCmdImpl extends com.ibm.commerce.tools.command.ToolsControllerCommandImpl implements HandleApprovalsCmd
Behaviour
This command will raise a business flow event to handle each approval or rejection. The business flow event will handle the updating of the APRVSTATUS table as well as any other activities which have been defined for this transition. The status of the approval requests record in the APRVSTATUS table will be updated to 1 for approved or 2 for rejected.
The command treats each approval or rejection as a separate transaction. It is possible that if command is invoked to process a batch of approvals or rejections, some may succeed and others may fail.
The command will set the resultMsg for the view it sets to indicate the success or failure of the processing. The value of resultmsg will be the appropriate key into the approvalsNLS properties file for the message to be displayed by the JSP.
This command uses the following AccessBeans:
ApprovalStatusAccessBean
Modifier and Type | Field and Description |
---|---|
static java.lang.String |
COPYRIGHT
IBM copyright notice field.
|
static java.lang.String |
EC_APPROVAL_FLOWTYPE_RESELLER_USER_REGISTRATION
Reseller user registration add flow type
|
defaultCommandClassName, NAME
Constructor and Description |
---|
HandleApprovalsCmdImpl() |
Modifier and Type | Method and Description |
---|---|
java.lang.Integer |
getAprvAct()
Gets the action.
|
java.lang.String |
getAprvIds()
Gets the list of approval status IDs to be acted on.
|
java.lang.String |
getComments()
Gets the comments
|
com.ibm.commerce.datatype.TypedProperty |
getViewInputProperties()
This method is called by the Web controller to retrieve the request properties set
by the setRequestProperties() method.
|
java.lang.String |
getViewTask()
Gets the view task name.
|
void |
performExecute()
Processes the approval or rejection.
|
void |
reset()
Reset the command so that it can be invoked again.
|
void |
setAprvAct(java.lang.Integer newAprvAct)
Sets the approval action.
|
void |
setAprvIds(java.lang.String newAprvIds)
Sets the list of approval status IDs to be acted on.
|
void |
setComments(java.lang.String newComments)
Sets the comments.
|
void |
setRequestProperties(com.ibm.commerce.datatype.TypedProperty reqParms)
Sets the request parameters.
|
void |
setViewTask(java.lang.String newViewTask)
Sets the view task name.
|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
checkPermission, fulfills, getForUserId, getGeneric, getOwner, getRequestProperties, getResolvedRequestProperties, getResourceOwners, getResponseProperties, getRetriable, isGeneric, isRetriable, mergeProperties, setForUserId, setGeneric, setOwner, setResponseProperties, setRetriable, setViewInputProperties
accessControlCheck, checkIsAllowed, checkResourcePermission, createCommandExecutionEvent, execute, getAccCheck, getCommandContext, getCommandIfName, getCommandName, getCommandStoreId, getDefaultProperties, getExceptionInvokeParameters, getObjectSize, getPostInvokeParameters, getPreInvokeParameters, getResources, getStoreId, getUser, getUserId, isReadyToCallExecute, setAccCheck, setCommandContext, setCommandIfName, setCommandStoreId, setDefaultProperties, validateParameters
checkPermission, execute, getGeneric, getRequestProperties, getResolvedRequestProperties, getResponseProperties, getRetriable, isGeneric, isRetriable, mergeProperties, setGeneric, setRetriable, setViewInputProperties
accessControlCheck, getAccCheck, getForUserId, getResourceOwners, setAccCheck, setForUserId, setOwner
checkIsAllowed, checkResourcePermission, createCommandExecutionEvent, getCommandContext, getCommandIfName, getCommandName, getCommandStoreId, getDefaultProperties, getExceptionInvokeParameters, getPostInvokeParameters, getPreInvokeParameters, getResources, getStoreId, getUser, getUserId, setCommandContext, setCommandIfName, setCommandStoreId, setDefaultProperties, validateParameters
public static final java.lang.String COPYRIGHT
public static final java.lang.String EC_APPROVAL_FLOWTYPE_RESELLER_USER_REGISTRATION
public java.lang.Integer getAprvAct()
getAprvAct
in interface HandleApprovalsCmd
public java.lang.String getAprvIds()
getAprvIds
in interface HandleApprovalsCmd
public java.lang.String getComments()
getComments
in interface HandleApprovalsCmd
public com.ibm.commerce.datatype.TypedProperty getViewInputProperties()
getViewInputProperties()
method in the ToolsControllerCommandImpl
command. This takes care of removing the parameters specific to the tools framework.getViewInputProperties
in interface com.ibm.commerce.command.ControllerCommand
getViewInputProperties
in class com.ibm.commerce.tools.command.ToolsControllerCommandImpl
public java.lang.String getViewTask()
getViewTask
in interface HandleApprovalsCmd
public void performExecute() throws com.ibm.commerce.exception.ECSystemException
After setting some return messages based on the action,this method will loop through the approval requests to be processed. For each request to be processed, it will:
After all approval requests have been processed, it will use the success and failure counts to determine which message to return to the JSP.
performExecute
in interface com.ibm.commerce.command.ECCommand
performExecute
in class com.ibm.commerce.command.AbstractECTargetableCommand
com.ibm.commerce.exception.ECSystemException
- if a CreateExeception, FinderException, RemoteException,
NamingException or any other exception is thrown by the AccessBean or by the
BusinessFlowManager.public void reset()
reset
in class com.ibm.commerce.command.AbstractECTargetableCommand
public void setAprvAct(java.lang.Integer newAprvAct)
setAprvAct
in interface HandleApprovalsCmd
newAprvAct
- The approval action.public void setAprvIds(java.lang.String newAprvIds)
setAprvIds
in interface HandleApprovalsCmd
newAprvIds
- The list of approval status ids to be acted on.public void setComments(java.lang.String newComments)
setComments
in interface HandleApprovalsCmd
newComments
- The optional approval/rejection comments supplied by the approver.public void setRequestProperties(com.ibm.commerce.datatype.TypedProperty reqParms) throws com.ibm.commerce.exception.ECApplicationException
setRequestProperties
in interface com.ibm.commerce.command.ControllerCommand
setRequestProperties
in class com.ibm.commerce.tools.command.ToolsControllerCommandImpl
reqParms
- The TypedProperty containing the request parameters.com.ibm.commerce.exception.ECApplicationException
- if:
public void setViewTask(java.lang.String newViewTask)
setViewTask
in interface HandleApprovalsCmd
newViewTask
- The view task to be set upon completion of the command.