How to deserialize the StringData field of WorkflowDefinition to access and modify its properties? #7015
Unanswered
PlazaValentin
asked this question in
Q&A
Replies: 1 comment
-
|
Short answer: yes, you can deserialize it, but In the current code:
Relevant source:
So the safe interpretation is:
Practical options:
So: supported for internal/application use, yes. Stable enough to treat |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
Hi everyone
I'm currently migrating from Elsa Workflows v2 to v3, and I have a question regarding the WorkflowDefinition entity in the Elsa.Workflows.Management.Entities namespace.
In Elsa 2, we used to manually serialize and deserialize workflow data (activities, connections, variables, etc.) into a JSON column called Data.
In Elsa 3, I noticed that the equivalent column seems to be StringData, which contains the serialized workflow definition.
My question is:
Is there any supported way in Elsa 3 to deserialize the StringData field from a WorkflowDefinition entity (e.g., using a serializer service like IWorkflowDefinitionSerializer), modify some parts of it (for example, activities or variables), and then save it back to the database?
If yes:
Which serializer or helper class should I use to parse and re-serialize it properly?
Is the internal JSON schema for StringData stable enough to be modified directly?
Basically, I’d like to be able to:
Load a workflow definition from EF (WorkflowDefinition).
Access and modify its inner structure programmatically.
Re-serialize and save it safely.
Thanks a lot in advance for your help and for the amazing work on Elsa 3!
Beta Was this translation helpful? Give feedback.
All reactions