Business Rules - Passing Rows ============================= .. http:get:: /api/repositories/(string:repository)/entities/(int:entity)/businessrules/(int:ruleID)/passingrows :synopsis: Get all passing rows for the given rule. Get all passing rows for the :doc:`given rule `. .. http:post:: /api/repositories/(string:repository)/entities/(int:entity)/businessrules/(int:ruleID)/passingrows :synopsis: List, filter, sort or export the passing rows for a given rule + Filter the list of passing rows + Sort the list of passing rows + Page the list of passing rows + Export the passing rows .. csv-table:: :header: Parameter, Type, Purpose :widths: 20, 20, 60 :stub-columns: 1 repository, string, The name of the :doc:`repository ` the entity is in entityID, int, The ID of the :doc:`entity ` the rule belongs to ruleID, int, The ID of the :doc:`business rule ` .. _br_all_passing_rows: All Passing Rows ~~~~~~~~~~~~~~~~ Show all passing rows for the given rule. .. code-block:: http GET /api/repositories/(string:repository)/entities/(int:entity)/businessrules/(int:ruleID)/passingrows HTTP/1.1 Accept: application/json :ref:`Paging ` is supported for this GET request using :doc:`standard-url-query-string`. Depending on the rule and the dataset, the number of passing rows may be quite large, so paging the data is recommended. The underlying data rows can be returned in a :ref:`JSON key/value pair ` by setting the :ref:`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 for a get is a :doc:`standard response ` containing a list of all/paged rows that pass the business rule. If :ref:`external JSON format ` parameter was set then a list of all/paged rows that pass the business rule will be returned in a :ref:`JSON key/value pair ` format. .. _br_some_passing_rows: Some Passing Rows ~~~~~~~~~~~~~~~~~ The list of passing rows can be filtered, sorted or paged; these options may be combined (for example, sorted and paged). The underlying row data for the passing rows can be returned in a :ref:`JSON key/value pair ` by setting the :ref:`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 request requires a :doc:`standard-request`. .. code-block:: http POST /api/repositories/(string:repository)/entities/(int:entity)/businessrules/(int:ruleID)/passingrows HTTP/1.1 Content-type:: application/json { "command": "get", "options": { "pageStart": 1, "pageSize": 10 } } The response is a :doc:`standard-response` containing the list of passing rows matching the criteria. If :ref:`external JSON format ` parameter was set then the data rows will be returned in a :ref:`JSON key/value pair ` format. .. _br_export_passing_rows: Export Passing Rows ~~~~~~~~~~~~~~~~~~~ Some or all of the passing rows may be exported as a scheduled task. .. code-block:: http POST /api/repositories/(string:repository)/entities/(int:entity)/businessrules/(int:ruleID)/passingrows HTTP/1.1 Content-type:: application/json { "command": "export", "options": { "columns": [ "column_name1", "column_name2", "column_name3" ], "where": "where clause" }, "data": { "filename": "filename.csv" } } When export is required, the filename for the exported file must be specified. The file will be exported in CSV format using the native encoding of the server. .. csv-table:: :header: Response Code, Reason :widths: 25, 75 200, No error 500, Server error The response will contain the URL of the scheduled task and the link to download the exported file. .. code-block:: json { "job": "/api/repositories/jupiter/scheduler/1", "file": "/api/repositories/jupiter/download/filename.csv" }