Community

Script Execution on Excepetions Answered

Hi all,

This question is a follow up of this one here: http://www.capturedocs.com/thread/send-e-mail-notifications-on-validation/ The goal is the have a script fired after a document goes to Exception state. Currently the only workarounds for this case are exporting documents to folders and checking them with a third-party software (PRTG, Windows Service, etc.). This is a big overhead compared to scripts executed at specific stages within FlexiCapture.

I wrote the following SQL query to query the database for batches in exception state.

SELECT
 b.[Name] as BatchName,
 p.[Name] as Stage,
 b.[CreationDate]
    
FROM
 [dbo].[Batch] b left join
 [dbo].[ProcessingStage] p on b.[ProcessingStageId] = p.[Id]

WHERE
 p.[Name] is null or p.[Name] IN ('Exceptions')

This script can be used to query the states without using the file system. I am still not satisfied and looking for a solution using the integrated scripting. Can someone point me in the right direction or should this be a feature request?

Regards,
Michael

 

Was this article helpful?

0 out of 0 found this helpful

Comments

4 comments

  • Avatar
    Ekaterina

    Hello,

    There are such tools as routing rules (entry and exit conditions) and additional stages in workflow that would have been useful for you if it was not the Exceptions stage you are interested in. 

    However, the Exceptions stage is special, because documents can be sent there by different ways, including manual sending. So we cannot guarantee that all documents that ended in Exceptions have passed through the rules/stages that trigger e-mail sending. 

    For this situation, querying the DB for the documents that are actually in the Exceptions is the most correct way.

    You may find more information about routing rules and additional workflow stages here:

    Appendix > Using scripts in ABBYY FlexiCapture > Scripts for customizing processing stages > Types of scripts > Stage rule script

    Program settings > Setup ABBYY FlexiCapture complex > Editing Stage Properties

    0
  • Avatar
    zingix

    Hi Ekaterina,

    Thanks for your response. Then my solution is the preferred way to go.

    Regards,
    Michael

    0
  • Avatar
    Sachin Bhutani

    Hi ,
    How do u get only new batches sent to exception from this query ? Or you send the entire exception batch list ?

    0
  • Avatar
    Abhisheak Sambooru

    Hi,

    Is there a way to find the exception document(s) within the exception batch using DB query?

    0

Please sign in to leave a comment.