Library Entity Business Rules

/api/repositories/{repository}/businessrules/library
Parameter Type Purpose
repository string The name of the repository

Count

GET /api/repositories/(string: repository)/businessrules/library/count

Returns the number of business rules in the library.

Response Code Reason
200 No error
500 Server error

The response contains the number of business rules in the library.

{
    "count": "405"
}

Show

GET /api/repositories/(string: repository)/businessrules/library

Get a list of library business rules in the repository. Paging is supported for this GET request using Standard URL Query String.

GET /api/repositories/jupiter/businessrules/library HTTP/1.1
Accept: application/json
Response Code Reason
200 No error
500 Server error

The underlying data rows can be returned in a JSON key/value pair by setting the external JSON format parameter. This allows access by different external tools that requires the JSON data in a key/value pair instead of standard array of row data with columns names defined separately.

The response is a standard response, with a list of all the library business rules in the repository; this includes all library entity business rule. If external JSON format parameter was set then the row details of all library entity business rule will be returned in a JSON key/value pair format.

Commands

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

{
    "command": "run",
    "data": {
        "rules": [
          {
            "library": "2",
            "rule": "5"
          },
          {
            "library": "2"
          }
        ]
    }
}
Response Code Reason
200 Success
400 Invalid request body
400 No rule details given
400 Invalid command
400 No data received
500 Server error

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

Command Description
run Run business rules belonging to any Library Entity
list Returns list of library business rules belonging to any library entity

Run

POST /api/repositories/(string: repository)/businessrules/library

Run a list of library business rules belonging to any library entity

JSON Parameters:
 
  • body – The request body
POST /api/repositories/{string:repository}/businessrules/library
Content-Type: application/json

{
    "command" : "run",
    "data" : {
        "rules": [
            {
                "library": "2",
                "rule": "5"
            },
            {
                "library": "2"
            }
        ]
    }
}

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

Command Description
run Run business rules belonging to any Library Entity
Response Code Reason
200 Success
400 Invalid request body
400 No rule details given
400 Invalid command
400 No data received
500 Server error

The command, rules and library fields are required. The rule field is optional.

library should contain the library ID of the library entity that the rules belongs to.

rule should contain the rule ID of the library entity business rule that is to be run. If no rule field is passed, all business rules of the library entity library are run.

List

POST /api/repositories/(string: repository)/businessrules/library

Returns list of library business rules belonging to any library entity

JSON Parameters:
 
  • body – The request body
POST /api/repositories/{string:repository}/businessrules/library
Content-Type: application/json

{
    "command" : "list",
    "data" : {
        "rules": [
              {
                  "library": "2",
                  "rule": "5"
              },
              {
                  "library": "2"
              }
        ]
    }
}
Response Code Reason
200 Success
400 Invalid request body
400 No rule details given
400 Invalid command
400 No data received
500 Server error

The command, rules and library fields are required. The rule field is optional.

library should contain the library ID of the library entity that the rules belongs to.

rule should contain the rule ID of the library entity business rule to get the associated business rules for a specific library rule. If no rule field is passed, all associated business rules of the library entity library will be returned.

The response is a Standard Response, with a list of all the asociated business rules in the Repository; this includes all Entity Business Rules.

Export

Some or all of the rows may be exported as a scheduled task.

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

{
    "command": "export",
    "data": {
        "filename": "filename.csv",
        "filetype": "csv",
        "encoding": "utf-8"
    },
    "options": {
        "columns": ["entity_id", "actual_name", "_associations"],
        "where": "'Actual Threshold' >= 10"
    }
}
Response Code Reason
200 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, but may specify the columns to export, and/or the rows to filter.

The following table shows which fields are required in the data element:

Field Required
filename Y
filetype N
encoding N

If filetype is not specified, it defaults to csv. If encoding is not specified, it defaults to the server native encoding.

The response will contain the URL of the scheduled task and the link to download the exported file.

{
    "job": "/api/repositories/jupiter/scheduler/1",
    "file": "/api/repositories/jupiter/download/filename.csv"
}