Deploy processes manually

Hi,

for an integration test that i am writing i would like to manually deploy a process to the engine, once via Java API, once via REST API.

Seems easy, but i´m actually struggling. I´ve only ever used the autodeployment feature of Spring Boot and the deployment mechanism of the camunda modeler. So i know it´s possible to deploy via REST, but i have no idea how exactly to design the POST request against the interface. I know the path (/rest/deployment/create), but where do i put the process model?
With the Java Api it´s similar.

Any advice? Thanks in advance!

You can add the process model as part of the body of this request.
Using
Content-Type multipart/form-data

Thanks. I´ll try it.

Any advice on how to do it via JAVA Api?

Something like this would do the trick.

processEngine().getRepositoryService().createDeployment()
	  .addClasspathResource("pathOfFile")
	  .deploy(); 

Oh man, i was missing the .deploy()-part. I feel stupid now. Thanks alot, that did the trick.

1 Like

Don’t worry, happens to everyone :slight_smile:

1 Like