Download as pdf or txt
Download as pdf or txt
You are on page 1of 24

CUSTOMER

SAP HANA Rules Framework 1.0 SPS 08


Document Version: 1.0 – 2016-07-14

SAP HANA Rules Framework - Modeling Guide


Content

1 Getting Started . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4

2 Modeling a Vocabulary. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5
2.1 Adding Tables. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6
2.2 Adding Columns as Attributes. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6
2.3 Creating an Association. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7
2.4 Creating Actions in the Vocabulary. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .7
2.5 Creating a Reusable Output Type . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 9
2.6 Activating a Vocabulary. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 9
2.7 Extending a Predelivered Vocabulary. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 10

3 Modeling a Decision Table Rule. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .12


3.1 Modeling a Rule Using a Public Vocabulary. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 12
Adding Attributes to Condition Columns . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 13
Adding Condition Values . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 14
Adding a Rule Output from Vocabulary. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 14
Working with the Execution Context. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .15
Activating a Rule. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 17
3.2 Modeling a Rule Using a Private Vocabulary. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .18
Creating a Rule Output . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .19

4 Modeling a Rule of Type IF-THEN. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 20


4.1 Adding Conditions. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .21
4.2 Adding a Rule Action from the Vocabulary. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 21

CUSTOMER SAP HANA Rules Framework - Modeling Guide


2 © 2016 SAP SE or an SAP affiliate company. All rights reserved. Content
Document History

This change log is a record of additions and major changes to the SAP HANA Rules Framework Modeling Guide
since the previous support package stack (SPS). Where applicable, each item links to the topic concerned.

Tip
For further information about all the additions and changes in this release, including patch level releases,
refer to SAP Note 2332946 .

Date / Version Description

July 14, 2016 As of this release, you can only add attributes to condition columns by choosing Add in the context
Doc. v1.0 menu of the Condition Columns node.
See: Adding Attributes to Condition Columns [page 13]

SAP HANA Rules Framework - Modeling Guide CUSTOMER


Document History © 2016 SAP SE or an SAP affiliate company. All rights reserved. 3
1 Getting Started

This guide describes modeling resources for SAP HANA rules framework using SAP HANA studio. SAP HANA
rules framework provides a set of tools that allows end users to build decision logic based on data of an
organization.

Target Audience

This guide is intended for solution experts and application developers to execute the following tasks:

● Modeling vocabulary
● Modeling two types of rules such as rules of decision table type and IF-THEN type

About the SAP HANA Rules Framework Modeling Tools

These are the set of tools that are a part of SAP HANA studio. These tools enable solution experts and
application developers to create rule based applications, which includes modeling predefined content as part
of the application. For more information about various resources supported by SAP HANA rules framework,
see SAP HANA Rules Framework Development & Implementation Guide .

Business Scenarios

You use rules of decision table type for the tabular representation of business logic. Transactions like online
shopping for example require application of rules in tabular form. You use rules of IF-THEN type for the textual
representation of business logic. For example, you use text-based representation of rules in frequent car
insurance claims.

Prerequisites and Installing the Modeling Tools

● You must install the SAP HANA rules framework modeling tools to get started with the modeling.
For more information on installation, see the Deploying the SAP HANA Rules Framework Modeling Tools
(Optional) section in the SAP HANA Rules Framework Installation & Upgrade Guide on SAP Service
Marketplace on http://service.sap.com/%7Eform/sapnet?_SHORTKEY=00200797470000103845 .
● You are granted the sap.hrf::ReadAnyVocabulary application privilege to use the SAP HANA rules
framework modeling tools.

CUSTOMER SAP HANA Rules Framework - Modeling Guide


4 © 2016 SAP SE or an SAP affiliate company. All rights reserved. Getting Started
2 Modeling a Vocabulary

You use a vocabulary to express the business logic either with the rule expression language, or with the
selection of actions and outputs to be performed.

Context

A vocabulary defines the data model that you share across different rule artifacts. It acts as the semantic layer
that describes the data model, actions, and output structure that you use in the application. Typically, an
application contains different vocabularies.

