workflow-core
workflow-core copied to clipboard
BsonDeserialization fails
STR:
- Configure JsonSerialization to use
camelCase
in your project - Instal WorkflowCore as Nuget package.
- Create a workflow that passes the data between steps.
- Configure the workflow to use MongoDB.
- Start the workflow.
Expected result:
- The workflow created.
- Each step proceeds correctly.
Actual result:
- The workflow created.
- No step can be processed because the state (
Workflow.Data
) can not be read from the MongoDB.
Solution:
We need to read BSON documents in the same way we write them.
Could you include a project that replicates this issue? The workflow data serialization for MongoDB does work in the examples.
Hi Daniel, I have the same issue)
Hi Daniel, It works for me if I do next changes in MongoPersistenceProvider.cs. 0001-Thta-is-fix-for.patch.zip
I agree with mapkuh0000. We need to read BSON documents in the same way we write them
I have workflow like this:
public class ConsumerWorkflow : IWorkflow<ConsumerContext>
Additionally I have marked ConsumerContext with Mongo attribute.
[BsonDiscriminator("ConsumerContext")] public class ConsumerContext
and
BsonClassMap.RegisterClassMap<ConsumerContext>();
Thank you. Hope it helps
Encountered the same issue, is the patch posted by @jzevakin safe to use for now? Or it might have unwanted side effects?
I am also facing the same issue on this context.