Dear Camunda community,
I would like to access configuration in the application.yml from a Java delegate class I use for a Service task in my BPMN. I use a Spring boot project set up according to the tutorials at your website.
My delegate class looks as follows:
@Component("abcd")
@ConfigurationProperties(prefix = "configtest")
public class Abcd implements JavaDelegate {
private String vari;
public String getVari() {
return vari;
}
public void setVari(String vari) {
this.vari = vari;
}
public void execute(DelegateExecution execution) throws Exception {
logger.info(vari);
logger.info(this.vari);
logger.info(this.getVari());
}
}
and my application.yml is as follows:
camunda.bpm:
job-execution.enabled: false
id-generator: simple
spring.datasource:
url: jdbc:h2:mem:camunda-spring-boot-test;DB_CLOSE_ON_EXIT=false
configtest:
vari: foo
However after invoking this component in the process the “foo” string is not printed out in the log. Instead, there is a null value. What am I doing wrong and what is the best practice in configurating the app?
Thanks, Jan