Load postgres params from tomcat properties into flowable code

Hi,

I run successfully the flowable example with postgresql which is configured in a file named flowable-ui-app.properties into /opt/tomcat/lib
Do you know how to load this parameters from /opt/tomcat/lib into the java code instead of the following :

ProcessEngineConfiguration cfg = new StandaloneProcessEngineConfiguration()
.setJdbcUrl(“jdbc:h2:mem:flowable;DB_CLOSE_DELAY=-1”)
.setJdbcUsername(“sa”)
.setJdbcPassword(“”)
.setJdbcDriver(“org.h2.Driver”)
.setDatabaseSchemaUpdate(ProcessEngineConfiguration.DB_SCHEMA_UPDATE_TRUE);

:penguin::penguin::penguin:

You’d need to read those properties (using default Java property reading/Spring property support/etc) and then pass them into the configuration. The Flowable engine expects either a flowable.cfg.xml file or programmatically (as above). In fact, the flowable-ui-app.properties are read and then used internally to programmatically create the engine.

Ok, i am not using spring.
Maybe your comment should be added into the flowable documentation
Thank you for your answer

  • Do you have flowable source learning materials, I would like to join the source code development

No need to resurrect a 5 year old thread ;-).

The best way to learn code is to have a look at the many unit tests that are available in the various modules of GitHub - flowable/flowable-engine: A compact and highly efficient workflow and Business Process Management (BPM) platform for developers, system admins and business users..