Skip to content

Commit 899af3d

Browse files
authored
Merge pull request #249 from Open-MBEE/release/4.0.18
Release/4.0.18
2 parents 30751d8 + b2145fb commit 899af3d

File tree

4 files changed

+15
-5
lines changed

4 files changed

+15
-5
lines changed

cameo/src/main/java/org/openmbee/mms/cameo/CameoConstants.java

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -76,7 +76,8 @@ public class CameoConstants {
7676
public static final String USECASEIDS = "useCaseIds";
7777
public static final String VALUEID = "valueId";
7878
public static final String VISIBILITY = "visibility";
79-
public static final String APPLIEDSTEREOTYPEIDS = "_appliedStereotypeIds";
79+
public static final String APPLIEDSTEREOTYPEIDS = "appliedStereotypeIds";
80+
public static final String OLDAPPLIEDSTEREOTYPEIDS = "_appliedStereotypeIds";
8081
public static final String CHILDVIEWS = "_childViews";
8182
public static final String CONTENTS = "_contents";
8283
public static final String ISGROUP = "_isGroup";

cameo/src/main/java/org/openmbee/mms/cameo/services/CameoHelper.java

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -49,6 +49,9 @@ public CameoNodeType getNodeType(ElementJson e) {
4949

5050
public boolean isView(ElementJson e) {
5151
List<String> sids = (List)e.get(CameoConstants.APPLIEDSTEREOTYPEIDS);
52+
if (sids == null) {
53+
sids = (List)e.get(CameoConstants.OLDAPPLIEDSTEREOTYPEIDS);
54+
}
5255
if (sids != null && !sids.isEmpty()) {
5356
Set<String> ids = new HashSet<>(sids);
5457
ids.retainAll(CameoConstants.VIEWSIDS);
@@ -59,6 +62,9 @@ public boolean isView(ElementJson e) {
5962

6063
public boolean isDocument(ElementJson e) {
6164
List<String> sids = (List)e.get(CameoConstants.APPLIEDSTEREOTYPEIDS);
65+
if (sids == null) {
66+
sids = (List)e.get(CameoConstants.OLDAPPLIEDSTEREOTYPEIDS);
67+
}
6268
if (sids != null && sids.contains(CameoConstants.DOCUMENTSID)) {
6369
return true;
6470
}
@@ -88,7 +94,6 @@ public ElementJson createProperty(String id, String name, String ownerId, String
8894
res.put(CameoConstants.DOCUMENTATION, "");
8995
res.put(CameoConstants.MDEXTENSIONSIDS, new ArrayList());
9096
res.put(CameoConstants.SYNCELEMENTID, null);
91-
res.put(CameoConstants.APPLIEDSTEREOTYPEINSTANCEID, null);
9297
res.put(CameoConstants.CLIENTDEPENDENCYIDS, new ArrayList());
9398
res.put(CameoConstants.SUPPLIERDEPENDENCYIDS, new ArrayList());
9499
res.put(CameoConstants.VISIBILITY, "private");
@@ -135,7 +140,6 @@ public ElementJson createAssociation(String id, String ownerId, String ownedEnd,
135140
association.put(CameoConstants.MDEXTENSIONSIDS, new ArrayList());
136141
association.put(CameoConstants.SYNCELEMENTID, null);
137142
association.put(CameoConstants.APPLIEDSTEREOTYPEIDS, new ArrayList());
138-
association.put(CameoConstants.APPLIEDSTEREOTYPEINSTANCEID, null);
139143
association.put(CameoConstants.CLIENTDEPENDENCYIDS, new ArrayList());
140144
association.put(CameoConstants.SUPPLIERDEPENDENCYIDS, new ArrayList());
141145
association.put(CameoConstants.NAMEEXPRESSION, null);

crud/src/main/java/org/openmbee/mms/crud/services/DefaultBranchService.java

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -114,7 +114,12 @@ public RefsResponse getBranch(String projectId, String id) {
114114
public RefJson createBranch(String projectId, RefJson branch) {
115115
Instant now = Instant.now();
116116
ContextHolder.setContext(projectId);
117-
Branch b = new Branch();
117+
118+
Optional<Branch> branchesOption = this.branchRepository.findByBranchId(branch.getId());
119+
Branch b = branchesOption.orElseGet(Branch::new);
120+
if (b.isDeleted()) {
121+
throw new BadRequestException("Bad Request Error: Branch was previously deleted.");
122+
}
118123

119124
b.setBranchId(branch.getId());
120125
b.setBranchName(branch.getName());

gradle.properties

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
version=4.0.17
1+
version=4.0.18
22
group=org.openmbee.mms
33

44
springBootVersion=2.6.7

0 commit comments

Comments
 (0)