diff --git a/src/main/java/org/gridsuite/loadflow/server/service/LoadFlowRunContext.java b/src/main/java/org/gridsuite/loadflow/server/service/LoadFlowRunContext.java index a62feb39..41b9c123 100644 --- a/src/main/java/org/gridsuite/loadflow/server/service/LoadFlowRunContext.java +++ b/src/main/java/org/gridsuite/loadflow/server/service/LoadFlowRunContext.java @@ -7,6 +7,7 @@ package org.gridsuite.loadflow.server.service; import com.powsybl.commons.PowsyblException; +import com.powsybl.commons.config.PlatformConfig; import com.powsybl.commons.extensions.Extension; import com.powsybl.loadflow.LoadFlowParameters; import com.powsybl.loadflow.LoadFlowProvider; @@ -35,9 +36,10 @@ public LoadFlowParameters buildParameters() { LoadFlowProvider lfProvider = LoadFlowProvider.findAll().stream() .filter(p -> p.getName().equals(provider)) .findFirst().orElseThrow(() -> new PowsyblException("LoadFLow provider not found " + provider)); - Extension extension = lfProvider.loadSpecificParameters(parameters.specificParameters()) + Extension specificParametersExtension = lfProvider.loadSpecificParameters(PlatformConfig.defaultConfig()) .orElseThrow(() -> new PowsyblException("Cannot add specific loadflow parameters with provider " + provider)); - params.addExtension((Class) extension.getClass(), extension); + lfProvider.updateSpecificParameters(specificParametersExtension, parameters.specificParameters()); + params.addExtension((Class) specificParametersExtension.getClass(), specificParametersExtension); return params; }