For more information about vocabularies, see SAP HANA Rules Framework Development & Implementation
Guide .

Procedure

1. Launch SAP HANA studio.


2. Select the SAP HANA Development perspective.
3. Select a project from the Project Explorer view.

4. In the context menu of a project, Choose New Other .

5. In the wizard, choose SAP HANA Application Development Rules Framework Vocabulary .
6. Choose Next.
7. In Create New Rule Vocabulary, browse to select a project.
8. Enter a name and description.
9. Choose Finish.

New vocabulary appears on the workspace.

10. In the Outline pane of the vocabulary editor, select .


11. In the Properties pane, select Scope. You can set the Global scope to:

Scope Description

Yes Vocabularies are available to all the rules by default.

No Vocabularies are not available to all the rules by default.

SAP HANA Rules Framework - Modeling Guide CUSTOMER


Modeling a Vocabulary © 2016 SAP SE or an SAP affiliate company. All rights reserved. 5
2.1 Adding Tables

You add tables to use the table columns as data objects while modeling a vocabulary.

Procedure

● If you want to add physical tables, go to the Project Explorer tab and drag the required tables from
Catalog Tables to the Data Foundation node.

Note
Alternatively, you can add tables using the below steps:
1. Select the Data Foundation node.

2. Choose the icon.


3. In search field, enter the required table name.

● If you want to add information views, go to the Systems tab and drag the required information views by
choosing a Package Content .

2.2 Adding Columns as Attributes

You add columns as attributes to connect the actual data to the attributes.

Procedure

1. In the Details pane of the Data Foundation node, select the required table column.
2. In the context menu of the required column, choose Add as Attribute.

Note
○ The Vocabulary node in the Outline pane is hierarchical in structure. The first level of hierarchy is
the data object. This data object consists of tables or views. The next levels are attributes and
associations that you use to build the rule condition expressions.
○ You can add multiple columns at the same time.
○ If you want to delete attributes from the Attributes node, select an attribute and in its context menu,
choose Remove.

CUSTOMER SAP HANA Rules Framework - Modeling Guide


6 © 2016 SAP SE or an SAP affiliate company. All rights reserved. Modeling a Vocabulary
2.3 Creating an Association

You use associations to relate various data objects, and to enable rule expressions to navigate from a source
data object to an attribute of the target data object.

Procedure

1. In the Scenario pane, choose the Data Foundation node.


2. In the corresponding Details pane, choose the data object that acts as the source of the association from
the table.
3. If you want to link one column to another column, link a column in the source data object to a column in
the target data object.
4. If you want to link multiple attributes from source to target, then choose Create Association in the context
menu of a data object table in the Outline pane. Then follow to the below substeps:
a. In the Create Association window, provide a name for the association.
b. In the Source dropdown list, select the required source data object.
c. In the Cardinality dropdown list, select the required cardinality.
d. In the Target dropdown list, select the target data object.
The attributes present in the source and target data objects appear.
e. Link an attribute in the source to an attribute in the target.

Note
You can also link multiple attributes.

f. Choose OK.
5. To edit the composite association, choose Edit in the context menu of the required association.
6. To delete the composite association, choose Delete in the context menu of the required association.

2.4 Creating Actions in the Vocabulary

You create an action that the system executes upon successful evaluation of a condition.

Context

The example given below explains the action performed on evaluation of a condition.

SAP HANA Rules Framework - Modeling Guide CUSTOMER


Modeling a Vocabulary © 2016 SAP SE or an SAP affiliate company. All rights reserved. 7
Example
Consider a scenario where you want to make an insurance claim for your car. If the number of claims is
more than 3, and the age of the policy holder is less than 22, the system raises a fraud alert action.

Procedure

1. In the context menu of the Actions node, choose Add.


2. In the Add Action dialog, enter a name and description for the action.

3. In XSJS Library, choose the icon.


4. In the Find dialog, choose the required XSJS library.

