public abstract class AbstractProcessBusinessObjectDocumentCmdImpl extends AbstractActionBusinessObjectDocumentCmdImpl implements BusinessObjectDocumentCmd
Unlike the change implementation where the change affects parts of the noun, the process applies to the noun specified in the request. If the information within that noun controls and control how the business process executes but the action applies to the noun.
The Process controller reads common data across the actions within the request and instantiates the task command implementations for those actions and executes them. This pattern is a much simplified version then the pattern required for processing the Change request.
There is an abstract controller implementation the Process control implementation extends from. The purpose of this abstract controller is to perform the common processing pattern and abstract the implementation specific logic for that particular Noun. At the end of calling the process action commands, the controller will persist the changes in the data that was read. The process action commands will follow a specific process action interface which will accept the noun of the action, the prefetch data and the action information. Since the action implementations are very specific for the action, there is no abstract implementation provided. The implementation only needs to implement the process action command interface and provides the appropriate implementation for that action.
Constructor and Description |
---|
AbstractProcessBusinessObjectDocumentCmdImpl()
Instantiates an instance of the process controller business object document command.
|
Modifier and Type | Method and Description |
---|---|
protected BusinessObjectDocumentType | buildAcknowledgeBusinessObjectDocument(java.util.Map nounsAndActions, java.util.Map persistentObjects)
This method builds and returns the business object document that represents the response of this process request.
|
protected void | canPerformAction(java.util.Map nounsAndActions, java.util.Map persistentObjects)
This method performs an authorization check to validate that the current user can perform the actions on the specified nouns.
|
java.lang.String | getNounName()
This method returns the name of the noun extracted from the request business object document.
|
protected java.lang.String | getProcessNounActionCommandInterface()
This method returns the interface name of the command that represents the implementation to process the actions.
|
protected java.lang.String | getVerbName()
This method returns the name of the verb to extract from the request business object document.
|
protected void | performAction()
Performs the request by executing the pre-Process, Process, Post-Process business logic commands instantiated in the validateAction() method.
|
protected java.util.Map | read(java.util.Set nouns)
The purpose of this method is to return a list of objects that represent the data that is involved with this change request.
|
protected void | save(java.util.Map persistentObjects)
The purpose of this method is to save the changes that are contained in the list of persistent objects.
|
void | setProcessNounActionCommandInterface(java.lang.String processNounActionCommandInterface)
This method sets the command interface name that represents the business logic that will perform the process actions.
|
protected void | validate(java.util.Map nounsAndActions, java.util.Map persistentObjects)
This method performs any common validation the process control will share amongst the different process action tasks.
|
protected void | validateAction()
This method validates the action and all the action expressions associated with the action before executing the tasks.
|
public AbstractProcessBusinessObjectDocumentCmdImpl()
protected java.lang.String getProcessNounActionCommandInterface()
public void setProcessNounActionCommandInterface(java.lang.String processNounActionCommandInterface)
protected void validateAction() throws java.lang.Exception
This method validates the action and all the action expressions associated with the action before executing the tasks. The validate action will extract the action expressions from the request business object document. Then the action expressions are grouped by noun for the parts of the noun that is changed. The read() and validate() on the process action noun task commands are executed to read initial data and perform any common validation steps. After an authorization check is performed to determine to ensure the user has the rights to perform the action on the nouns.
After each group of noun parts has the corresponding business logic task command instantiated, passing theOnce all the commands have a chance action expression and the noun to work on. Each task will have an opportunity to read() more data and validate() the specified requests. All validation errors are gathered and returned, otherwise the processing will continue.
protected java.util.Map read(java.util.Set nouns) throws AbstractApplicationException
protected void validate(java.util.Map nounsAndActions, java.util.Map persistentObjects) throws AbstractApplicationException
protected void canPerformAction(java.util.Map nounsAndActions, java.util.Map persistentObjects) throws AbstractApplicationException
protected void performAction() throws java.lang.Exception
protected BusinessObjectDocumentType buildAcknowledgeBusinessObjectDocument(java.util.Map nounsAndActions, java.util.Map persistentObjects)
protected void save(java.util.Map persistentObjects) throws AbstractApplicationException
public java.lang.String getNounName()
protected java.lang.String getVerbName()