IActionResult.Result is null in "after export completed" event

  • 52 Views
  • Last Post 07 September 2017
  • Topic Is Solved
mfeldman posted this 01 September 2017

Hi,
My goal is to perform some post-processing on an XML file generated by FC 11. 

My plan is to use a “after export completed” event so that I can examine the IActionResult.Result field to determine where the file was written to.

Questions:

  • 1.     Is this a reasonable way to implement my goal?  That is, should document.Action be non-null in a export completed event?
  • 2.     Is there a better way? 

Please see https://drive.google.com/file/d/0B3v5vAfaHdENTVpGRFNPQzA1OTQ/view?usp=sharing file for code snippet and screen snippets.

Thank you,
Marc

Order By: Standard | Newest | Votes
Ekaterina posted this 07 September 2017

 Hello,

Sorry for delay in answering. We've reproduced the issue on our side and discovered in ABBYY internal resources, that it is a known Help bug: IDocument::Action is only available in the export scripts and is read-only.

As most probably it will result in Help article correction, not in IDocument::Action implementation in post-export, you'll need to find other way of resolving this problem, possibly by writing the Custom Export script. 

If you describe your goal in more details, we'll try to find a workaround for you.

mfeldman posted this 07 September 2017

Hi,
ABBYY already did supply an answer.    :-)
The online help for FC12 gave me the information I needed to develop solution shown below.

The post-export event provides a IDocumentsExportResults.  That provides a IDocumentExportResults.
That provides a IActionResult, which provides the Result.

Thx,
M.

public void XML2EDI(IDocumentsExportResults exportResults, IProcessingCallback callback) {
            foreach (IDocumentExportResults documentResults in exportResults)
            {
                msgbox("documentResults: docId=" + documentResults.Document.Id);
                //System.Diagnostics.Debugger.Break();
                foreach (IActionResult actionResult in documentResults.OfType<IActionResult>())
                {
                    String name = actionResult.Name;
                    bool applied = actionResult.Applied;
                    String filename = actionResult.Result;
                    msgbox("\tname=" + name);
                    msgbox("\tapplied=" + applied.ToString());
                    msgbox("\tfilename=" + filename);
                }
            }
        }


documentResults: docId=3
    name=Export to data files
    applied=True
    filename=C:\Users\marc\Documents\FlexiCapture11LocalProjects\Export\TestBatch\Data_00000003_16.xml

Close