You are viewing limited content. For full access, please sign in.

Question

Question

Workflow documentinfo not connected

asked on February 17, 2015

Hello all,

 

In my workflow, I am finding a collection of entries in a folder using Find Entries activity.  Using the 'For Each Entry' activity using the output from 'Find Entries', created a SDK script activity as follows.  I am on SDK 9.1

 

I am getting a warning DocumentInfo object is new or not connected. Parameter name : document

 

Here is the code snippet.  What am I doing wrong?

 

ConnectionWrapperRA wrapper = this.ConnectToRA(ConnectionMethodRA.RepositoryAccess91);

DocumentInfo di = (DocumentInfo)wrapper.BoundEntry;

OcrEngine ocrEng = OcrEngine.LoadEngine();

ocrEng.AutoOrient = true;

ocrEng.Decolumnize = true;

ocrEng.OptimizationMode = OcrOptimizationMode.Accuracy;

ocrEng.Run(di);

 

Thanks

Bala

0 0

Replies

replied on February 17, 2015 Show version history

Bala - I don't do C# but I believe you should instantiate the di DocumentInfo object like this;

        protected override void Execute()
        {
            // Write your code here. The BoundEntryInfo property will access the entry, RASession will get the Repository Access session
            
            DocumentInfo di = (DocumentInfo)BoundEntryInfo;
            
            OcrEngine ocrEng = OcrEngine.LoadEngine();
            ocrEng.AutoOrient = true;
            ocrEng.Decolumnize = true;
            ocrEng.OptimizationMode = OcrOptimizationMode.Accuracy;

            ocrEng.Run(di);
        }

And make sure you set the Script's Default Entry to the For Each Entry->Current Entry

0 0
replied on February 17, 2015 Show version history

 

Thanks for the response Cliff.  I did try that already, you got c# syntax perfect. only thing is the entryinfo has to be casted to DocumentInfo class.  But that did not work either.  

 

The script's default entry is set to current entry of the foreach.

 

0 0
replied on February 17, 2015

Hmmm, I totally missed that you are trying to OCR a document out of Workflow.  I've never tried to call the OCR engine from Workflow, are you sure that is supported?

0 0
replied on February 17, 2015

Cliff,

Your post gave me an idea, c# vs vb, so created another identical sdk script activity using vb.net instead of c#.  Converted the c# code exactly to vb.net and what do you know, it worked.

Hope this will help others too.

 

Thanks for your tip

Bala

0 0
replied on February 17, 2015

That is strange... 

If this is deployed in a busy production environment I would recommend moving the OCR to some type of local or web service and calling that service from Workflow in an effort to keep the overhead down on the Workflow server.  (Just my 2 cents...)


 

0 0
replied on February 17, 2015

Is there a reason why you're not using Distributed Computing Cluster for OCR? Like Cliff said, this is very likely to cause performance issues on the Workflow server under any type of load as OCR is very CPU intensive. Not to mention that you will have to be careful on upgrades to reinstall the right version of OCR since it's not part of the Workflow installer.

0 0
replied on February 18, 2015

Hello Cliff and Miruna,

 

I was not aware of the distributed computing cluster and just read about it.  Thanks for pointing me in the right direction.  Appreciate it.

Bala

0 0
You are not allowed to follow up in this post.

Sign in to reply to this post.