Add accept documentation about acceptRecommendation

This commit is contained in:
Renzo Kottmann 2020-03-18 18:16:35 +01:00 committed by Andreas Penski (init)
parent a12ff356d8
commit 84ef377324
2 changed files with 26 additions and 2 deletions

View file

@ -89,3 +89,21 @@ Initializing all XML artifacts and XSLT-executables is expensive. The `Check` in
The only input `de.kosit.validationtool.api.Input` which can be created by various methods of `de.kosit.validationtool.api.InputFactory`. The only input `de.kosit.validationtool.api.Input` which can be created by various methods of `de.kosit.validationtool.api.InputFactory`.
The `InputFactory` calculates a hash sum for each Input which is also written to the Report. _SHA-256_ from the JDK is the default algorithm. It can be changed using the `read`-methods of `InputFactory`. The `InputFactory` calculates a hash sum for each Input which is also written to the Report. _SHA-256_ from the JDK is the default algorithm. It can be changed using the `read`-methods of `InputFactory`.
## Accept Recommendation and Accept Match
A tri-state Object `AcceptRecommendation` can be retrieved from the `Result` using `getAcceptRecommendation()`.
The three defined states are:
1. `UNDEFINED` i.e. the evaluation of the overall validation could not be computed.
2. `ACCEPTABLE` i.e. the recommendation is to accept input based on the evaluation of the overall validation.
3. `REJECT` i.e. the recommendation is to reject input based on the evaluation of the overall validation.
By default it is `UNDEFINED`.
### Accept Match in Scenario Configuration
For your own configuration you can add an `acceptMatch` element in each scenario. It can contain in XPATH expression over your own defined `Report` to compute a boolean. An XPATH expression evaluating to true will lead to an `ACCEPTABLE` amd otherwise to a `REJECT` recommendation.
This allows to have own control over what validation result is to be considered acceptable for your own application context.

View file

@ -13,9 +13,9 @@ the validation and generates a report in XML format. This report is then the inp
The validator reports valid/invalid, a configuration reports acceptance/rejection! The validator reports valid/invalid, a configuration reports acceptance/rejection!
## General process ## General default process
The general process is like this: The general process is like this (the default is defined in `DefaultCheck`):
```mermaid ```mermaid
@ -30,6 +30,7 @@ sequenceDiagram
e->>e: validate Schematron e->>e: validate Schematron
e->>e: create Validator Report e->>e: create Validator Report
e->>+c: execute configuration report generator e->>+c: execute configuration report generator
e->>e: Compute Recommendation
``` ```
@ -50,3 +51,8 @@ sequenceDiagram
6. *execute configuration report generator* 6. *execute configuration report generator*
The Validator will search for the XSLT as configured in scenario.xml and execute it with the Validator Report as input The Validator will search for the XSLT as configured in scenario.xml and execute it with the Validator Report as input
7. compute Recommendation
In case a scenario contains an `acceptMatch` element with an XPATH expression, this expression will be executed.
In case the XPATH returns `true`, the recommendation will be set to `ACCEPT` else to `REJECT`. In case no such XPATH is defined it is `UNDEFINED`.