Rest JSON deserialization converted to key=value

Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-18-2013 03:20 AM
Hi all.
i've a problem with the rest functions, especially the start one.
i send data in this way:
now, inside one of my task i load the "data", but what i get is this:
that's wrong.
how can i solve this problem?
i've a problem with the rest functions, especially the start one.
i send data in this way:
{ "processDefinitionKey":"sid-f7f670e1-a6cf-42a7-b824-f88446256b7f", "variables":[ { "name":"processId", "value":108 }, { "name":"data", "value":[ { "lastname":"my lastname", "birthday":"my birthday", "name":"my name" } ] }, { "name":"task_instance", "value":82 } ]}
now, inside one of my task i load the "data", but what i get is this:
[{lastname=my lastname, birthday=my birthday, name=my name}]
that's wrong.
how can i solve this problem?
Labels:
- Labels:
-
Archive
6 REPLIES 6
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-18-2013 05:43 AM
What a coincidence, I have a blog-post about this ready and will be posted today. I'll post the link here once it's online!

Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-18-2013 05:52 AM
i found that it is already parsed. so i've to encode it twice to do the parsing manually.
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-18-2013 06:03 AM
Yes, it's parsed into a Map by Jackson…

Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-18-2013 08:45 AM
mmm.
another thing.
i'm trying to write a script to manipluate a json object with groovy and script task.
this is the object (it's "data", an execution variable):
any idea?
another thing.
i'm trying to write a script to manipluate a json object with groovy and script task.
this is the object (it's "data", an execution variable):
[{"validation": "7"}, {"validation": "5"}]
when i try to check the lenght, it gives me this:
size 42
basically it's understood as a string and not as a json list.any idea?
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-19-2013 02:11 AM
How is the variable stored in the process (which type)? Check the ACT_RU_VARIABLE or use the API to fetch the variable value yourself (not in a script)…

Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-19-2013 03:43 AM
The fact is that by sending a singal i can only send a string (or other first-class types).
Probably also for the start process i can't send json objects (i actually send a string). but there i've a java class that does the translation, and it stores a JSONObject with setVariable.
The problem is with signals. I can't make it receiving a json object. I tried and i seen them as "null" in a script task.
Right now I made a compiler that takes the process and adds a service task after each receive.
i've to test it. wondering if there's a better solution. but if it works than fine (i've to compile the process anyway).
Probably also for the start process i can't send json objects (i actually send a string). but there i've a java class that does the translation, and it stores a JSONObject with setVariable.
The problem is with signals. I can't make it receiving a json object. I tried and i seen them as "null" in a script task.
Right now I made a compiler that takes the process and adds a service task after each receive.
i've to test it. wondering if there's a better solution. but if it works than fine (i've to compile the process anyway).
