cancel
Showing results for 
Search instead for 
Did you mean: 

How to use property value in timer configuration

hiten_rastogi1
Star Contributor
Star Contributor
Hi,

I am using activiti with Alfresco to create a multilevel approval workflow.

I am thinking of using a property in timer config e.g. <timeCycle>${cronExpression}</timeCycle> instead of <timeCycle>0 0/1 * * * ?</timeCycle>, where cronExpression=0 0/1 * * * ?.

Can someone please help me out how can I achieve this.
3 REPLIES 3

warper
Star Contributor
Star Contributor
Hi hitenrastogi!
I think you can simply set process variable cronExpression and then use expression ${cronExpression} in TimerCatchingEvent

hiten_rastogi1
Star Contributor
Star Contributor
Hi Warper,

Thanks for your reply but this is not what I am looking for, I want that variable to be preferably in something like alfresco-global.properties, if possible, so that I can change the cromExpression without restarting the server and redeploying the service.

warper
Star Contributor
Star Contributor
Hi hitenrastogi!
>I want that variable to be preferably in something like alfresco-global.properties
Noone limits you, read whatever property you want from whatever configuration you want. You can use spring bean, java delegate or whatever JUEL-available configuration reader you want. TimerCatchingEvent simply runs JUEL expression to get timer definition. One of my processes reads timer duration from LDAP.

I don't think such property can affect timer jobs in activiti database, though. That is, once timer is set, it needs to be fired before it can change configuration (reread properties, reevaluate expression) .