Amir Pashazadeh
Amir Pashazadeh

Reputation: 7302

Changing Camunda deployment from embedded to remote

I have a Spring project using Camunda BPMS, which is embedded in our project. Is there anyway I can change the deployment model to standalone, without changing code, and just by configuration?

I mean I want to create an instance of ProcessEngine (and its inner services), which delegates its job through REST webservices (not working on database directly). (By the way I will deploy my JavaDelegate classes into the standalone server, no problem about it).

I believe this should be doable, but couldn't find any guide about it.

Upvotes: 1

Views: 449

Answers (1)

Jan Galinski
Jan Galinski

Reputation: 11993

The community extension camunda-rest-client-spring-boot aims to allow exactly this. Implementing the camunda service interfaces via REST.

a remote call can look like this:

@Component
public class MyClient {

  private RuntimeService runtimeService;

  public MyClient(@Qualifier("remote") RuntimeService runtimeService) {
    this.runtimeService = runtimeService;
  }

  public void start() {
    this.runtimeService
      .startProcessInstanceByKey("my_process_key");
  }

  public void correlate() {
    this.runtimeService
      .createMessageCorrelation("message_received")
      .processInstanceBusinessKey("WAIT_FOR_MESSAGE")
      .correlateAllWithResult();
  }
}

The extension is not feature complete yet, but supports the most common use cases, so you could check if it fits your needs.

Upvotes: 1

Related Questions