Samples > Sample stores > Consumer direct sample store > IBM Gift Center for the Consumer direct sample store > IBM Gift Center > Customize the data persistence layer


Extend commands for new business rules

To add new business rules to the IBM Gift Center, you can also extend the following BOD commands:

CheckGiftRegistryCancelEligibilityCmd

Called from the CancelGiftRegistryCmd command. By default, this command checks if a gift registry is eligible for cancellation. Specifically, it checks that a giftRegistryId or externalId is in the value object that represents the gift registry that to cancel or delete.

CheckGiftRegistryItemEligibilityCmd

Called from the ValidateGiftRegistryValuesCmdImpl command. By default, this command expects that the item is in the database, and the command determines the total quantity by comparing the quantity of the item requested with the quantity purchased. It also checks whether the maximum quantity for the item has been exceeded.

CheckGiftRegistryPurchaseRecordEligibilityCmd

Called from the UpdateGiftRegistryCmdImpl command. By default, this command expects that the gift registry exists, and checks whether the item can be purchased successfully (that is, that the quantity for the item purchased is not less than zero).

ValidateMessageParametersCmd

Called from the PostGiftRegistryAnnouncemtCmd command. By default, this command checks if each e-mail address has a domain, and if the specified gift registry exists.

ValidateGiftRegistryValuesCmdImpl

Called from the UpdateGiftRegistryCmdImpl command. By default, this command validates the maximum gift registries allowed for a registrant, the creation date for the gift registry, and the item eligibility.

Each command maps to a task in a defined business process. Each command works on one or more value objects, and these value objects should not be changed.


Related tasks

Configure business rules for customization

Related reference

IBM Gift Center business rules and the GRREGRULE table

Extend commands for new business rules


+

Search Tips   |   Advanced Search