Introduction
Deployment Rules allow the application modelers to customize the deployment process by issuing a set of XMLA or SQL commands upon deployment.
We can use deployment rules to automate tasks such as:
- Dynamically updating the Current Month variable
- Auto-validating and correcting dimension attribute values
- Syncing data such as exchange rates from source system
By default, applications have the Process OLAP deployment rules, which generates and processes your solutions.
Create a Script
We will explain how to use a script to update the Current Month variable dynamically. If you are not familiar with variables, refer to this article.
1. In the Modeler, select the Scripts node under Deployment.
2. Click Add.
3. Give the script a name, select its type, and click Save.
4. Click Edit and write the script definition.
5. Click Save .
Run Scripts
Deployment rules run every time we deploy an application. The script order determines the sequence of execution. Click the Move up and Move Down arrows to adjust the script order as necessary.
Note: You should always put the Process OLAP script at the bottom of the list, to ensure it runs at the end.