From 84ef377324aa4414ca6b0ab5e8a27e4d426f6307 Mon Sep 17 00:00:00 2001 From: Renzo Kottmann Date: Wed, 18 Mar 2020 18:16:35 +0100 Subject: [PATCH] Add accept documentation about acceptRecommendation --- docs/api.md | 18 ++++++++++++++++++ docs/architecture.md | 10 ++++++++-- 2 files changed, 26 insertions(+), 2 deletions(-) diff --git a/docs/api.md b/docs/api.md index 848741c..e537f83 100644 --- a/docs/api.md +++ b/docs/api.md @@ -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 `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. diff --git a/docs/architecture.md b/docs/architecture.md index fc9b2a2..18eb16c 100644 --- a/docs/architecture.md +++ b/docs/architecture.md @@ -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! -## General process +## General default process -The general process is like this: +The general process is like this (the default is defined in `DefaultCheck`): ```mermaid @@ -30,6 +30,7 @@ sequenceDiagram e->>e: validate Schematron e->>e: create Validator Report e->>+c: execute configuration report generator + e->>e: Compute Recommendation ``` @@ -50,3 +51,8 @@ sequenceDiagram 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 +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`.