Skip to content

Commit 68ab465

Browse files
committed
ST6RI-864 Removed ActionUsageAdapter.isNonExitEntryComposite method.
- For subtypes of ActionUsage other than StateUsage, this check is unnecessary, because the conditions it was used in only applied in cases in which the owningType was other than a StateDefinition or StateUsage.
1 parent 4281088 commit 68ab465

7 files changed

Lines changed: 24 additions & 44 deletions

File tree

org.omg.sysml/src/org/omg/sysml/adapter/AnalysisCaseUsageAdapter.java

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
/*******************************************************************************
22
* SysML 2 Pilot Implementation
3-
* Copyright (c) 2021, 2023 Model Driven Solutions, Inc.
3+
* Copyright (c) 2021, 2023, 2025 Model Driven Solutions, Inc.
44
*
55
* This program is free software: you can redistribute it and/or modify
66
* it under the terms of the GNU Lesser General Public License as published by
@@ -44,8 +44,9 @@ protected String getSubactionType() {
4444
}
4545

4646
public boolean isSubAnalysisCase() {
47-
Type owningType = getTarget().getOwningType();
48-
return isNonEntryExitComposite() &&
47+
AnalysisCaseUsage target = getTarget();
48+
Type owningType = target.getOwningType();
49+
return target.isComposite() &&
4950
(owningType instanceof AnalysisCaseDefinition || owningType instanceof AnalysisCaseUsage);
5051
}
5152

org.omg.sysml/src/org/omg/sysml/adapter/CalculationUsageAdapter.java

Lines changed: 2 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -48,16 +48,10 @@ protected String getSubactionType() {
4848
}
4949

5050
public boolean isSubcalculation() {
51-
/*
52-
* TODO: Update checkCalculationUsageSubcalculationSpecialization
53-
*
54-
* isNonEntryExitComposite check is not part of the OCL
55-
* See SYSML12-298
56-
*/
5751
CalculationUsage target = getTarget();
5852
Type owningType = target.getOwningType();
59-
return isNonEntryExitComposite() &&
60-
owningType instanceof CalculationDefinition || owningType instanceof CalculationUsage;
53+
return target.isComposite() &&
54+
(owningType instanceof CalculationDefinition || owningType instanceof CalculationUsage);
6155
}
6256

6357
@Override

org.omg.sysml/src/org/omg/sysml/adapter/CaseUsageAdapter.java

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -57,15 +57,9 @@ protected String getSubactionType() {
5757
}
5858

5959
public boolean isSubcase() {
60-
/*
61-
* TODO: Update checkCaseUsageSubcaseSpecialization
62-
*
63-
* nonEntryExit part of the check is not reflected of the OCL
64-
* See SYSML21-298
65-
*/
6660
CaseUsage target = getTarget();
6761
Type owningType = target.getOwningType();
68-
return isNonEntryExitComposite() &&
62+
return target.isComposite() &&
6963
(owningType instanceof CaseDefinition || owningType instanceof CaseUsage);
7064
}
7165

org.omg.sysml/src/org/omg/sysml/adapter/PartUsageAdapter.java

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -62,9 +62,10 @@ protected boolean isRequirementActor() {
6262

6363
protected boolean isRequirementStakeholder() {
6464
/*
65-
* TODO: Update checkPartUsageStakeholderSpecialization?
66-
*
67-
* OCL doesn't require the owningType to be ReqDef or ReqUsage
65+
* Note: checkPartUsageStakeholderSpecialization OCL doesn't explicitly require the owningType
66+
* to be a RequirmentDefinition or RequirementUsage. However, a valid stakeholder must be owned
67+
* by a RequirementDefinition or RequirementUsage and, if it isn't the implied subsetting won't
68+
* be valid, so don't add it.
6869
*/
6970
PartUsage target = getTarget();
7071
Type owningType = target.getOwningType();

org.omg.sysml/src/org/omg/sysml/adapter/UsageAdapter.java

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -96,10 +96,6 @@ public boolean hasRelevantSubjectParameter() {
9696
return false;
9797
}
9898

99-
public boolean isNonEntryExitComposite() {
100-
return getTarget().isComposite() && !isEntryExitAction();
101-
}
102-
10399
public boolean isActionOwnedComposite() {
104100
Usage target = getTarget();
105101
Type owningType = target.getOwningType();

org.omg.sysml/src/org/omg/sysml/adapter/UseCaseUsageAdapter.java

Lines changed: 9 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,11 @@ public UseCaseUsageAdapter(UseCaseUsage element) {
3131
super(element);
3232
}
3333

34+
@Override
35+
public UseCaseUsage getTarget() {
36+
return (UseCaseUsage)super.getTarget();
37+
}
38+
3439
/**
3540
* @satisfies checkIncludeUseCaseSpecialization
3641
* @satisfies checkUseCaseUsageSpecialization
@@ -41,23 +46,11 @@ protected String getSubactionType() {
4146
return isSubUseCase()? "subUseCase": super.getSubactionType();
4247
}
4348

44-
public boolean isSubUseCase() {
45-
Type owningType = getTarget().getOwningType();
46-
47-
/*
48-
* TODO: Update checkUseCaseSubUseCaseSpecialization
49-
*
50-
* OCL does not include isNonEntryExitComposite.
51-
* See SYSML21-298
52-
*/
53-
54-
return isNonEntryExitComposite() &&
49+
public boolean isSubUseCase() {
50+
UseCaseUsage target = getTarget();
51+
Type owningType = target.getOwningType();
52+
return target.isComposite() &&
5553
(owningType instanceof UseCaseDefinition || owningType instanceof UseCaseUsage);
5654
}
5755

58-
@Override
59-
public UseCaseUsage getTarget() {
60-
return (UseCaseUsage)super.getTarget();
61-
}
62-
6356
}

org.omg.sysml/src/org/omg/sysml/adapter/VerificationCaseUsageAdapter.java

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
/*******************************************************************************
22
* SysML 2 Pilot Implementation
3-
* Copyright (c) 2021, 2023 Model Driven Solutions, Inc.
3+
* Copyright (c) 2021, 2023, 2025 Model Driven Solutions, Inc.
44
*
55
* This program is free software: you can redistribute it and/or modify
66
* it under the terms of the GNU Lesser General Public License as published by
@@ -46,8 +46,9 @@ protected String getSubactionType() {
4646
}
4747

4848
public boolean isSubVerificationCase() {
49-
Type owningType = getTarget().getOwningType();
50-
return isNonEntryExitComposite() &&
49+
VerificationCaseUsage target = getTarget();
50+
Type owningType = target.getOwningType();
51+
return target.isComposite() &&
5152
(owningType instanceof VerificationCaseDefinition || owningType instanceof VerificationCaseUsage);
5253
}
5354

0 commit comments

Comments
 (0)