Register process application for process definitions deployed by REST API

Hello guys,
as in topic. How can I register process application for process definitions deployed by REST API? I’d like to use Java Delegates which are included in the application.

Thanks.

Hi @dikey94,

That is only possible via Java API, see ManagementService#registerProcessApplication. You could build a custom REST endpoint on top of that. We are also always happy to receive contributions :slight_smile:

Cheers,
Thorben

Thank you @thorben,
works. Have another question - Do I have to call the method each time I start up the Tomcat? And what if I have multiple Camunda instances and shared the database?

Hi,

The registrations are not persisted by the process engine, so you may have to recreate them. Maybe you can also use the resumePreviousBy property in processes.xml of your process application such that it automatically resumes the deployments you made via REST API. See this section of the user guide: https://docs.camunda.org/manual/7.7/user-guide/process-applications/the-processes-xml-deployment-descriptor/#process-application-deployment

Cheers,
Thorben

1 Like

Thank you @thorben. Appreciate your time.

Hi everyone,

I hope you don’t mind me reviving this topic, but it already was eye opening to me and I can’t resist but to ask a couple of questions. Well, they won’t be questions really, but a description of how I believe things stand at the moment. Please feel free to correct me.

If I understand everything correctly:

  • there’s nothing stopping me from deploying a new process definition through REST/Modeler (in which case it’s saved in database, as it does not exist on disk)
  • however, if that process definition uses custom class (some delegate, for instance), the only supported way to successfully deploy and use it is through a process application (that application will hold the mentioned class, and Camunda will “context switch” when necessary)
  • if we were to deploy a process definition which uses custom class through REST/Modeler the deploy itself would work, however the process could not be instantiated (there’s no process application that holds the class)
  • and bundling that code into a JAR, placing it into a “shared/lib” folder won’t do any good, since we’re still missing the process application registration

Basically, it appears that trying to deploy process definitions with custom code outside of process applications isn’t really what Camunda had in mind?

Thank you!

Hi @thorben, I hope you don’t mind me asking.

I’m having troubles understanding where to use the Java API to register deployment with a process application, care to explain?
I understand that I should “re-register” on server restart since the registration is in memory (and I can do that in @PostDeploy of my process application), however, I don’t see how to register a fresh REST deployment.