Type | Read/write | Author | Availability |
|---|---|---|---|
Write | FINBOURNE | Provided with LUSID |
The Lusid.RunCompliance provider enables you to write a Luminesce SQL query that triggers a compliance run and returns the outcome of that run.
Note
The LUSID user running the query must have sufficient access control permissions to both use the provider and read compliance data. This should automatically be the case if you are the domain owner.
See also: Lusid.ComplianceRule, Lusid.ComplianceRuleResult, Lusid.ComplianceRuleResult.Breakdown
Basic usage
select * from Lusid.RunCompliance where <filter-expression>;Query parameters
Lusid.RunCompliance has parameters that enable you to specify the compliance run to create.
Note
RuleScope,RunScopeandRecipeare mandatory.
To list available parameters, their data types, default values, and an explanation for each, run the following query using a suitable tool:
select FieldName, DataType, ParamDefaultValue, Description from Sys.Field where TableName = 'Lusid.RunCompliance' and FieldType = 'Parameter';Data fields
By default, Lusid.RunCompliance returns a table of data populated with particular fields (columns). You can return a subset of these fields.
To list fields available to return, their data types, whether fields are considered 'main', and an explanation for each, run the following query using a suitable tool:
select FieldName, DataType, IsMain, IsPrimaryKey, SampleValues, Description from Sys.Field where TableName = 'Lusid.RunCompliance' and FieldType = 'Column';Note
Fields marked 'main' are returned by queries that include a caret character, for example
select ^ from Lusid.RunCompliance.
Write errors
We recommend examining the results of every query against Lusid.RunCompliance using the WriteError, WriteErrorCode and WriteErrorDetail fields.
If unsuccessful, Lusid.RunCompliance returns a WriteError message, along with a WriteErrorCode and WriteErrorDetail, to help you discover why LUSID could not kick off the compliance run.
Examples
Note
For more example Luminesce SQL queries, visit our Github repo.
Example 1: Kick off a compliance run
select *
from Lusid.RunCompliance
where
RuleScope = 'PMS'
and RunScope = 'PMS'
and Recipe = 'Finbourne-Examples/Recipe';Example 2: Run compliance on orders, allocations, and transactions
select *
from Lusid.RunCompliance
where
RuleScope = 'PMS'
and RunScope = 'PMS'
and Recipe = 'Finbourne-Examples/Recipe'
and IncludeEntityTypes = 'OrdersAndAllocations';Example 3: Retrieve the breach and error information from a compliance run
select
ComplianceRunScope,
ComplianceRunCode,
BreachedRuleIds,
WriteError,
WriteErrorDetail
from Lusid.RunCompliance
where
RuleScope = 'PMS'
and RunScope = 'PMS'
and Recipe = 'Finbourne-Examples/Recipe';