Getting error in wait for form task and resume activity

Hi i am getting the below mentioned error in wait for form task and resume activity:

20.4.3

Message: 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.

Exception Type: System.Runtime.Serialization.InvalidDataContractException

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)
Capture

1 Like

@shetanshudhar

Check below post

Hope this may helps you

Thanks

@ksrinu070184 it did not help me so far…

@PrafullK @Liji @William_Blech_Sister
Help me out please. I have put assign form task and all variables in 1 sequence but it is still not helping.

Can you share the code or snapshot of the sequence? It will help to understand better.
One more thing, just go to project settings and check whether “Supports Persistence” is enabled. If it is not then please enable it.

Petty Cash Approval.zip (36.2 KB)

Hi @PrafullK this is my code. Supports persistence is enabled.

Follow the below steps-

  1. Create a seperate .xaml file (say JsonTask) and add all the activities from “Input Dialogue” to “Create Form Task” in that .xaml file.
  2. In the JsonTask .xaml file create only one output argument (say out_FinalOutput having datatype as FormTaskData)
  3. Assign the finaloutput variable value to the out argument i.e. out_FinalOutput
  4. Invoke this workflow above the “Wait for Form Task and Resume” activity in Main.xaml
  5. Use out_FinalOutput value as an input to the “Wait for Form Task and Resume” activity

Perform these steps and your issue will get resolve. Let me know the outcome.

1 Like

@PrafullK followed the steps completely but still got same error :frowning:
But i would definitely thank you for putting in so much effort.

Petty Cash Approval.zip (26.8 KB)
Check this and execute.

1 Like

@PrafullK you sir are a rockstar. Its working and you made it work. I also understood the only thing i missed. After getting form output, you assigned the value of the variable to an out argument which was new. and then that argument was called for the wait for form action and resume activity. The key was taking the form data value in a variable and then assigning it to an out argument.
Thanks a zillion. I am sure you spent considerable time resolving this issue.

This topic was automatically closed 3 days after the last reply. New replies are no longer allowed.