title | description | author | ms.author | ms.date | ms.service | ms.subservice | ms.topic |
---|---|---|---|---|---|---|---|
Business Rules Extension |
You can apply user-defined SQL scripts as an extension of pre-defined business rule conditions and actions in Master Data Services. |
CordeliaGrey |
jiwang6 |
03/01/2017 |
sql |
master-data-services |
conceptual |
[!INCLUDE SQL Server - Windows only ASDBMI]
In [!INCLUDEssMDSshort], you can apply user-defined SQL scripts as an extension of pre-defined conditions and actions.
Note
All scripts have to be defined under [usr] schema.
SQL functions that meet the following criteria can be used as a Business Rule condition.
-
The return value type must be BIT.
-
Only following types are supported for parameter types.
-
NVARCHAR
-
DATETIME2
-
DECIMAL (precision, scale)
precision must be 38
scale must be a value from 0 through 7
-
SQL stored procedures that use the following syntax can be used as a Business Rule action
CREATE PROCEDURE [usr].[YourAction]
(
@MemberIdList mdm.[MemberId] READONLY,
@ModelName NVARCHAR(MAX),
@VersionName NVARCHAR(MAX),
@EntityName NVARCHAR(MAX),
@BusinessRuleName NVARCHAR(MAX)
)
AS BEGIN
...
END
User-defined scripts will not be added to deployment packages. Make sure the target Master Data Services database contains all scripts that are used in the business rules before deploying a package.
Script actions will be executed as mds_br_user which has following permissions
Schema | Permissions |
---|---|
mdm | SELECT |
stg | SELECT, UPDATE, DELETE, EXECUTE, INSERT |
usr | FULL |
To perform this procedure:
-
You must have permission to access the System Administration functional area.
-
You must be a model administrator. For more information, see Administrators (Master Data Services)
-
User defined scripts had been added to the [!INCLUDEssMDSshort] database.
-
In Master Data Manager, click System Administration.
-
On the menu bar, point to Manage and click Business Rules.
-
On the Business Rules page, select a model from the Model drop-down list.
-
From the Entity drop-down list, select an entity.
-
From the Member Types drop-down list, select a type of member for the business rule to apply to.
-
Click Add.
-
Do the following to create a user-defined script as a condition.
-
Under the If block, click on Add button. A panel will be displayed.
-
From the Operator drop-down list, select the user-defined function under User defined script .
-
All parameters of the user defined function are displayed.
-
Assign a value to each parameter
-
Click Save.
-
-
Do the following to take a user-defined script as an action.
-
Under the Then block, click on Add button. A panel will be displayed.
-
From the Operator drop-down list, select user-defined function under User defined script .
-
Click Save.
-
Business Rules (Master Data Services)
Business Rule Conditions (Master Data Services)
Business Rule Actions (Master Data Services)