Resource Deployments

Этот раздел перенесён из документации Camunda 7 и в дальнейшем будет доработан с учётом особенностей OpenBPM Engine

This section documents how to perform process engine deployments with a Quarkus application containing an embedded process engine. The documentation assumes some familiarity with [Quarkus CDI support][quarkus-cdi] and the Camunda {{< javadocref page="org/camunda/bpm/engine/repository/DeploymentBuilder.html" text="DeploymentBuilder" >}} API.

The Camunda Engine Quarkus Extension only supports programmatic deployments. A user can observe for the CamundaEngineStartupEvent CDI event. The CamundaEngineStartupEvent signals that a process engine has been successfully bootstrapped, and a deployment can be performed.

The following example shows how a single process engine deployment can be performed in a Quarkus application:

@ApplicationScoped
public class MyConfig {

  @Inject
  RepositoryService repositoryService;

  public void createDeployment(@Observes CamundaEngineStartupEvent event) {
    repositoryService.createDeployment()
        .addClasspathResource("resources/bpmn/simpleProcess.bpmn")
        .deploy();
  }

}

However, a Quarkus application doesn’t have to be limited to a single process engine deployment. You can observe for the CamundaEngineStartupEvent in multiple methods, and perform multiple deployments with a finer-grained control over the deployed resources.

@ApplicationScoped
public class MyConfig {

  @Inject
  RepositoryService repositoryService;

  public void createDeployment1(@Observes CamundaEngineStartupEvent event) {
    repositoryService.createDeployment()
        .name("deployment-1")
        .addClasspathResource("resources/bpmn/one/simpleProcess1.bpmn")
        .deploy();
  }

  public void createDeployment2(@Observes CamundaEngineStartupEvent event) {
    repositoryService.createDeployment()
        .name("deployment-2")
        .addClasspathResource("resources/bpmn/two/simpleProcess2.bpmn")
        .deploy();
  }

}

Лицензия и атрибуция

Эта документация была создана на базе материала "Camunda 7 Docs" от Camunda, находится под лицензией Creative Commons Attribution-ShareAlike 3.0 Unported License .

Оригинал документации: https://docs.camunda.org