cancel
Showing results for 
Search instead for 
Did you mean: 

Complex Variables over REST (java noob)

kyleshort
Champ in-the-making
Champ in-the-making
Searching the forums, it's clear that this topic isn't new. However, much of the commentary here assumes a Java audience. Perhaps it's foolish, but I am looking at using Activiti as a back end with an AngularJS front end on top of the REST API. I have almost 0 knowledge of Java.

So far things are humming along, but the one catch is variables. Simple types are dead easy over REST…but complex types represented as objects in the REST JSON payload appear to be automatically converted to serialized objects. When I retrieve the data for the variable, I don't get the JSON representation, I get what looks like the byte array?

I've since seen indications in forum discussions that you can modify the underlying classes to allow complex JSON to be returned via REST, as opposed to these byte arrays. However, with 0 Java knowledge, I can't make heads or tails of it.

Question: is there a way to address this using the current REST API, without writing Java?

Question: if some degree of Java customization is required to enable the passing of complex objects via REST…are there detailed instructions on how to do this?

Comment: I think Activiti can occupy a large niche…providing a BPMN engine for HTML 5 fronted applications…purely via REST. Nice! But there are a few hiccups like these variables, that seem to have dependency on Java skills. I'd love to see the platform get to a state where you can truly be effective leveraging the REST api and not the Java api at all.

Thanks!

Kyle
3 REPLIES 3

jbarrez
Star Contributor
Star Contributor
I'm afraid not. The custom serialization is all java, see http://stacktrace.be/blog/2013/09/custom-variable-representations-in-activiti-rest/ for an example how to do so.

>  I'd love to see the platform get to a state where you can truly be effective leveraging the REST api and not the Java api at all.

I agree, it would certainly be nice to get to that point. But for that to work, we need to have data and data mappings in the core engine first. That will take a while still to get there.

aalaa
Champ in-the-making
Champ in-the-making
can u give an example on how you post a variable of type serializable in the request body ?

jbarrez
Star Contributor
Star Contributor
Please don't post two times the same post….