After successfully creating Form Task, the “Wait for Form Task and Resume” activity is throwing below error. Any help on this would be much appreciated.
Message: Type ‘System.Collections.IEnumerable’ 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.
RemoteException wrapping System.Runtime.Serialization.InvalidDataContractException: Type ‘System.Collections.IEnumerable’ 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)
One suggestion: if you are working with human in the loop you cannot put it in a different workflow and call it on main. It MUST be on main, can you try that?
It happened to me, this error message is crazy and does not help at all!
Hi @PrafullK,
All workflow variables in the same scope of persistence points in a workflow (wait and resume* activities ) should be serializable as mentioned here Orchestration Process
If there are such non-serializable variables in the same scope of ‘wait for task and resume’, consider moving them to a different scope or a secondary workflow.
Thanks
Trying to use “Wait for all form task completion.xaml” snippet. It is able to create all the tasks but when it is coming to second loop where it should execute “Wait and Resume For All Tasks” loop, it is throwing below error-
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.
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)
What I understood from my experience is that we need to create an Orchestration project and in that, in Main.xaml we need to use these activities (Create Form Task or Wait for Form Task and Resume).
They do work in for each but not together, we need to use them in separate loops. I have attached a snippet, hope it helps.
I followed your workflow. For each which you used for wait for form task and resume. For first loop its working for second loop it throws an error as " Object reference not set to an instance of an object". But there is the value. Can you guide me. how to fix this issue or please share the workflow.Thanks.
Hey, consider using Parallel for Each if you are waiting on multiple actions in the same job. There are snippets in studio under the category ‘Orchestration’ that demonstrates this