In Geovonic Connect, data sources provide connectivity to third-party business systems. The Brightly Confirm data source allows you to fetch real-time data from your ERP system using the Brightly Confirm GraphQL API.
For example, the Brightly Confirm data source allows you to configure searches to retrieve asset or defect information from Confirm. This article assumes that you have some knowledge of using the Brightly Confirm reporting module to search for data records.
Data Source Configuration
The Brightly Confirm data source configuration requires a few fields: –
- Confirm Server URL – the full URL for your Confirm web server.
For example,https://webservices-au.confirm-solutions.com/confirm/web
- Tenant Name – the tenant name for your Confirm tenancy. For example, LionsheadCouncil. You will typically find this in the URL when you are logged in to your Confirm web server.
- Credentials – a Username and API Key for a the Brightly Confirm user that will be used to request data for your Layer Links. You can create an API Key on the User Security screen in Confirm, or you may need to request one from your Confirm system administrator.
It is important when configuring any integration service to follow the Principle of Least Privilege. Any credentials used for the data source should only be able to access the minimum amount of information to meet the needs of your Geovonic Connect application. For example, do not provide the admin credentials for your Brightly Confirm server if Geovonic Connect only needs to access limited records. Best practice is to create a new user with the least required privileges.
Layer Link Configuration
The Brightly Confirm layer link configuration uses the Confirm GraphQL API. Crafting GraphQL queries by hand can be very challenging, but you can use the Brightly Confirm reporting module as a convenient way of building the query using the graphical report builder.
This short video explains how you can generate a GraphQL query in Brightly Confirm and then copy it into the Geovonic Connect layer link configuration screen.
The GraphQL query is copied and pasted into the text box on your Layer Link definition. The search value that you used when building the query in the reporting module needs to be replaced with a an attribute field from your GIS layer. In the video example, the search query used the value 425 – for your query you’ll need to replace that value with the name of one of the feature attributes on your map.
In the example below, you can see a GraphQL query configured in the Geovonic Connect layer link definition. In this query, if you look hard enough you will see the string {{asset_id_text}}. This is the name of an attribute on my GIS feature layer and will be substituted for the attribute value when the query is sent to Confirm. (You can find the list of attributes available on your feature layer by clicking the [+] button in the top corner of the GraphQL query box).
By default, Geovonic Connect will pick a random feature from your ArcGIS feature layer to validate the query. This might fail if the attribute values on the random feature don’t have a matching record in Brightly Confirm. You can give specific values to use when validating the query by entering them in the attribute values box.
Test data should be specified using the format {{ATTRIBUTE_NAME}}=ABC123, when ATTRIBUTE_NAME is the name of the attribute on your feature layer. You can get a list of available attribute names by clicking on the [+] button in the corner of the test data box. Multiple attributes should be placed on separate lines.
Clicking “Validate” will send a test query to Brightly Confirm. Once you are happy with your query, click Save. The layer link is now available to use with the Geovonic Connect widget.
Example Queries
These example queries are for background information only. Remember, you don’t need to hand craft the query. Use the Brightly Confirm reporting module to create the query for you!
In both of these examples you will find the feature attribute substitution string {{gis_asset_id}}. This tells Geovonic Connect to send the value from the attribute called gis_asset_id in the query.
Information about assets (known as “features” in Confirm)
{features(filter: {centralAssetId: {equals:"{{gis_asset_id}}"}}) {centralAssetId plotNumber siteCode allDefectsCount allJobsCount dead featureId location featureTypeCode area{description} ward{name code} currentDefectsCount currentJobsCount historicalDefectsCount historicalJobsCount featureType{name} classifications{name} surveyDate site{centralSite{name}} measurement_AREA{quantity} measurement_LGTH{quantity} measurement_WDTH{quantity} conditions {gradeCode score observationType(filter: {code: {equals:"GCON"}}){name code} observationParameterOption {name}} siteCode}}
Information about defects
{defects(filter: {defectStatus: {equals:"N"}}) {defectNumber defectStatus defectTypeCode description jobNumber actionOfficer {name} defectType {name} feature(filter: {centralAssetId: {equals:"{{gis_asset_id}}"}}) {centralAssetId featureId location} priority{name} location siteCode}}