diff --git a/numass-main/src/main/java/inr/numass/workspace/NumassFitScanTask.java b/numass-main/src/main/java/inr/numass/workspace/NumassFitScanTask.java index 7bb45bf0..99b56e8d 100644 --- a/numass-main/src/main/java/inr/numass/workspace/NumassFitScanTask.java +++ b/numass-main/src/main/java/inr/numass/workspace/NumassFitScanTask.java @@ -47,8 +47,12 @@ public class NumassFitScanTask extends GenericTask { MetaBuilder overrideMeta = new MetaBuilder(fitConfig); overrideMeta.setValue("@resultName", String.format("%s[%s=%s]", data.getName(), scanParameter, val.stringValue())); - overrideMeta.getNodes("params.param").stream() - .filter(par -> par.getString("name") == scanParameter).forEach(par -> par.setValue("value", val)); + if (overrideMeta.hasNode("params." + scanParameter)) { + overrideMeta.setValue("params." + scanParameter + ".value", val); + } else { + overrideMeta.getNodes("params.param").stream() + .filter(par -> par.getString("name") == scanParameter).forEach(par -> par.setValue("value", val)); + } // Data