The "Wait for Form Task and Resume" activity is used in a process. When trying to capture the data from the form's output variable, the following error is thrown " 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 UiPath Orchestrator" .
In order to fix this, re-design the project as follows:
- Create a separate xaml file
- In this separate xaml file, initialize a new Out argument of type List and use as object type the type you setup as output from the Create Document Validation Action
- In an individual sequence, use Deserialize json on the config.json file. The generated JsonObject output should be kept in the scope of this sequence
- In another sequence include all the activities related to the DU process, like: Deserialize json, Load Taxonomy, Classify Document, Data Extraction Scope, Create Document Validation, etc.
- After the Create Document Validation Action, add the activity "Add to Collection" and add the outputs of the previous activity into the collection (the out Argument) you previously created
- In the Main.xaml file, invoke the other xaml file and from "Import arguments", import the out argument of List type and give it as value a variable of the same type
- Use a Parallel for Each (or a regular For each) to iterate through each item of the said List
- In the Body of the activity, add the Wait For Document Validation Action And Resume.