Note
The XSJS library needs to have a HANA rules framework specific function. For more information, see
“Consuming a Rule Service” in the SAP HANA Rules Framework Development & Implementation Guide

5. Choose OK.
6. In the Action Parameters section, choose Add.
7. Provide parameter details.
8. In the Static Action Parameters section, choose Add.

9. Choose to display all the existing expressions in tables.


10. In the dropdown list, select the required expressions to add them as static action parameters.
11. Choose OK.

Results

These attributes appear in the Actions node.

CUSTOMER SAP HANA Rules Framework - Modeling Guide


8 © 2016 SAP SE or an SAP affiliate company. All rights reserved. Modeling a Vocabulary
2.5 Creating a Reusable Output Type

You use this procedure to define output types in vocabulary, which you reuse across different rules. After
adding them as a rule output through the rules editor, they contain the results of the rule execution.

Procedure

1. In the context menu of the Output Types node, choose Add.


2. In the Add Output dialog, enter the name and description of the output type.
3. In the Parameters section, choose Add.
4. Add parameter details.
5. Choose Add in the Static Parameters section.
6. Enter a name.

7. Select the icon, which displays all the expressions present in tables.

Note
You can also add complex expression to a static parameter.

8. Select the required Expression from the dropdown list to add them as Static Parameters.
9. Choose OK.
These attributes appear in the Output Types node.

Note
○ The hierarchy of the Output Types node is the name of the output followed by various parameters.
○ You create multiple outputs by following the same procedure.

2.6 Activating a Vocabulary

You activate a vocabulary to enable the rules to use the vocabulary.

Prerequisites

You have the runtime plug-in of SAP HANA rules framework active.

SAP HANA Rules Framework - Modeling Guide CUSTOMER


Modeling a Vocabulary © 2016 SAP SE or an SAP affiliate company. All rights reserved. 9
Procedure

1. In the Project Explorer view, choose the required vocabulary.

Note
The vocabulary must contain the extension .hprvocabulary.

2. Save the vocabulary.

3. In the context menu of the required vocabulary, choose Team Activate .

The system generates a message for successful activation of vocabulary.

Note
For more information about creating a rule using a vocabulary, see Modeling a Rule using Public
Vocabulary [page 12]

2.7 Extending a Predelivered Vocabulary

You can extend a predelivered application vocabulary with your own data objects, outputs, and action. This
extended vocabulary ensures all the entities from the reference vocabulary cannot be edited.

Procedure

1. If you want to consume a reference vocabulary within another vocabulary or a rule, then open the
vocabulary or rule where you want to consume a vocabulary.
2. Create a vocabulary that you want to consume.
3. Drag the created vocabulary from Project Explorer to the Data Foundation node.

○ If you are consuming a vocabulary in another vocabulary, then the reference vocabulary appears in
the Data Foundation node. The data objects of the referenced vocabulary appear in the Details pane,
Actions node and Output node. If the referenced vocabulary is itself referencing another vocabulary,
then all level data objects appear in the topmost reference.
○ If you are consuming a vocabulary in a rule, then the reference vocabulary appears in the Data
Foundation node. If the reference vocabulary contains a child vocabulary, then the tables from the
child vocabularies also appear in the Details pane and Outline pane.

4. In the context menu of the required vocabulary or rule in Project Explorer, choose Team Activate to
activate the vocabulary or rule respectively.

Note
○ The referenced vocabulary entities such as data objects, attributes, associations, actions, and
output types are not editable. However, you can add these elements as conditions and outputs.

CUSTOMER SAP HANA Rules Framework - Modeling Guide


10 © 2016 SAP SE or an SAP affiliate company. All rights reserved. Modeling a Vocabulary
○ You can add only one reference vocabulary.
○ You can add an existing attribute from a data object of reference vocabulary as an extended
attribute within an extended data object. This extended data object cannot have the same alias
name as data object of reference vocabulary. These extended data objects appear in Details and
Outline pane.
○ For a rule, you can perform Add As Condition Column and Add As Rule Output on the extended data
objects as they are editable. Also, you can add them as rule actions for a text rule.
○ For a rule, you can add the attributes of reference vocabulary as data objects in Input Parameters,
Data Objects of Execution Context, and Output, which are not editable but consumable in
conditions, actions and outputs.

