cancel
Showing results for 
Search instead for 
Did you mean: 

Adding node id in process.xml

buden_rizwan
Discoverer
0 Kudos
634

How to get the node id from local.properties file to set it in the node of an action tag in process.xml?

I know that we can set the node value as something like :

<action id='actionId' bean='actionBean' node='2' >

</action>

This would ensure the particular action would always be executed on node 2 in a cluster environment, but is there a way to get the node value from local.properties!?

View Entire Topic
geffchang
Active Contributor
0 Kudos

Try something like this:

<property name="cacheSeconds" value="#{configurationService.configuration.getProperty('storefront.resourceBundle.cacheSeconds')}" />

storefront.resourceBundle.cacheSeconds is the key from local.properties.

buden_rizwan
Discoverer
0 Kudos

Thank you geff.h.n.chang for taking time to go through my question. But unfortunately the solution you suggested did not work. The process engine is somehow not able to get the value from local.properties and I when I see the process task in backoffice, the node value is same as what i had given in process.xml i.e. #{configurationService.configuration.getProperty('storefront.resourceBundle.cacheSeconds')} and it is not taking the actual value of the key - storefront.resourceBundle.cacheSeconds from the local.properties.

I even tried to take the value using this notation - ${db.pool.maxIdle} but even this does not work. 😞

geffchang
Active Contributor
0 Kudos

buden.rizwan I'm not sure if we had the same understanding, but what I meant was doing something like this:

<action id='actionId' bean='actionBean' node='#{configurationService.configuration.getProperty('custom.node.value')}' >

Then, in local.properties, I would have something like:

custom.node.value=3

stephenielabovitz
Discoverer
0 Kudos
Has anyone successfully used this? I tried the <action id='actionId' bean='actionBean' node='#{configurationService.configuration.getProperty('custom.node.value')}' > suggestion but continuously get an error when running the process that says "'#{configurationService.configuration.getProperty('custom.node.value')}' is not a valid value for 'integer'." I do have custom.node.value=1 in my local.properties file. I have also tried with 'getInt' and 'getInteger'