Example SequencesΒΆ

This topic includes examples of how you combine the APIs to obtain a certain set of results.

You can combine API requests in sequence to retreive specfic data, such as returning all business rules associated with an attribute in an entity (data source). You can also complete actions such as adding, editing, or running a business rule.

Example 1

Get a list of business rules for an entity:

GET https://hostname:port/api/repositories/rep_name/entities/entity_id/businessrules

Example 2

Get a list of all failing rows for a business rule:

GET https://hostname:port/api/repositories/rep_name/entities/entity_id/businessrules/rule_id/failingrows

Example 3

Filter a request to see a sub-set of business rules that have a threshold set to 10:

GET https://hostname:port/api/repositories/rep_name/entities/entity_ID/businessrules

{
    "command": "get",
    "options": {
        "where": "<attribute_name> = 10"
    }
}

Example 4

Add an entity (rule set) to the Library:

POST https://hostname:port/api/repositories/rep_name/library/entities

{
    "command": "add",
    "data": {
        "name": "<entity_name>",
        "description": "<entity_description>",
    }
}

Example 5

Add an attribute to an entity (rule set) in the Library:

POST https://hostname:port/api/repositories/rep_name/library/entities/entity_ID/attributes

{
    "command": "add",
    "data": {
        "name": "<attribute_name>",
        "description": "<attribute_description>",
    }
}

Example 6

Verify whether a library business rule is associated with a profiled entity (data source):

GET https://hostname:port/api/repositories/rep_name/library/entities/entity_id/businessrules/rule_id/associatedrules

Example 7

Add a business rule to an entity (data source):

POST https://hostname:port/api/repositories/rep_name/entities/entity_id/businessrules

{
    "command": "add",
    "data": {
       "name": "<rule_name>",
       "description": "<rule_description>",
       "threshold": "100",
       "enabled": "1",
       "expression": "attr2>0",
       "filterExpression": "new2>9",
       "groupExpression": "new5=0",
       "groupLimit": "0",
       "aggregateExpression": "acc_id<0",
       "aggregateMethod": "0",
       "priority": "1",
       "threshold": "100",
       "ruleKeywordIdList": "1 0: 2 1"
    }
}

The required fields for adding a rule are:

  • expression
  • threshold
  • name

Example 8

Run business rule analysis:

POST https://hostname:port/api/repositories/rep_name/entities/entity_id/businessrules/br_id