XML Template to be saved in Camunda DB and read from it

Hi Folks,

Is there a way to save the XML/BPMN definition in act_ge_bytearray table of camunda?
I have to basically read and write from this table and have to store pre-canned BPMN templates from the user to this table directly.

Is there any way to do this using Camunda SDK? Please guide me on how to achieve this.

Thanks,
Jatin

@jatin when you deploy the bpmn file it will store in the act_ge_bytearray table only. So you can easily access it via Java/Rest apis

You can render deployed bpmn in xml format from /rest/process-definition/get-xml/

To deploy the bpmn via Rest API refer here.

@aravindhrs I need to keep the templates with me and have to deploy on on-demad basis.
I need a mechanism to store them in the above mentioned table using camunda sdk if there is a way of doing that at all.

The deployment procedure is clear to me but thanks for explaining it anyway :slight_smile:

Thanks,
Jatin

using rest api, you can deploy the bpmn whenever you need it.

How did you setup your application? Auto deployment feature enabled?

No auto-deployment is not enabled.
We are capturing templates from user.

When user provides the definition at run-time we will deploy it.

So, i need this table to store the xml and use the xm from it to create a UI out of it.

this above two links will fulfill your requirement. let me know if it doesn’t suits.

But i have just a small doubt regarding it.
How will my XML be stored in the database without me actually deploying it there.

Get call i understand but how can i save the template without definition using camunda sdk there as we are not thinking of auto-deploying bpmn xmls.

Your requirement is to deploy the bpmn on-demand basis. So you can use this rest api to deploy the bpmn file, which will save the bpmn file as xml format (BLOB) in act_ge_bytearray table.

You need invoke camunda server rest api url like below:

Multipart form-data:

POST : http://< hostname>:< port>/< context-path>/deployment/create

you can refer this video tutorial for deployment: