Tutorials > Contracts > Extend the existing contract model
Register the new terms and conditions object
This section refers to relating a terms and conditions object to a new business policy.
In the WebSphere Commerce contracts and policies framework, terms and conditions (also referred to as terms) provide a way to describe an agreement between a buyer and a seller. Terms and conditions can be used in various types of trading agreements, such as contract and RFQ. Terms and conditions objects usually refer to business policies with an optional adjustment. For example, a price terms and conditions object is created by choosing one of the price policy objects. In the price term, an account manager can make adjustments to the store standard price, such as:
- A percentage discount over the standard price list
- A percentage discount on a specified set of products
Each of the adjustments is specified as a term and condition.
When you create a new business policy, there must be at least one terms and conditions object that refers to this business policy, if the policy is to be used in a contract. You can either relate an existing term and condition object to the new business policy (this is done by capturing the relationship between the existing terms and conditions object and the new business policy in the XSD (XML schema definition) files), or you can create a new terms and conditions object that is related to the new business policy.
In the following sections, we will register the MyTC as our new term and condition object. This object will be created in later steps.
Procedure
- Register the new term and condition in the database
When you are creating a new terms and condition object, you must update the database schema to include this object. The database tables that must be updated are TCTYPE and TCSUBTYPE.
- Run the following SQL statements to register the new term and condition in the database:
insert into TCTYPE (TCTYPE_ID) values ('MyTC'); insert into TCSUBTYPE (TCSUBTYPE_ID, TCTYPE_ID, ACCESSBEANNAME, DEPLOYCOMMAND) values ('MySubTC', 'MyTC', 'com.ibm.commerce.contract.objects.MySubTCAccessBean', 'com.mycompany.mycommands.MySubTCDeployCmd');
- Register the new term and condition in the contract XSD
To create the new XSD file:
- Use the new contract XSD file
In this step, we update the Package.xsd file to remove the BuyerContract.xsd file and instead include the CustomizedBuyerContract.xsd file,...
Previous topic: Create a new business policy
Next topic: Create the enterprise bean