Read failedJobRetryTimeCycle value from value from property file

Hi, In spring boot flowable application, I am trying to set failedJobRetryTimeCycle for service task which is defined in BPMN file from application.properties

I am trying below and it is not working

BPMN:
flowable:failedJobRetryTimeCycle${taskretry}</flowable:failedJobRetryTimeCycle>

application.properties
taskretry=R5/PT2

I want to change this taskretry value based on different environment. Is there any way to read it from property file?.

Thanks in advance!

You would need to use something like ${environment.getProperty()} - basically any Spring bean is available in expressions.

Thanks Jaram,

I am trying to execute on my local , but I am getting below error
Exception in thread “task-4” org.flowable.common.engine.api.FlowableException: failedJobRetryTimeCycle has wrong format: “${taskretry}”
at org.flowable.engine.impl.cmd.JobRetryCmd.execute(JobRetryCmd.java:127)

In my property file , I defined taskretry=R5/PT2,.

But I am able to read all other property values to my other XMLs. I am facing issue only on my BPMN file.

I also tried ${environment.getProperty(“taskretry”)} and its giving same wrong format error. Please suggest …

What version of Flowable are you running?

Looking at the source code flowable-engine/JobRetryCmd.java at master · flowable/flowable-engine · GitHub, this logic to read that value as an expression is on 6.6 and was added here: Make failedJobRetryTimeCycle an expression · flowable/flowable-engine@2168074 · GitHub

I am using flowable 6.5 version

<dependency>
	    <groupId>org.flowable</groupId>
	    <artifactId>flowable-spring-boot-starter</artifactId>		    
	    <version>6.5.0</version>
	</dependency>

Flowable 6.5 doesn’t have it. Check the second link I pasted above, it states 6.6.0.

Thanks , I will try it out by upgrading.