cancel
Showing results for 
Search instead for 
Did you mean: 

creating a model with activiti-rest and design with activiti modeler

marian88
Champ in-the-making
Champ in-the-making
Hi all,

I started a project and I am using activiti-rest and activiti-explorer(only the modeler). I use activiti-rest to communicate with the engine, and use my own UI.

My problem is that after I create a new model using activiti-rest I want to send the user to the activiti-modeler(from activiti-explorer) by providing the proper model ID (which I received from activiti-rest when I created the model via /activiti-rest/service/repository/models) :

ex:
http://localhost:8080/activiti-explorer/service/editor?id=3203

It seems that there is a step that I am not doing; The error that I see in web console is:
Failed to load resource: the server responded with a status of 500 (Internal Server Error) http://localhost:8080/activiti-explorer/service/model/3203/json

Thanks!
4 REPLIES 4

marian88
Champ in-the-making
Champ in-the-making
probably I have to set this source via PUT?

{"id":"canvas","resourceId":"canvas","stencilset":{"namespace":"http://b3mn.org/stencilset/bpmn2.0#"}}

jbarrez
Star Contributor
Star Contributor
If it's a 500, there is a stacktrace somewhere that should give you some inspiration.

Try to use the dev tools from Chrome/Firefox to inspect the JSON that goes over the wire when the model is correctly opened, and mimuc that behaviour in your own code.

marian88
Champ in-the-making
Champ in-the-making
Thanks!
I succeeded creating a model with my UI via activiti rest and then use modeler to design the model (I set the source {"id":"canvas","resourceId":"canvas","stencilset":{"namespace":"http://b3mn.org/stencilset/bpmn2.0#"}} and the metainfo to 
"{\"name\":\"modelName\",\"revision\":1,\"description\":\"\"}").

What I'd like now is to deploy the model created with Activiti Modeler from my UI via Rest API but it seems I cannot because the Deployment Rest API requires the bpmn20.xml file to be uploaded. I thought that I can deploy the model using modelId

The only way is to get the bpmn20.xml model somehow from activiti-explorer and upload via rest for deployment? Or can I deploy directly via rest the model created with the Activiti Modeler like is done in Activiti-Explorer?

marian88
Champ in-the-making
Champ in-the-making
I understand that the model editor source is in json format that Modeler understands. So when Activiti-explorer deploys the model, that json is converted in XML and then deployed. So in my current situation I need to convert the model editor source from json to bpmn20 xml format to be able to deploy via Rest.  Probably I will use Activiti-Explorer for deploying the model because I can't do that conversion without using some activiti jars in my proj.