diff --git a/li.strolch.agent/src/main/java/li/strolch/persistence/api/AbstractTransaction.java b/li.strolch.agent/src/main/java/li/strolch/persistence/api/AbstractTransaction.java index 21a76fdf0..0abbb02bc 100644 --- a/li.strolch.agent/src/main/java/li/strolch/persistence/api/AbstractTransaction.java +++ b/li.strolch.agent/src/main/java/li/strolch/persistence/api/AbstractTransaction.java @@ -557,6 +557,12 @@ public abstract class AbstractTransaction implements StrolchTransaction { throw new StrolchModelException(MessageFormat.format(msg, locator, stateOrBagOrActivity)); } + @Override + public > Optional findParameterOnHierarchy(StrolchRootElement element, + String parentParamKey, String paramKey) { + return findParameterOnHierarchy(element, parentParamKey, BAG_PARAMETERS, paramKey); + } + @Override public > Optional findParameterOnHierarchy(StrolchRootElement element, String parentParamKey, String bagKey, String paramKey) { diff --git a/li.strolch.agent/src/main/java/li/strolch/persistence/api/StrolchTransaction.java b/li.strolch.agent/src/main/java/li/strolch/persistence/api/StrolchTransaction.java index b86ccc054..8bf3c2dc1 100644 --- a/li.strolch.agent/src/main/java/li/strolch/persistence/api/StrolchTransaction.java +++ b/li.strolch.agent/src/main/java/li/strolch/persistence/api/StrolchTransaction.java @@ -630,6 +630,27 @@ public interface StrolchTransaction extends AutoCloseable { T findElement(Locator locator, boolean allowNull) throws StrolchModelException, ClassCastException; + /** + *

Finds a parameter with the {@link StrolchConstants#BAG_PARAMETERS} and @paramKey on the given @element, but if + * it does not exists + * on the element, then it retrieves the elements parent by using the bag {@link + * StrolchModelConstants#BAG_RELATIONS} and the param @parentParamKey.

+ * + *

In Strolch relationships are usually defined on the parameter bag with the id {@link + * StrolchModelConstants#BAG_RELATIONS}

+ * + * @param element + * the element on which to search for the parameter + * @param parentParamKey + * the id of the parameter with which to find the parent + * @param paramKey + * the id of the parameter to find + * + * @return the {@link Optional} with the parameter which was found, following the hierarchy up the chain + */ + > Optional findParameterOnHierarchy(StrolchRootElement element, String parentParamKey, + String paramKey); + /** *

Finds a parameter with the given @bagKey and @paramKey on the given @element, but if it does not exists * on the element, then it retrieves the elements parent by using the bag {@link