Library Rule Group Business Rules

/api/repositories/{repository}/rulegroups/{folderID}/businessrules
Parameter Type Purpose
repository string the name of the Repository
folderID int The ID of the desired rule group

Get

GET /api/repositories/(string: repository)/rulegroups/(int: folderID)/businessrules

Returns a list of all library business rules within a Library Rule Group

GET /api/repositories/jupiter/rulegroups/1/businessrules HTTP/1.1
Accept: application/json
Response Code Reason
200 No error

The response will be a Standard Response.

The columns displayed for each Library Entity are:

Human Name Column Name Description
Rules name The name for the library rule
Description description Description of the library rule
Created By fid Author of the library business rule
Date Created _created_date Date when the library business rule is created
Last Modified By EDITED_BY Who modified the library rule
Last Modified _edited_date Date when the library rule is last modified
Library ID entity_id Library Identifier where that business rule belongs to
Rule ID seqno Rule Identifier of the business rule

The rows array will contain one element for each Library Rule Group:

{
    "dataRow": [
        "rule 1",
        "",
        "TEST-7\\bob",
        "2014/12/08 13:40:29",
        "TEST-7\\bob",
        "2014/12/22 15:40:57",
        "9",
        "1"
    ],
    "metadata": {
        "url": "/api/repositories/jupiter/entities/9/businessrules/1"
    }
}

If there are no business rules added to the rule group, the ‘rows’ value will be an empty array.

Commands

POST /api/repositories/(string: repository)/rulegroups/(int: folderID)/businessrules

Execute a command on the library rule group.

The request requires a Standard Request packet. Available commands are:

Command Description
add Add existing library rules to a rule group
run Run all the library rules of a rule group

Add

POST /api/repositories/jupiter/rulegroups/1/businessrules HTTP/1.1
Content-Type: application/json

{
    "command": "add",
    "data": {
    "rules": [
      {
        "entity": "9",
        "attribute": "0",
        "rule": "1"
      },
      {
        "entity": "9",
        "attribute": "0",
        "rule": "2"
      }
    ]
  }
}
Response Code Reason
204 No error
400 Invalid data passed with request
500 Server error

The request packet must contain the command and data elements. The options element is not required.

All fields are required.

Run

Run all the library rules in a rule group

POST /api/repositories/jupiter/rulegroups/1/businessrules HTTP/1.1
Content-Type: application/json

{
    "command": "run",
    "data": {
       "option": "-selectedentity"
    }
}
Response Code Reason
204 Success
400 Invalid parameters
500 Server error

The option field is required and may contain the following values:

Value Purpose
-selectedentity Run all rules excluding subfolder rules
-selectedentityall Run all rules including subfolder rules