Related Information

Modeling a Vocabulary [page 5]

SAP HANA Rules Framework - Modeling Guide CUSTOMER


Modeling a Vocabulary © 2016 SAP SE or an SAP affiliate company. All rights reserved. 11
3 Modeling a Decision Table Rule

A decision table rule is a tabular representation of business logic containing a set of related input conditions
and output expressions.

Rules capture complex business logic in the form of business conditions and results. For example, formulating
business rules that calculate discount on the orders based on region and sales. Rules return results if they
satisfy the conditions defined in them. These results are in the form of simple structured output or of an
executable XSJS action. SAP HANA rules framework currently provides two models to define decision logic,
one of which is a decision table-based rule.

3.1 Modeling a Rule Using a Public Vocabulary

You use this procedure to model rules using a predefined vocabulary. After evaluation against live data, these
rules lead to a decision.

Prerequisites

You have created an active vocabulary. See Modeling a Vocabulary [page 5].

Procedure

1. Launch SAP HANA studio.


2. Select the SAP HANA Development perspective.
3. Go to the Project Explorer view in the SAP HANA Development perspective and select a project.

4. Choose New Other .

5. In the wizard, choose SAP HANA Application Development Rules Framework Rule .
6. Choose Next.
7. In the Create New Rule dialog, and browse for a project.
8. Enter a name and description.
9. Select Decision Table as the Type.
10. Choose Finish.

11. Select Data Foundation to add a vocabulary.

CUSTOMER SAP HANA Rules Framework - Modeling Guide


12 © 2016 SAP SE or an SAP affiliate company. All rights reserved. Modeling a Decision Table Rule
Note
You can only use an active vocabulary.

3.1.1 Adding Attributes to Condition Columns

You add attributes to condition columns as condition describes the rule whether or not to trigger any decision.

Procedure

1. In the context menu of the Condition Columns node, choose Add.


2. Provide name and expression.

Note
○ You can enter the attributes as an expression in the Expression field.
○ Content assist is available for adding expressions. This feature enables the selection and insertion
of existing code elements to complete partially entered code.
○ The expression that you provide should begin with the leading object notation in accordance with
Rule Expression Language. If you want to refer to the attribute of a non-leading object, then you
should use the following syntax: <Data Object Context/LeadingObject>.<Association
Name/Navigation Path>.<Target Attribute Name>
For example, consider Account(AccountNumber, AccountHolderName, Balance) and
Customer(CustomerName, CustomerAddress, CreditPoints) as two data objects of the vocabulary.
If “Account” is chosen as the Data Object Context (acting as the leading object) and that there is an
association between Account.AccountHolderName and Customer.CustomerName as "relation".
If you want to specify the following rule:
If Customer's Credit Points is greater than 500, then Account Balance should be redeemed with a
credit of 500 (current currency). This is modelled as

Sample Code

If
Account.relation.CreditPoints >500
Then
Account.Balance= Account.Balance+500;

○ An expression that does not follow the leading object notation should be updated manually, if it is
already consumed by an active rule.

3. Choose OK.

Note
○ To delete conditions, choose Remove from the context menu of the Condition Columns node in the
Outline pane.

SAP HANA Rules Framework - Modeling Guide CUSTOMER


Modeling a Decision Table Rule © 2016 SAP SE or an SAP affiliate company. All rights reserved. 13
○ You can create an alias name for a Condition Columns by editing the value of the Alias Name field in
the Properties pane.

3.1.2 Adding Condition Values

You add values as an input for the execution of conditions.

Procedure

1. Choose the Decision Table node.


2. In the Details pane, double-click the column of the required attribute.
3. Provide the value.

3.1.3 Adding a Rule Output from Vocabulary

You reuse the output of vocabulary in the output of rule, which returns data upon successful evaluation of
condition.

