How to Automatically Run Business Rules from SQL
To request the execution of a Business Rule over a slice of an application, are record must be written to the DataSubmissions table in the Callisto_Server database. The following fields must be populated as indicated in this record. After the record has been written to the table, the request will be automatically processed by the NT Service just like a request to run a Business Rule from the Data Manager.
- UserID – Windows userid for the request. All records created in the Fact table by this request will be tagged with this userid.
Submission – An xml document defining the Business Rule to be executed and the slice of the application the rule will be executed across. See an example below.
ASDatabase – Name of the Application.
ASCube – Name of the Model.
CreateTime – Populate using the SQL GetDate() function.
Example of Submission xml document:
<runbusinessrule xmlns="http://www.perlielab.com/"> <structure> <db>T4</db> <cube>Finance</cube> <dims> <dim id="Account" /> <dim id="BusinessProcess" /> <dim id="Client" /> <dim id="Currency" /> <dim id="Entity" /> <dim id="Intercompany" /> <dim id="Measures" /> <dim id="PriceAccount" /> <dim id="Product" /> <dim id="Scenario" /> <dim id="Time" /> <dim id="TimeDataView" /> </dims> <delimiter value="," /> </structure> <BusinessRule Label="Automatic"> <BusinessRuleParameter Label="ScenarioMbrs" Dimension="Scenario" Values="1" /> <BusinessRuleParameter Label="TimeMbrs" Dimension="Time" Values="4" /> <BusinessRuleParameter Label="EntityMbrs" Dimension="Entity" Values="12,13,14,16,17,18,20,21,24,25,27,29,30,31,36,38,40,44,5,6,8,9" /> </BusinessRule> </runbusinessrule>
In the structure section, all dimensions in the Model must be listed or the request will fail.
In the BusinessRule section, there must be a BusinessRuleParameter for the dimensions Scenario, Time, and Entity. The Values attribute must contain a comma separated list of the internal ids of each member the rule should be executed for.