(Enterprise)

Case Study: WebSphere Commerce contract modeling

WebSphere Commerce contracts are the foundation for determining what customers can purchase in an online store, and at what price. The contracts functions are flexible in that it can support many types of e-commerce business models and their complex business requirements. This flexibility is powerful, and an optimal contract design can minimize the amount of effort that is required to manage business accounts and contracts. As well, an optimal design can minimize the amount of system resources required and thus enhance system performance.


Fundamental concepts

After you understand these concepts, we can combine them to form an optimal design for a commerce site.


Case study in contract modeling

The following example illustrates how to use these concepts to create an optimal contract design for an online store. A company has a B2B commerce site for its customers. The following requirements need to be supported for their customers:

First, consider a simple design with no sharing at all. Each customer has a set of contracts, each representing a unique bill-to/ship-to combination. Diagram 1 illustrates an example where Customer X has 2 bill-to addresses, and each bill-to address has 2 ship-to addresses. Customer X is entitled to four customer contracts. When an employee of Customer X logs in, they are allowed to shop under the four entitled contracts. (Customer X's business account specifies that they are not entitled to shop using the store's default contract. If the account did not have that setting, then the customer would also be entitled to a fifth contract, the store's default contract). However, there is a requirement that the shopper can shop for one bill-to/ship-to combination at a time. To fulfill this requirement, the store can present a list of entitled contracts to the shopper, and allow the shopper to choose one of the contracts. The shopper can use one selected contract during this shopping session.

This solution, however, presents a usability concern. Each customer might have 10 bill-to addresses, and each bill-to might have at least five associated ship-to addresses. When a customer logs in, they would be presented with a list of 50 bill-to/ship-to combinations. We do not want the customer to scroll a long list. When the customers logs in, they know for which bill-to they are purchasing, and therefore they must first be presented with a list of bill-to addresses. Once a bill-to address is selected, only then will they need to select the appropriate shipping address. We could write some custom logic to present the fifty contracts in a meaningful way, but preferably the contract functionality can be used to help us present the contract selections. The bill-to addresses can be modeled as base contracts, and the associated ship-to addresses are customer contracts that refer to a bill-to contract.

Diagram 2 illustrates these contract relationships. This modified design helps in that we can first present the set of bill-to base contracts, and then only display the referring ship-to base contracts once the bill-to contract was selected. This solution still requires writing some custom code to find all the base contracts from the entitled customer contracts.

Grouping the bill-to and associated ship-to contracts under different organizations help solve this problem. We use the active organization feature of WebSphere Commerce. Instead of displaying a list of base contracts, we display a list of organizations for which the customer can shop. A customer can shop for their own organization, plus any organization they are granted special shopping role under. This role is called the OrganizationParticipant role.

Customer X will no longer be directly entitled to the customer contracts. Instead, we create organizations that represent each of the bill-to addresses. These bill-to organizations will then be the Buyer participants in the ship-to customer contracts under the bill-to base contract. Customer X is given authority to use the contracts for each of the bill-to organizations by having the OrganizationParticipant role in the bill-to organization. When a member of Customer X logs in, they can be presented a list of all the organizations in which they have the OrganizationParticipant role. This essentially means they have a list of the bill-to organizations. When one of these organizations is selected, the OrganizationSetInSession command is called, and switches the user to be a member of the selected organization for this session. As a result, the customer is entitled to the contracts entitled to the selected bill-to organization. Therefore the list of ship-to contracts entitled to the bill-to organization can be presented to the customer. When the customer selects one of the ship-to contracts, that contract can be set in the session with the ContractSetInSession command, and now the customer is shopping under their selected bill-to/ship-to contract.

There are some added benefits of using the Organization Participant solution. For each active organization, the customer uses, they have a separate shopping cart. This fits nicely with our business model as each active organization is mapped to a bill-to address. Therefore, each unique billing address will have its own shopping cart and order, so each bill-to address is billed separately. However, different shipping addresses (different contracts) under the same bill-to will share order.

The billing address for each bill-to can be placed in the address book of the corresponding bill-to organization. This keeps all the billing addresses separate and easily identifiable during the checkout process. In the original design, the user must identify the correct billing address from the customer's address book. Now the billing addresses are separate in each bill-to organization's address book, and the billing address can be completed on the checkout pages by selecting the billing address from the active organization's address book.

All of a customer's contracts need to share the same product and pricing terms and conditions. A base contract is created containing the customer's catalog filter term and condition, and all of the customer's bill-to base contracts refer to the customer's catalog filter base contract. Thus, all the customer contracts share the same terms and conditions, and the terms and condition need to be maintained under one contract. If there were any additional terms specific to a bill-to or ship-to, then they could be added to the applicable contract. Each ship-to customer contract consists of only the union of the terms and conditions from the ship-to contract, the referred to bill-to base contract, and the customer's entitlement base contract.

The customer is entitled to the store's list price, with some exceptions where the customer has their own specific price. The Catalog Filter can specify all the product and pricing information. The filter uses two price lists - the store's master price list to get the list price, and the customer's price exceptions price list. The customer's price exceptions price list has a higher precedence than the store's master price list to ensure that the price exceptions override the list price.

The customer is only allowed to purchase a subset of the master catalog. Any exclusion of categories or products can be set in the Catalog Filter.


Design Review

To review the design:


Conclusion

There are often several ways to model a customer's product and pricing entitlement in a WebSphere Commerce store. However, by effectively using the fundamental contract concepts that are described in the topic, an optimal contract design can be modeled. This design can often reduce the necessary contract management, and reduce the load on system resources. It can take some time and experience to understand all the contract functions and capabilities. However, after these concepts are mastered, then the best way to model a specific store's contract requirements becomes clear.