Procedure

1. In the Outline pane, choose the Output Types that are in the vocabulary.
2. Right-click the Output Types that you want to use.
3. In the context menu of the required output type, select Add as Rule Output.
This output is displayed under Rule Output.
4. In the context menu of the required output in Rule Output, choose Edit.
5. You edit the parameters and static parameters in the Add Output window.
For more information about editing the Add Output, see Creating a Reusable Output Type [page 19].
6. Choose OK.
These attributes appear in the Rule Output node.

CUSTOMER SAP HANA Rules Framework - Modeling Guide


14 © 2016 SAP SE or an SAP affiliate company. All rights reserved. Modeling a Decision Table Rule
3.1.4 Working with the Execution Context

This procedure allows you to represent the business entities and define the working sets.

Context

The execution context node consists of the following subnodes:

● Data Object: This represents the business entity that you evaluate the rule on.
● Filter: This allows definition of the working sets.
● Input Parameters: You use them during the evaluation of data filtering condition. The following are the
three types of input parameters: scalar input parameters, hierarchical input parameters, and data objects.

Procedure

1. To add Data Object, perform the following substeps:


a. Choose Add from the context menu of the Data Object node.
b. Select the required table from the Name dropdown list.
c. Select the Keys column of the required attribute that you want to set as key.
d. Choose OK.
2. To add a Filter, perform the following substeps:
a. Choose Add from the context menu of the Filter node.
b. In Add Filter Condition, enter a Expression as a filter expression.
c. Choose OK.

3.1.4.1 Working with Input Parameters

3.1.4.1.1 Creating Hierarchial Input Parameters

You use this procedure to provide a hierarchial structure for the input parameters.

Procedure

1. In the context menu of the Input Parameters node, choose Add Hierarchial Parameters.
2. In the Add Input Parameters window, provide the required details.
3. Provide name and description.
4. Choose Hierarchy Type to:

SAP HANA Rules Framework - Modeling Guide CUSTOMER


Modeling a Decision Table Rule © 2016 SAP SE or an SAP affiliate company. All rights reserved. 15
○ Structure: It allows logical grouping of parameters.
○ Collection: It translates to table type.

Note
Structure and Collection type of parameters need to have attributes in them.

5. In the Parameters section, choose Add upon adding each parameter.


6. Choose OK.

Note
In the context menu of Input Parameters node, choose Edit to perform any editing.

Results

The hierarchial parameters appear under Input Parameters node.

3.1.4.1.2 Creating Scalar Input Parameters

Procedure

1. In the context menu of the Input Parameters node, choose Add Scalar Parameters.
2. In the Add Input Parameters window, provide the required details.
3. Provide name and description.
4. In the Parameters section, choose Add upon adding each parameter.
5. Choose OK.

Note
In the context menu of Input Parameters node, choose Edit to perform any editing.

Results

The scalar parameters appear under Input Parameters node.

CUSTOMER SAP HANA Rules Framework - Modeling Guide


16 © 2016 SAP SE or an SAP affiliate company. All rights reserved. Modeling a Decision Table Rule
3.1.4.1.3 Adding Data Objects to Input Parameters

You use this procedure to add the vocabulary data objects to the input parameters.

Procedure

1. In the context menu of the Input Parameters node, choose Add Data Objects.
2. In the Add Input Parameters window, provide name and description.
3. In the Data Object Name dropdown list, select the required data object.
4. In the Keys section, choose the data object that you want to set as key.
5. Choose OK.

Note
You can add data objects only if the input parameter does not contain any scalar parameters or
hierarchial parameters and vice-verse.

Results

The data objects appear under Input Parameters node.

3.1.5 Activating a Rule

You activate a rule to apply all the changes performed on it.

Prerequisites

You have the runtime plug-in of SAP HANA rules framework active.

Procedure

1. In the Project Explorer view, choose the rule that you want to activate.

Note
The rule must contain the extension ".hprrule".

SAP HANA Rules Framework - Modeling Guide CUSTOMER


