Document Processing 20.4 Beta: Human-Robot Interaction using Action Center

Please use parallel for each instead.

2 Likes

Hi Team,

When the automation is going under Wait for document validation and resume activity then it is throwing an exception as mentioned below:

RemoteException wrapping System.Runtime.Serialization.InvalidDataContractException: Type ‘System.Net.Mail.AlternateViewCollection’ cannot be serialized. Consider marking it with the DataContractAttribute attribute, and marking all of its members you want serialized with the DataMemberAttribute attribute. If the type is a collection, consider marking it with the CollectionDataContractAttribute. See the Microsoft .NET Framework documentation for other supported types.
at System.Runtime.AsyncResult.End[TAsyncResult](IAsyncResult result)
at System.Activities.WorkflowApplication.IdleEventHandler.OnStage2Complete(IAsyncResult lastResult, WorkflowApplication instance, Boolean isStillSync)
at System.Activities.WorkflowApplication.EventFrame(IAsyncResult result)

However, while running the code in Debug mode and applying a breakpoint on this activity and when it comes to this stage then I validate the results in orchestrator and continue the process then it is not giving any exception.

Please let me know how to resolve this error ASAP.

Hello @Gupta_Divya ,

You are using an AlternateViewCollection object in your workflow and that object is NOT serializable => cannot be used directly in a persistence workflow.

Workaround for this is to identify the part of your workflow that is using the mail collection, and isolate it into a separate workflow you can then invoke. This would ensure that that variable is NOT declared anywhere in the Main xaml and therefore your process can use the persistence activities.

Hope this helps,

Ioana

2 Likes

Hi,

Please try replacing for each with parallel for each, it should resolve the issue.

Hi, I still have this issue. Do I need to check any other things

This worked for me to. Goto Project.Config and change the “Support Persistence” to True.

Hey, I have tried changing the scope of variables still we are getting below error.

21.10.3+Branch.master.Sha.8291b2799a85589c5b075e0d1f69016fc83eec97
Type ‘Newtonsoft.Json.Linq.JToken’ is a recursive collection data contract which is not supported. Consider modifying the definition of collection ‘Newtonsoft.Json.Linq.JToken’ to remove references to itself.
RemoteException wrapping System.Runtime.Serialization.InvalidDataContractException: Type ‘Newtonsoft.Json.Linq.JToken’ is a recursive collection data contract which is not supported. Consider modifying the definition of collection ‘Newtonsoft.Json.Linq.JToken’ to remove references to itself.
at System.Runtime.AsyncResult.End[TAsyncResult](IAsyncResult result)
at System.Activities.WorkflowApplication.IdleEventHandler.OnStage2Complete(IAsyncResult lastResult, WorkflowApplication instance, Boolean isStillSync)
at System.Activities.WorkflowApplication.EventFrame(IAsyncResult result)

@Pratiksha_Mahajan @Vishal_Kalra

Thanks in Advance!