Shutting down the camunda startup process in case of exception

Hello all,

I have a question regarding a possible manual shutdown of the camunda startup process due to an exception. This is my case:

I have a process engine plugin that tries to initiate a schema and tables in the same database that camunda is using. If the schema and tables can’t be initiated, then the whole startup process of camunda is supposed to be stopped.

Would a simple processEngineConfiguration.getProcessEngine().close(); be the correct way to achieve this?

Cheers,

Dirk

Why do you need to create schema manually? By setting the flag camunda schema “create” will do the job.

This schema and tables is NOT for camunda itself but for an external REST-API

@dirkw65 your setup is spring boot application?

You can achieve this via spring boot setup, when schema is not found.

SpringApplication.exit(ctx, () -> 0 );

No, it’s a wildfly setup. What would processEngineConfiguration.getProcessEngine().close(); achieve within the preInit() method of the ProcessEnginePlugin?

Hi @dirkw65,

I don’t know if it works in your context, but a glance at the implementation looks promising: https://github.com/camunda/camunda-bpm-platform/blob/master/engine/src/main/java/org/camunda/bpm/engine/impl/ProcessEngineImpl.java#L131-L149

I would give it a try.

Hope this helps, Ingo