!--a11y-->
Create a Rule Template / Set 
This part of the software has not been tested and/or developed finally. It may not be installed and/ or used by you. Any use or installation is strictly prohibited and shall constitute a material breach of your license agreement with SAP. You hereby acknowledge that any installation or use of this part of the software may lead to serious damage within your software system. In no event shall SAP be liable to you for any direct damages, or for any lost profits, lost savings, or any other incidental, indirect, punitive, or consequential damages, even if advised or aware of the possibility of such damages. By installing or using this part of the software you agree to the restrictions set forth herein and agree that SAP may enforce those restrictions against you.
To create a rule template set and a rule template for an application or an application area or a business process or an application anchor. Rule templates are always created for a scenario.
When a business user requests for a business rule template, you need to create a rule template in the Modeling Studio.
You have logged in to Personalization as a technical user.
1.
Select the required
application / application area / business process / application anchor.
For more information, see Activities keyblock in
Create an
Associated Entity.
2. In the Associated Entities tab, select Rule Template Set and click Show.
3. Click Create.
4. Enter a name and description for the template set and click Save.
You can now create rule templates under it.
5. If you want to create a rule template, click Create.
6. Enter a name and description. Select a scenario and enter the source code for the rule template.

Example: You want to create a rule template SurveyIncentive that allows you to create the following rules and more:
If a
Platinum
customer
completes the survey then offer a golf
driver as an
incentive.
If a Gold customer completes the survey then offer a golf
wedge as an incentive.
If a Silver customer completes
survey then offer a golf putter as an
incentive.
The template text you want is "If a Customer Type customer completes survey then give an incentive of Product Type.".
The code can be as follows:
group CustomerProfiles;
group userEntrySize;
param condition as ?customerProfile(CustomerProfiles);
param Market_Profile.Company_Size as ?url(userEntrySize);
if([?customerProfile])
then
{
ShowIncentives(?url);
};

You can check
for errors by compiling the code. Click Compile.
Press CTRL+ALT+Space for help in writing the code.
7. Click Save.
8. Click Template Text.
9.
Enter the text.
For example, "If a Customer Type customer completes survey then give an
incentive of Product Type.".
10. Click Select Text For Groups.
11.
Mark the text the you want
as a link, select a group and click Attach.
For example, mark the text Customer
Type, select CustomerProfiles and click Attach.
12. Enter a description for the parameter.
13.
Repeat steps 11 and 12 for
other parameters and click Save.
For example, mark the text Product
Type, select url and click Attach.
In order to create a rule using a rule template, you need to know the following details:
· Name of the rule template
· Name of the named condition template
· Name of the named action template
· Parameters passed
In the above example, they are SurveyIncentive, CustomerProfiles and url.
