Dexels / navajo

Navajo Service-oriented Applications
GNU Affero General Public License v3.0
9 stars 5 forks source link

Add support to GetProperty functions for usage with properties outside indoc #569

Closed roelofkemp closed 3 years ago

roelofkemp commented 3 years ago

fix so that the functions can also be used with outside the indoc using the $propertyObject construction.

in the previous code, getCurrentMessage was always null, making the function always search for a property in the indoc.

Property p = (getCurrentMessage() != null ? getCurrentMessage().getProperty(propertyName) : this.getNavajo().getProperty(propertyName));

This fix is backwards compatible, but also allows scripts to use the function on any property outside the indoc. For instance:

<expression condition="GetPropertyAttribute($propertyObject('Value'), 'cardinality') == '+'" value="'multiselect'" />
kharybdys commented 3 years ago

Note, getCurrentMessage is not always null, so the change reported here has been adjusted to leave in support for getCurrentMessage. The situation where getCurrentMessage has a value is when you're looping over some message.

ghost commented 3 years ago

Resulted in bundle com.dexels.navajo.function version 3.5.19.