Rediger

Del via


Business Rule Examples (Master Data Services)

Applies to: SQL Server - Windows only Azure SQL Managed Instance

This article shows examples of business rules for Master Data Services. You'll find these examples in the sample models that are included with your installation of Master Data Services.

For instructions on how to deploy the sample models, see Master Data Services Installation and Configuration.

Business Rule Examples

Sample Model Entity Business Rule Name Description
Customer Customer Person pmt terms Specifies default payment terms for customers.

In the following business rule, if the CustomerType attribute value meets the is equal rule condition, then the defaults to rule action is applied to the PaymentTerms attribute. Otherwise no action is taken.

If  
    CustomerType is equal to 2  
Then  
    PaymentTerms defaults to CASH  
Else  
    None      

--------------------------------------------------

Sample Model Entity Business Rule Name Description
Customer Customer Org pmt terms Specifies default payment terms for organizations.

In the following business rule, if the CustomerType attribute value meets the is equal rule condition, then the defaults to rule action is applied to the PaymentTerms attribute. Otherwise no action is taken.

If  
    CustomerType is equal to 1  
Then  
    PaymentTerms defaults to 210Net30  
Else  
    None  

--------------------------------------------------

Sample Model Entity Business Rule Name Description
Product Product DaysToManufacture Specifies the range of days-to-manufacturing for in house manufacturing.

In the following business rule, if the InHouseManufacture attribute value meets the is equal rule condition, then the must be between rule action is applied to the DaysToManufacture attribute. Otherwise no action is taken.

If  
    InHouseManufacture is equal to Y  
Then  
    DaysToManufacture must be between 1 and 10  
Else  
    None  

--------------------------------------------------

Sample Model Entity Business Rule Name Description
Product Product Required fields Specifies the required attributes for the product entity members.

In the following business rule, under all conditions the is required validation action is taken for the specified attributes. The attribute values cannot be Null or blank.

If  
    None  
Then  
    Name is required  
    ProductSubCategory is required  
    Color is required  
    StandardCost is required  
    SafetyStockLevel is required  
    ReorderPoint is required  
    InHouseManufacture is required  
    SellStartDate is required  
    FinishedGoodIndicator is required  
    ProductLine is required  
Else  
    None  

--------------------------------------------------

Sample Model Entity Business Rule Name Description
Product Product Std Cost Requires that the standard cost is greater than 0.

In the following business rule, under all conditions the must be greater than rule action is applied to the StandardCost attribute of products.

If  
    None  
Then  
    StandardCost must be greater than 0  
Else  
    None  

--------------------------------------------------

Sample Model Entity Business Rule Name Description
Product Product FG MSRP Cost Specifies that if the product is a finished good, the MSRP (manufacturer suggested retail price) and dealer costs must be greater than 0.

In the following business rule, if the FinishedGoodIndicator attribute value meets the is equal rule condition, the must be greater than rule action is applied to the MSRP and DealerCost attributes.

If  
    FinishedGoodIndicator is equal to Y  
Then  
    MSRP must be greater than 0  
    DealerCost must be greater than 0  
Else  
    None  

--------------------------------------------------

Sample Model Entity Business Rule Name Description
Product Product Default Name Specifies the default product name based on the values of the Color and Class attributes. When the Color attribute value is not YLO and the Class attribute is not NA, the default name is Yellow NA.

In the following business rule, if the Color and Class attributes do not meet the is equal rule condition, the defaults to rule action is applied to the Name attribute.

If  
    (Color is equal to YLO AND Class is equal to NA) is not true  
Then  
    Name defaults to Yellow NA  
Else  
    Name defaults to Other  

--------------------------------------------------

To view the business rule examples in the sample models

  1. Navigate to the Master Data Services Web site that you set up after installing MDS, and click the System Administration box.
    For instructions on setting up the Web site, see Master Data Services Installation and Configuration.
  2. Click the sample model that contains the business rule, as listed in the tables above, and then click Entities.
  3. Click the entity to which the rule applies, as listed in the tables above, and then click Business Rules.
  4. Click the name of the business rule that you want to view. The UI expands to show the If, Then and Else statements.