Modeling a Decision Table Rule © 2016 SAP SE or an SAP affiliate company. All rights reserved. 17
2. Save the rule.

3. In the context menu of the rule, choose Team Activate .

3.2 Modeling a Rule Using a Private Vocabulary

This procedure instructs you how to create a rule without using a public or embedded vocabulary.

Procedure

1. Launch SAP HANA studio.


2. Select the SAP HANA Development perspective.
3. Go to the Project Explorer view in the SAP HANA Development perspective, and select a project.

4. Choose New Other .

5. In the wizard, choose SAP HANA Application Development Rules Framework Rule .
6. Choose Next.
7. In the Create New Rule dialog, browse for the required project.
8. Enter a name and description.
9. Select Decision Table as the Type.
10. Choose Finish.
11. Perform the following steps:

Description Link

Add tables that you apply a rule for See Adding Tables [page 6].

Add attributes See Adding Columns as Attributes [page 6].

Relate the tables See Creating an Association [page 7].

Add various attributes as conditions See Adding the Attributes to Condition Columns [page 13].

Provide values for actions and conditions See Adding the Condition Values [page 14].

Add input parameters and filters See Working with the Execution Context [page 15].

CUSTOMER SAP HANA Rules Framework - Modeling Guide


18 © 2016 SAP SE or an SAP affiliate company. All rights reserved. Modeling a Decision Table Rule
3.2.1 Creating a Rule Output

This is a procedure to create an output for a rule. Output is the data that system returns when a rule satisfies a
condition.

Procedure

1. In the Outline pane, select the Rule Output node.


2. In the context menu of the Rule Output node, choose Edit.
3. Choose Add in the Parameters section.
4. Add Parameters and provide details.
5. Perform the following substeps to add Modified Attributes:

a. Choose the dropdown list.


b. Choose the required attribute from the table.
c. Choose OK.

Note
○ The name and description of the output are set to the default value.
○ To remove any attributes, choose Remove.

6. Choose Add.

7. Select the icon, which displays all the expressions present in decision tables.
8. Select the required Attribute from the dropdown list.
9. Choose OK.
10. Choose OK in the Add Output window.
The attributes appear in the Output node.

Note
For information about generating a rule, see Activating a Rule [page 17].

SAP HANA Rules Framework - Modeling Guide CUSTOMER


Modeling a Decision Table Rule © 2016 SAP SE or an SAP affiliate company. All rights reserved. 19
4 Modeling a Rule of Type IF-THEN

You use this procedure to model a textual rule. IF-THEN rule is a textual representation of business logic
containing a single Boolean condition expression and its corresponding output expressions.

Prerequisites

You have created an active vocabulary. See Creating a Vocabulary [page 5].

Procedure

1. Perform the following substeps to model a rule:


a. Launch SAP HANA studio.
b. Select the SAP HANA Development perspective.
c. Go to the Project Explorer view in the SAP HANA Development perspective, and select a project.
d. Choose New Other .
e. In the wizard, choose SAP HANA Application Development Rules Framework Rule .
f. Select Next.
g. In the Create New Rule dialog, browse for the required project.
h. Enter name and description.
i. Select IF-THEN as the Type.
j. Choose Finish.

2. Select Data Foundation to add the active vocabulary.


3. Perform the following:

Description Link

Add actions to rule action See Reusing a Rule Action from Action [page 21]

Add output types to rule output See Adding a Rule Output from Vocabulary [page 14].

Add input parameters and filters See Working with the Execution Context [page 15].

CUSTOMER SAP HANA Rules Framework - Modeling Guide


20 © 2016 SAP SE or an SAP affiliate company. All rights reserved. Modeling a Rule of Type IF-THEN
4.1 Adding Conditions

You add conditions, as they describe the rule whether or not to trigger any decision. Conditions are Boolean
expressions defined using the rule expression language in a text format.

Procedure

1. Choose the Text Rule node.


