Commit 072317f1 authored by Romain Bioteau's avatar Romain Bioteau

fix(diagram) update config id when renaming

Closes BS-19236
parent 1dc4d5ae
......@@ -29,4 +29,6 @@ public interface IConfigurationIdProvider {
boolean isConfigurationIdValid(MainProcess diagram);
boolean isConfigurationIdValid(Object configId, String diagramName, String modelVersion, String bonitaVersion);
Object getConfigurationId(String diagramName, String bonitaModelVersion, String bonitaVersion);
}
......@@ -42,4 +42,9 @@ public class ConfigurationIdProvider implements IConfigurationIdProvider {
return configId != null && configId.toString().equals(get(diagramName, modelVersion, bonitaVersion));
}
@Override
public Object getConfigurationId(String diagramName, String bonitaModelVersion, String bonitaVersion) {
return get(diagramName, bonitaModelVersion, bonitaVersion);
}
}
......@@ -18,6 +18,7 @@ import java.lang.reflect.InvocationTargetException;
import java.util.ArrayList;
import java.util.List;
import org.bonitasoft.studio.common.ConfigurationIdProvider;
import org.bonitasoft.studio.common.NamingUtils;
import org.bonitasoft.studio.common.diagram.dialog.ProcessesNameVersion;
import org.bonitasoft.studio.common.repository.RepositoryManager;
......@@ -81,6 +82,10 @@ public class RenameDiagramOperation implements IRunnableWithProgress {
CompoundCommand compoundCommand = new CompoundCommand();
if (!(oldName.equals(diagramName) && oldVersion.equals(diagramVersion))) {
changeProcessNameAndVersion(diagram, compoundCommand, diagramName, diagramVersion, editingDomain);
editingDomain.getCommandStack().execute(
SetCommand.create(editingDomain, diagram, ProcessPackage.Literals.MAIN_PROCESS__CONFIG_ID,
ConfigurationIdProvider
.getConfigurationIdProvider().getConfigurationId(diagramName,diagram.getBonitaModelVersion(),diagram.getBonitaVersion())));
}
for (final ProcessesNameVersion pnv : pools) {
final AbstractProcess fromPool = pnv.getAbstractProcess();
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment