Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Question: Spring Boot starter with shared engine? #156

Closed
miwoe opened this issue Oct 31, 2016 · 3 comments
Closed

Question: Spring Boot starter with shared engine? #156

miwoe opened this issue Oct 31, 2016 · 3 comments
Labels

Comments

@miwoe
Copy link

miwoe commented Oct 31, 2016

Hi,

I am currently trying to deploy a Spring Boot application with a shared process engine on a tomcat. I thought I have the solution, but it seems that I have two different application contexts running. I cannot autowire dependencies like RuntimeService.

Is there any example available for using Spring Boot with a shared engine on a servlet container?

Best Regards,
Michael

@jangalinski
Copy link
Contributor

Hm. You probably know the war example https://github.com/camunda/camunda-bpm-spring-boot-starter/tree/master/examples/example-war
Buts thats still using an embedded engine. I wonder why I would want to use spring boot in a shared engine scenario anyway. Could you please elaborate what problem you are trying to solve? I mean if the engine is configured via platform.xml anyway, a normal engine-spring application would be enough, this extension mainly deals with configuring/starting and deploying the engine ...

@miwoe
Copy link
Author

miwoe commented Nov 1, 2016

We are using Camunda in a layered microservice context and some services are controlled by BPM process. As the BPM process is invoking some other BPM processes of other domains, we preferred a shared engine with a central Camunda installation and its central cockpit and administration tools.

I have solved the problem with the examples by propagating the process engine in the Spring Context:

    @Bean
    public ProcessEngineService getProcessEngineService() {
        return BpmPlatform.getProcessEngineService();
    }

    @Bean
    public ProcessEngine getProcessEngine() {
        return this.getProcessEngineService().getDefaultProcessEngine();
    }

@miwoe miwoe closed this as completed Nov 4, 2016
@thanigachalamp
Copy link

Hi,

I am also using Camunda in a layered microservice context and some services are controlled by BPM process. As the BPM process is invoking some other BPM processes of other domains, we preferred a shared engine with a central Camunda installation and its central cockpit and administration tools.

I have followed above steps, but always process engine is null this.processEngineService().getDefaultProcessEngine().

Listed out the steps:

  1. Downloaded Tomcat
  2. Downloaded camunda-webapp-tomcat-standalone-7.14.0.war, unzip and drop it in the webapps
  3. My own spring boot application is build and when i tried to deployed into same tomcat, always got null processEngineService().getDefaultProcessEngine()

Please find the sample code:
@bean
public ProcessEngineService processEngineService() {
return BpmPlatform.getProcessEngineService();
}
@bean(destroyMethod = "")
public ProcessEngine processEngine(){
ProcessEngine processEngine = this.processEngineService().getDefaultProcessEngine();
System.out.println(" Process engine is successfully created "+processEngine);
return processEngine;
}
@bean
public SpringProcessApplication processApplication()
{
return new SpringProcessApplication();
}

org.camunda.bpm camunda-engine provided org.camunda.bpm camunda-engine-spring org.springframework spring-context org.apache.tomcat.embed tomcat-embed-jasper provided org.springframework.boot spring-boot-starter-tomcat provided org.springframework.boot spring-boot-starter-web

Please help me to resolve

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants