Using Spring Boot Properties

Flowable applications are Spring Boot 2.1 applications and they are configured like a typical Spring Boot application. In this guide, we are going to explain a small subset of the possibilities, to understand more please read the Spring Boot Externalized Configuration.

Spring Boot allows a sensible way of overriding properties. The following is a subset of the ordering:

  1. Command line arguments (if running with java -jar application.jar).

  2. JNDI attributes from java:comp/env.

  3. Java System properties (System.getProperties()).

  4. OS environment variables.

  5. Profile-specific application properties outside of your packaged jar (application-{profile}.properties and YAML variants).

  6. Profile-specific application properties packaged inside your jar (application-{profile}.properties and YAML variants).

  7. Application properties outside of your packaged jar (application.properties and YAML variants).

  8. Application properties packaged inside your jar (application.properties and YAML variants).

Application Property Files

A Spring Boot application loads properties from application.properties files from the following locations:

  1. A /config subdirectory of the current directory (if running with java -jar application.jar).

  2. The current directory (if running with java -jar application.jar).

  3. A classpath /config package.

  4. The classpath root.

Properties defined in locations higher in the list have a higher priority.

It is also possible to define additional locations for the configuration files by defining the spring.config.additional-location property. The locations specified are used in addition to the default locations and have a higher priority.

This priority of the configuration lets you specify default values in one configuration file and then selectively override those values in another. You can provide default values for your application in application.properties in one of the default locations. These default values can then be overridden at runtime with a different file located in one of the custom locations.

Relaxed Binding

Spring Boot uses some relaxed rules for binding Environment properties to @ConfigurationProperties beans, so there does not need to be an exact match between the Environment property name and the bean property name. Typical examples where this is useful include dash-separated environment properties (for example, context-path binds to contextPath), and capitalized environment properties (for example, PORT binds to port).

Defining Properties for a Prebuilt Flowable WAR

If you are using a prebuilt Flowable WAR application (i.e., not building your own WAR) then you have different options to provide custom properties to the application.

Deploying into Tomcat

If you are deploying the Flowable WAR Application into Tomcat, then the only thing you need to do is to define your own application.properties file in to the Tomcat lib directory.

Running an Executable Jar

If you are running the application as an executable jar (by using java -jar flowable-work.war), then you need to define your own application.properties in the same folder where your flowable-work.war file is located.