Creating Models Programmatically (C8)

In platform 7, BPMN models can be created programmatically.
I wonder if such a possibility is available in platform 8.

Hey @hassang

yes we have a port of it for Zeebe as well. It is part of the Zeebe repo see here zeebe/bpmn-model at main · camunda/zeebe · GitHub


1 Like

Hi @Zelldon,

Are there any related examples or documentation?
Thanks in advance…

Thanks @Zelldon

I managed to do a small test.

  • Imported the required maven dependency as below
  • Code is identical to C7 code
BpmnModelInstance modelInstance;
File file;

modelInstance = 
			.name("Example process")
			.name("Task 1")

file = new File("C:\\model-api-test\\example-c8-process.bpmn");

try {
} catch (IOException e) {

	System.out.println("Error: " + e.getMessage());

Bpmn.writeModelToFile(file, modelInstance);

Hey @hassang

sorry for the late reply. I was not able to send a good example before since I was only available via mobile. Thanks for sharing your solution :slight_smile:

You can also take a look at the engine tests, e.g. zeebe/ at main · camunda/zeebe · GitHub where we use the model API everywhere.


1 Like