Tips on PDF & Report Page for Rainbird Integration
Rainbird Basics -» Tips on PDF & Report Page for Rainbird Integration
Tips on PDF & Report Page Rainbird integration
An overview of the different ways you can retrieve data required for the reports from Rainbird.
When to use
This method is required for retrieving singular or plural inferred facts from the knowledge map. It does give the option for further questions to be asked by Rainbird where they have not previously been asked or inferred.
Method
Upon ‘Start ‘ in the Rainbird API a sessionID (example below) will be generated, this sessionID should be stored to be used for subsequent queries.
“sessionID”:”81d14f71-65ee-4920-a8eb-963f6238b0fb”
When running a query against the model using the generated sessionID Rainbird will use responses from question, inferred facts and data provided or stored in the map; all of this information will be available within the session if the relevant query is then run against it.
Any relationships requiring further information may return a question rather than a result if the model is configured to do so (plurals or missing facts). If this is not desired, the model should be configured to be “Askable: None”. Rainbird cannot ask the a question it has already asked in the same session.
- They are rejected if they are under 18, or
- They are rejected if they are not a UK resident.
This fact ID can be queried using the Evidence Tree API and it will return further facts IDs that were used to produce this fact, this will include the instances, relationships, method (asked, inferred etc) as well as any alternative way of stating the fact configured in the model (Alt Text).“factID”:”WA:RF:651b984df21f0649f41d4129ca104a5f82b28bc035657b5bba2af7e2519dabca”
When to use
When a model is using a Rainbird led user interaction it is possible to capture the interaction as it goes back and forth from the Rainbird API. This is best used when there are certain questions that are asked every time that may be required as part of a transcript, or when the report involves the a copy of whatever has been said throughout the interaction. This is different to the evidence tree as not all facts collected in an interaction are be used in the final result, meaning they will not available after the interaction via the evidence tree interaction.
Method
The Rainbird API allows responses from both the Rainbird Model and the User to be sent in a JSON format. With this method you can either capture all required information from each response, e.g.,
Subject, relationship, object, or only certain relationships you are looking out for by defining them in your code.
When to use
If the data required for a report or rule is large in volume but structured against a single instance it may be better to provide a single, CSV response from the model.
An example may be:
The report must show the last six months of outgoings from an account, in our model we have a relationship of each of these months;
- Account, shows January outgoing, X
- Account, shows February outgoing, X
- Account, shows March outgoing, X
- Account, shows April outgoing, X
- Account, shows May outgoing, X
- Account, shows June outgoing, X
The person the report is about has 2 accounts, this now becomes 12 queries for the report if we were to query each relationship for each Account (subject) individually, and would soon become unmanageable if there were more accounts.
Method
We will instead build a rule into the Rainbird Model that outputs the data in a known structure to be used by the report generating software.
We use string concatenation in the model and produce CSV sting for each of the accounts. As Rainbird can deal with plural outputs this then becomes a single query (with 2 results).
“ACCOUNT1,100,200,150,400,500,200”
“ACCOUNT2,200,500,150,150,300,200”
Or
|
MONTH | Jan | Feb | Mar | Apr | May | Jun |
ACCOUNT 1 | 100 | 200 | 150 | 400 | 500 | 200 |
ACCOUNT 2 | 200 | 500 | 150 | 150 | 300 | 200 |