How to save a process? What is recommended?

491 views
Skip to first unread message

john andres medina

unread,
Sep 17, 2015, 5:31:36 PM9/17/15
to camunda BPM users
Hi Everyone!

This time I want to ask you how to save a process in a database? 
I have read the documentation but still not clear about how to do it.

And is the same to save a process in a file or in a Stream that in a database? What about the actual state of the process?

Thank you so much!

thorben....@camunda.com

unread,
Sep 18, 2015, 2:33:25 AM9/18/15
to camunda BPM users
Hi,

With "process", do you mean "process definition" (i.e. the BPMN XML file and its internal representation) or "process instance" (the runtime construct when you start the process definition)?

Cheers,
Thorben

john andres medina

unread,
Sep 18, 2015, 10:18:20 AM9/18/15
to camunda BPM users
Yes, I mean a Process Definition.

thorben....@camunda.com

unread,
Sep 21, 2015, 8:28:29 AM9/21/15
to camunda BPM users
Hi,

Do you raise the question in the context of the Camunda modeler or the process engine?

Based on your last question, I assume that you mean the process engine. You may have noticed that the process engine always uses a database in which it persists process definitions (i.e. the BPMN XML) as well as runtime state (the state of running process instances). Whenever you make a deployment (in form of a process application [1], via Java or REST [2] API), the process engine stores the BPMN XML in its database. You can retrieve it with the method RepositoryService#getProcessModel. Whenever you start a process instance, the process engine persists the current state when wait states [3] are reached.

Cheers,
Thorben

[1] http://stage.docs.camunda.org/manual/7.3/guides/user-guide/#process-applications
[2] http://stage.docs.camunda.org/manual/7.3/api-references/rest/#deployment-post-deployment
[3] http://stage.docs.camunda.org/manual/7.3/guides/user-guide/#process-engine-transactions-in-processes

john andres medina

unread,
Sep 21, 2015, 10:18:09 AM9/21/15
to camunda BPM users
Hi!

Actually, I was referring to the process itself, the XML file or his alternatives in the Camunda modeler. 

Thank you!

thorben....@camunda.com

unread,
Sep 21, 2015, 12:58:18 PM9/21/15
to camunda BPM users
Hi,

If you are looking for a model repository independent of the camunda BPM execution platform, I am afraid we have currently no solution. Of course you can use any database-backed solution for document management.

You may also want to follow the bpmn.io [1] that is going to replace the eclipse modeler sooner or later and for which we plan to build a repository in some form.

Best regards,
Thorben

[1] http://bpmn.io/

john andres medina

unread,
Sep 21, 2015, 2:01:10 PM9/21/15
to camunda BPM users
Ok, I got it. But what if I'm using the camunda modeler java api and I want to save the process, it is possible to save the process definition only as a stream or as a xml and json file? What are the possibilities to save the process definition related to a custom table in the camunda database?

Thank you.

Daniel Meyer

unread,
Sep 22, 2015, 1:36:37 AM9/22/15
to camunda BPM users

Hi,


it is possible to hook into the eclipse modeler and implement a custom save action.

But you would have to dig into the code yourself.


If you start with something new now, then I would definitely recommend starting on top of bpmn.io.


Daniel


john andres medina

unread,
Sep 22, 2015, 9:18:10 AM9/22/15
to camunda BPM users
Hi,

Ok, but I'm not using the eclipse modeler, I`m using the BPMN java API 'org.camunda.bpm.model.bpmn' like in this example [1]:

BpmnModelInstance modelInstance = Bpmn.createEmptyModel();

Definitions definitions = modelInstance.newInstance(Definitions.class);
definitions.setTargetNamespace("http://camunda.org/examples");
modelInstance.setDefinitions(definitions);

Process process = modelInstance.newInstance(Process.class);
process.setId("process");
definitions.addChildElement(process);

So, the question is: What are the possibilities to save the process definition, in another way different that xml, json or stream, something like a custom table in the camunda database?

Thank you.

Reply all
Reply to author
Forward
0 new messages