解决'您尝试访问的流程引擎不存在'

问题描述 投票:2回答:1

我在我的应用程序中运行嵌入式camunda引擎。现在我想在同一个数据库的不同容器上运行带驾驶舱的第二个camunda引擎。我所做的基本上是我的主要applciation配置的复制粘贴,只是从camunda-bpm-spring-boot-starter切换到camunda-bpm-spring-boot-starter-webapp。我可以访问驾驶舱主页,但我立即提示The process engine you are trying to access does not exist,我不明白为什么?在启动时,我可以看到mySpringProcessEngineConfiguration bean和ProcessEngineFactoryBean bean一样。然而:

BpmPlatform.getProcessEngineService().getProcessEngineNames();

返回空集。你能看看并指出我的错误吗?

主app类:

@SpringBootApplication
public class CamundaCockpitApplication {

public static void main(String[] args) {
    SpringApplication.run(CamundaCockpitApplication.class, args);
    BpmPlatform.getProcessEngineService().getProcessEngineNames();
}

Chamunda Confing:

@Configuration
@RequiredArgsConstructor
public class EngineConfiguration {

private final DataSource dataSource;

private final PlatformTransactionManager transactionManager;

private final ResourcePatternResolver resourcePatternResolver;

@Bean
public SpringProcessEngineConfiguration springProcessEngineConfiguration() {
    SpringProcessEngineConfiguration springConfiguration = new SpringProcessEngineConfiguration();
    springConfiguration.setDataSource(dataSource);
    springConfiguration.setTransactionManager(transactionManager);
    springConfiguration.setDatabaseSchemaUpdate("false");
    springConfiguration.setJobExecutorActivate(false);
    springConfiguration.setHistory("full");
    springConfiguration.setJdbcBatchProcessing(false);
    return springConfiguration;
}

@Bean
public ProcessEngineFactoryBean processEngineFactoryBean() {
    ProcessEngineFactoryBean engine = new ProcessEngineFactoryBean();
    engine.setProcessEngineConfiguration(springProcessEngineConfiguration());
    return engine;
}
}
java spring process bpmn camunda
1个回答
2
投票

您需要将@EnableProcessApplication注释添加到主类中。

https://docs.camunda.org/manual/7.9/user-guide/spring-boot-integration/process-applications/

© www.soinside.com 2019 - 2024. All rights reserved.