Replacing task commands called by a controller command
Replacing task commands allows you to modify how a particular step in the business process is performed. A controller command often calls several task commands that perform individual tasks. Collectively, these tasks make up the business process represented by the controller command. You may need to change the way in which a particular step in the process is performed, rather than adding new business logic to the beginning or end of the controller command. In this case, replace the implementation of the task command that you want to override, with the implementation of a new task command that performs the task in your desired manner.As a result of the design of the WebSphere Commerce programming model, you do not need to create a new controller command implementation class to replace the task command. The controller command instantiates the task command by calling the command factory's createCommand method. The command factory uses the task command's interface name and then determines the correct implementation class, based upon the command registry. As such, to replace the task command that gets instantiated, create a new task command implementation class and then update the command registry so that the original task command interface name is associated with the new task command implementation class. Refer to Customizing existing task commands for more information.
Related tasks
Customizing existing controller commands