Hi,
in my FlexiCapture 12 project I created a custom workflow stage which checks if the number of document in the batch is different than a value taken from a registration parameter:
If these values are different, this stage should redirect the entire batch to the verification because this would mean that FlexiCapture did not recognise a barcode separator into the documents, so operators should manually separate documents and apply the Document Definition, or modify that registration parameter value to tell FlexiCapture that the number of documents in the batch is correct.
So I added an Exit Route with a script condition:
with the following script code:
FCTools.ShowMessage("Check number of documents in batch - Starting routing script to verification ...");
var n_documents_in_batch = this.Batch.DocumentsCount;
var n_documents_in_folder = this.Batch.Properties.Get("Numero di documenti nel Fascicolo");
// Check if number of documents in batch is different from the number of documents in the folder
if (n_documents_in_batch != n_documents_in_folder) {
FCTools.ShowMessage("WRONG number of documents in batch, sending to verification!");
// Send to verification
Result.CheckSucceeded = true;
}
else {
FCTools.ShowMessage("Correct number of documents in batch, continuing the workflow.");
Result.CheckSucceeded = false;
}
During the execution of this stage the log "WRONG number of documents in batch, sending to verification!" is printed, but the batch is not redirected to verification but to export.
This is even more clear into the event log (for all documents into that batch):
Routing stage calculation. Next stage is 'Export'. Principal id is '0'. Details: Use exit routes. Route to next stage from 'Check number of documents in batch'. Precondition rule on stage 'Verification' failed. Route to next stage 'Export'.
Could you help me to understand where I'm wrong, please?
Thank you very much!
Comments
2 comments
I solved my problem!
The rule should be applied into the entry condition of the Verification Stage, because the default entry condition in this stage does not include my example.
So I created a function into the NonInteractiveProcessor object which I call in both Exit Routes of the custom stage and Entry Conditions of the Verification Stage.
Thanks!
Nice, thanks for the example! I need this for my own backup :)
Please sign in to leave a comment.