How to handle TaskObject output

Hi, I’m using the activity Wait for Form Task and Resume and get as output a TaskObject.

I need the data from TaskObject.Data.

When I use a messagebox I can see that the data is in JSON format. But when trying to serialize it to JSON, it doesn’t work, because an Orchestrator process does not allow JSON Objects.

I’ve tried many different things, but I couldn’t figure out how to access the data. I know the key-value pairs and all the keys, but I can’t use them, because late binding is not allowed.

How do you handle this?

  • T0Bi

Edit: I really dislike the new tag system. A lot of topics do not fit those tags…

1 Like

Ok, so I’ve probably figured out the worst solution possible, but it’s better than nothing.
I basically wrote my own deserializer:

Dim arr As String() = jsonString.Replace(“{”,“”).Replace(“}”,“”).Split(New Char() {“,“c})
Dim dictionary As New Dictionary(Of String, String)
For Each element As String In arr
Dim elArr As String() = element.Split(New Char() {”:“c})
Dim key As String = elArr(0).Replace(vbCr, “”).Replace(vbLf, “”).Replace(””“”, “”).Trim()
Dim value As String= elArr(1).Replace(vbCr, “”).Replace(vbLf, “”).Replace(“”“”, “”).Trim()
dictionary.Add(key, value)
outputData = dictionary

Maybe this helps someone.

I’d still love to hear how to do this the right way.

1 Like

Have you tried the serialization activities in the WebAPI before you had to implement the serialization logic?

Yes, but it doesn’t work, because then I’d need to save the output into a JSON Object. But JSON is not allowed in an Orchestrator Process (process that supports persistance).

That’s my biggest problem.

With my own code, I skipped the JSON part and went directly into the dictionary.