Processing multiple invoices using Document Understanding Model and Action

@Ioana_Gligan Since I was modeling your sample code that you posted previously, could you please take a look at this post and let me know if you have any thoughts? Really appreciate this as it is time sensitive.

I have successfully implemented the Document Understanding model including Create Document Validation and Wait for Validation activities. This works well for a single invoice, but this is not practical at all in real life commercial A/P departments.

I found a sample workflow that using parallel processing to manage multiple documents. When I tried it, I got the error message below. The first invoice made it through as an Action, but the 2nd occurrence caused an error.

I am trying to build a demo for a prospect for the middle of the week.

The automatically determined extracted results references do not match the Document Object Model. They may have been created using a different Document Object Model.

at UiPath.IntelligentOCR.Activities.BaseOrchestratorClientAsyncActivity.ThrowIfNeeded(Task task, Boolean suppressThrowException)
at UiPath.IntelligentOCR.Activities.BaseOrchestratorClientAsyncActivity.EndExecute(AsyncCodeActivityContext context, IAsyncResult result)
at System.Activities.AsyncCodeActivity.System.Activities.IAsyncCodeActivity.FinishExecution(AsyncCodeActivityContext context, IAsyncResult result)
at System.Activities.AsyncCodeActivity.CompleteAsyncCodeActivityData.CompleteAsyncCodeActivityWorkItem.Execute(ActivityExecutor executor, BookmarkManager bookmarkManager)

Hello @Philly_Rob,

You are probably using variables within the parallel for each loop that are scoped outside the parallel for each and they get overwritten in two parallel branches. Try to set your variable scope within the body of the parallel for each (for the variables that are specific to each document being processed).

Hope this helps and apologies for the delay!

Ioana

error
I limited the scope of the variables but got this runtime error. Can you explain please?

Yes. In order for a process to be able to suspend, all variables need to be serializable. You probably have some variable that is not serializable.

The reason for this requirement is that the robot must be able to save its state so that on resume it can pick up where it left off .

1 Like

Hi Philly and @Ioana_Gligan ,

Can you please point me to the sample code for Processing Multiple invoices using DU and Action center.

I am actually struggling to achieve and the sample code will be of great help.

Thanks in Advance!

Regards,
Rajiv