Commit c04ae616 authored by Bonita CI's avatar Bonita CI

Merge branch 'master' into 'dev'

parents ae6a8fb9 072317f1
......@@ -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);
}
#Processed using Jarprocessor
jarprocessor.exclude.children = true
instructions.install = \
chmod(targetDir:@artifact,targetFile:tomcat/setup/setup.sh,permissions:755);
instructions.install.import= \
org.eclipse.equinox.p2.touchpoint.eclipse.chmod
\ No newline at end of file
......@@ -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);
}
}
......@@ -57,4 +57,8 @@ public abstract class AbstractFileModel extends AbstractImportModel implements I
this.status = ConflictStatus.NONE;
}
public boolean shouldBeImported() {
return importAction == ImportAction.OVERWRITE;
}
}
......@@ -41,7 +41,19 @@ public class ImportStoreModel extends AbstractFolderModel {
}
public Stream<ImportableUnit> importableUnits() {
return Stream.concat(getFiles().stream().filter(ImportableUnit.class::isInstance).map(ImportableUnit.class::cast),
getFolders().stream().filter(ImportableUnit.class::isInstance).map(ImportableUnit.class::cast));
return Stream.concat(importableFiles(), importableFolders());
}
private Stream<ImportableUnit> importableFolders() {
return getFolders().stream()
.filter(ImportableUnit.class::isInstance)
.map(ImportableUnit.class::cast);
}
private Stream<ImportableUnit> importableFiles() {
return getFiles().stream()
.filter(AbstractFileModel::shouldBeImported)
.filter(ImportableUnit.class::isInstance)
.map(ImportableUnit.class::cast);
}
}
......@@ -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