Business policy objects and commands
A business policy object contains policy information.
- Policy ID
- This is the primary key for the business policy object.
- Policy type
- This defines the business policy type. Price, Product Set, Payment, and Shipping are examples of policy types.
- Policy name
- Each business policy must have a unique name.
- Store entity
- The store or store group in which the business policy is deployed.
- Properties
- A set of default properties that can be passed to the business policy command. The commands associated with the business policy object are stored in the BusinessPolicyCmd table.
- Effective period
- The period for which the business policy object is effective.
- Business policy command
- Zero or more business policy commands that implement the business policy. A business policy command is typically invoked by a business process that can be either a task command or a controller command. For example, the getContractPrice() command gets the price for a term and condition. This price term and condition refers to a particular price policy command and this price policy command is used to calculate the price.
Multiple business policy commands can be associated with a single business policy object. Each business policy command must implement the same interface defined by the business policy type object. The structure of a new business policy command is depicted in the following diagram:
As shown in the preceding diagram, in order to create a new business policy command, you create a new implementation class that extends the WebSphere Commerce BusinessPolicyCmdImpl implementation class. You also create a new interface that extends the BusinessPolicyCmd interface.