2. In the Condition section of the Details pane, enter a valid condition.
Content assist is available for adding conditions. This feature enables the selection and insertion of
existing code elements to complete partially entered code.
3. In the Rule Output section of the Details pane, select a Output Type Name.
4. In the Rule Output section, provide parameter values.

Note
For information about generating a rule, see Activating a Rule [page 17].

4.2 Adding a Rule Action from the Vocabulary

Procedure

1. In the Outline pane, choose Actions.


2. In the context menu of the required action, choose Add As Rule Action.
This action appears under the Rule Action node.

Note
If you want to edit the rule action, then choose Edit in the context menu of the required action under the
Rule Action node.

For more information on editing the actions, see Creating Actions in Vocabulary [page 7]

SAP HANA Rules Framework - Modeling Guide CUSTOMER


Modeling a Rule of Type IF-THEN © 2016 SAP SE or an SAP affiliate company. All rights reserved. 21
Important Disclaimers and Legal Information

Coding Samples
Any software coding and/or code lines / strings ("Code") included in this documentation are only examples and are not intended to be used in a productive system
environment. The Code is only intended to better explain and visualize the syntax and phrasing rules of certain coding. SAP does not warrant the correctness and
completeness of the Code given herein, and SAP shall not be liable for errors or damages caused by the usage of the Code, unless damages were caused by SAP
intentionally or by SAP's gross negligence.

Accessibility
The information contained in the SAP documentation represents SAP's current view of accessibility criteria as of the date of publication; it is in no way intended to be
a binding guideline on how to ensure accessibility of software products. SAP in particular disclaims any liability in relation to this document. This disclaimer, however,
does not apply in cases of wilful misconduct or gross negligence of SAP. Furthermore, this document does not result in any direct or indirect contractual obligations of
SAP.

Gender-Neutral Language
As far as possible, SAP documentation is gender neutral. Depending on the context, the reader is addressed directly with "you", or a gender-neutral noun (such as
"sales person" or "working days") is used. If when referring to members of both sexes, however, the third-person singular cannot be avoided or a gender-neutral noun
does not exist, SAP reserves the right to use the masculine form of the noun and pronoun. This is to ensure that the documentation remains comprehensible.

Internet Hyperlinks
The SAP documentation may contain hyperlinks to the Internet. These hyperlinks are intended to serve as a hint about where to find related information. SAP does
not warrant the availability and correctness of this related information or the ability of this information to serve a particular purpose. SAP shall not be liable for any
damages caused by the use of related information unless damages have been caused by SAP's gross negligence or willful misconduct. All links are categorized for
transparency (see: http://help.sap.com/disclaimer).

CUSTOMER SAP HANA Rules Framework - Modeling Guide


22 © 2016 SAP SE or an SAP affiliate company. All rights reserved. Important Disclaimers and Legal Information
SAP HANA Rules Framework - Modeling Guide CUSTOMER
Important Disclaimers and Legal Information © 2016 SAP SE or an SAP affiliate company. All rights reserved. 23
go.sap.com/registration/
contact.html

© 2016 SAP SE or an SAP affiliate company. All rights reserved.


No part of this publication may be reproduced or transmitted in any
form or for any purpose without the express permission of SAP SE
or an SAP affiliate company. The information contained herein may
be changed without prior notice.
Some software products marketed by SAP SE and its distributors
contain proprietary software components of other software
vendors. National product specifications may vary.
These materials are provided by SAP SE or an SAP affiliate company
for informational purposes only, without representation or warranty
of any kind, and SAP or its affiliated companies shall not be liable for
errors or omissions with respect to the materials. The only
warranties for SAP or SAP affiliate company products and services
are those that are set forth in the express warranty statements
accompanying such products and services, if any. Nothing herein
should be construed as constituting an additional warranty.
SAP and other SAP products and services mentioned herein as well
as their respective logos are trademarks or registered trademarks
of SAP SE (or an SAP affiliate company) in Germany and other
countries. All other product and service names mentioned are the
trademarks of their respective companies.
Please see http://www.sap.com/corporate-en/legal/copyright/
index.epx for additional trademark information and notices.

You might also like