diff --git a/spring-boot/src/main/java/io/vanillabp/camunda7/deployment/Camunda7DeploymentAdapter.java b/spring-boot/src/main/java/io/vanillabp/camunda7/deployment/Camunda7DeploymentAdapter.java index 6126760..7dc72e6 100644 --- a/spring-boot/src/main/java/io/vanillabp/camunda7/deployment/Camunda7DeploymentAdapter.java +++ b/spring-boot/src/main/java/io/vanillabp/camunda7/deployment/Camunda7DeploymentAdapter.java @@ -136,7 +136,7 @@ protected void doDeployment( : processEngine .getRepositoryService() .createProcessDefinitionQuery() - .tenantIdIn(workflowModuleId)) + .tenantIdIn(tenantId)) .list() .forEach(definition -> { // process models parsed during deployment are cached and therefore diff --git a/spring-boot/src/main/java/io/vanillabp/camunda7/service/jobs/startprocess/StartProcessJobHandler.java b/spring-boot/src/main/java/io/vanillabp/camunda7/service/jobs/startprocess/StartProcessJobHandler.java index e58ff73..ea2beb7 100644 --- a/spring-boot/src/main/java/io/vanillabp/camunda7/service/jobs/startprocess/StartProcessJobHandler.java +++ b/spring-boot/src/main/java/io/vanillabp/camunda7/service/jobs/startprocess/StartProcessJobHandler.java @@ -23,13 +23,15 @@ public void execute( final CommandContext commandContext, final String tenantId) { - commandContext + final var command = commandContext .getProcessEngineConfiguration() .getProcessEngine() .getRuntimeService() .createProcessInstanceByKey(configuration.getBpmnProcessId()) - .businessKey(configuration.getBusinessKey()) - .processDefinitionTenantId(configuration.getTenantId()) + .businessKey(configuration.getBusinessKey()); + (configuration.getTenantId() == null + ? command.processDefinitionWithoutTenantId() + : command.processDefinitionTenantId(configuration.getTenantId())) .execute(); }