Skip to content

Commit 2bee824

Browse files
committed
ST6RI-843 Marked code that differ from the OCL spec
1 parent cdc5834 commit 2bee824

11 files changed

Lines changed: 139 additions & 1 deletion

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

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -48,6 +48,18 @@ protected String getSubactionType() {
4848
}
4949

5050
public boolean isSubcalculation() {
51+
/*
52+
* TODO: ST6RI-843
53+
*
54+
* checkCalculationUsageSubcalculationSpecialization
55+
*
56+
* owningType <> null and
57+
* (owningType.oclIsKindOf(CalculationDefinition) or
58+
* owningType.oclIsKindOf(CalculationUsage)) implies
59+
* specializesFromLibrary('Calculations::Calculation::subcalculations')
60+
*
61+
* isNonEntryExitComposite check is not part of the OCL
62+
*/
5163
CalculationUsage target = getTarget();
5264
Type owningType = target.getOwningType();
5365
return isNonEntryExitComposite() &&

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

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -57,6 +57,17 @@ protected String getSubactionType() {
5757
}
5858

5959
public boolean isSubcase() {
60+
/*TODO: ST6RI-843
61+
*
62+
* checkCaseUsageSubcaseSpecialization
63+
*
64+
* isComposite and owningType <> null and
65+
* (owningType.oclIsKindOf(CaseDefinition) or
66+
* owningType.oclIsKindOf(CaseUsage)) implies
67+
* specializesFromLibrary('Cases::Case::subcases')
68+
*
69+
* nonEntryExit part of the check is not reflected of the OCL
70+
*/
6071
CaseUsage target = getTarget();
6172
Type owningType = target.getOwningType();
6273
return isNonEntryExitComposite() &&

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

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -85,6 +85,19 @@ protected String getDefaultSupertype() {
8585
}
8686

8787
protected boolean isCheckedConstraint() {
88+
/*
89+
* TODO: ST6RI-843
90+
*
91+
* checkConstraintUsageCheckedConstraintSpecialization
92+
*
93+
* owningType <> null and
94+
* (owningType.oclIsKindOf(ItemDefinition) or
95+
* owningType.oclIsKindOf(ItemUsage)) implies
96+
* specializesFromLibrary('Items::Item::checkedConstraints')
97+
*
98+
* OCL doesn't require composite
99+
*
100+
*/
88101
ConstraintUsage target = getTarget();
89102
Type owningType = target.getOwningType();
90103
return target.isComposite() &&

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

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,16 @@ public EventOccurrenceUsage getTarget() {
3737
return (EventOccurrenceUsage)super.getTarget();
3838
}
3939

40+
/*
41+
* TODO: ST6RI-843
42+
*
43+
* All general semantic constraints on an OccurrenceUsage
44+
* (see 8.4.5.2 ) also apply to an EventOccurrenceUsage.
45+
*
46+
* addDefaultGeneralType and getDefaultSuperType overrides look redundant
47+
* as they both check for subOccurrence which is also done by OccurrenceUsageAdapter
48+
*/
49+
4050
/**
4151
* @satisfies checkOccurrenceUsageSuboccurrenceSpecialization
4252
*/

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

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -238,8 +238,21 @@ public void addDefaultGeneralType() {
238238

239239

240240
protected void addBoundValueSubsetting() {
241+
/*
242+
* TODO: ST6RI-843
243+
*
244+
* direction = null and
245+
* ownedSpecializations->forAll(isImplied) implies
246+
* ownedMembership->
247+
* selectByKind(FeatureValue)->
248+
* forAll(fv | specializes(fv.value.result))
249+
*
250+
*
251+
*/
252+
241253
Feature target = getTarget();
242254
Feature result = getBoundValueResult();
255+
243256
if (result != null && target.getOwnedSpecialization().isEmpty() && target.getDirection() == null) {
244257
addImplicitGeneralType(SysMLPackage.eINSTANCE.getSubsetting(), result);
245258
}

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

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -63,6 +63,14 @@ protected boolean isInFilterExpression() {
6363
* @satisfies checkFeatureReferenceExpressionBindingConnector
6464
*/
6565
protected void addReferenceConnector() {
66+
/*
67+
* TODO: ST6RI-843
68+
*
69+
* ownedMember->selectByKind(BindingConnector)->exists(b |
70+
* b.relatedFeatures->includes(targetFeature) and
71+
* b.relatedFeatures->includes(result))
72+
*
73+
*/
6674
if (!isInFilterExpression()) {
6775
FeatureReferenceExpression target = getTarget();
6876
Feature referent = target.getReferent();

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

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -57,6 +57,15 @@ protected void addResultTyping() {
5757
Feature seqResult = seqArgument.getResult();
5858
Type arrayType = getLibraryType(ARRAY_TYPE);
5959
Type scalarValueType = getLibraryType(SCALAR_VALUE_TYPE);
60+
/*
61+
* TODO: ST6RI-843
62+
* checkIndexExpressionResultSpecialization:
63+
* arguments->notEmpty() and
64+
* not arguments->first().result.specializesFromLibrary('Collections::Array') implies
65+
* result.specializes(arguments->first().result)
66+
*
67+
* '|| TypeUtil.specializes(target, scalarValueType)' part is not reflected by the OCL
68+
*/
6069
if (!TypeUtil.specializes(target, arrayType) || TypeUtil.specializes(target, scalarValueType)) {
6170
Feature resultFeature = target.getResult();
6271
if (resultFeature != null && seqResult != null) {

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

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -61,6 +61,17 @@ protected boolean isRequirementActor() {
6161
}
6262

6363
protected boolean isRequirementStakeholder() {
64+
/*
65+
* TODO: ST6RI-843
66+
*
67+
* checkPartUsageStakeholderSpecialization
68+
*
69+
* owningFeatureMembership <> null and
70+
* owningFeatureMembership.oclIsKindOf(StakeholderMembership) implies
71+
* specializesFromLibrary('Requirements::RequirementCheck::stakeholders')
72+
*
73+
* OCL doesn't require the owningType to be ReqDef or ReqUsage
74+
*/
6475
PartUsage target = getTarget();
6576
Type owningType = target.getOwningType();
6677
return UsageUtil.isStakeholderParameter(target) &&

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

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,21 @@ protected String getSubactionType() {
4343

4444
public boolean isSubUseCase() {
4545
Type owningType = getTarget().getOwningType();
46+
47+
/*
48+
* TODO: ST6RI-843
49+
*
50+
* checkIncludeUseCaseSpecialization
51+
*
52+
* owningType <> null and
53+
* (owningType.oclIsKindOf(UseCaseDefinition) or
54+
* owningType.oclIsKindOf(UseCaseUsage) implies
55+
* specializesFromLibrary('UseCases::UseCase::includedUseCases')
56+
*
57+
* the semantic constraint doens't require the IncludeUseCaseUsage to be composite, also
58+
* IncludeUseCaseUsageImpl overrides isComposite to always return false
59+
*/
60+
4661
return isNonEntryExitComposite() &&
4762
(owningType instanceof UseCaseDefinition || owningType instanceof UseCaseUsage);
4863
}

org.omg.sysml/src/org/omg/sysml/util/ImplicitGeneralizationMap.java

Lines changed: 24 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -133,6 +133,15 @@ protected ImplicitGeneralizationMap() {
133133
//checkStepOwnedPerformanceSpecialization
134134
put(FlowImpl.class, "ownedPerformance", "Objects::Object::ownedPerformances");
135135

136+
/*
137+
* TODO: ST6RI-843
138+
* checkFlowSpecialization
139+
* specializesFromLibrary('Transfers::transfers')
140+
*
141+
* This case is missing from the implementation
142+
*/
143+
144+
136145
//checkFeatureFlowFeatureRedefinition
137146
put(FlowEndImpl.class, "sourceOutput", "Transfers::Transfer::source::sourceOutput");
138147
//checkFeatureFlowFeatureRedefinition
@@ -435,7 +444,7 @@ protected ImplicitGeneralizationMap() {
435444
put(OccurrenceUsageImpl.class, "timeslice", "Occurrences::Occurrence::timeSlices");
436445
//checkOccurrenceUsageSnapshotSpecialization
437446
put(OccurrenceUsageImpl.class, "snapshot", "Occurrences::Occurrence::snapshots");
438-
447+
439448
//checkPartDefinitionSpecialization
440449
put(PartDefinitionImpl.class, "base", "Parts::Part");
441450
//checkPartUsageSpecialization
@@ -556,6 +565,20 @@ protected ImplicitGeneralizationMap() {
556565
//checkViewpointUsageViewpointSatisfactionSpecialization
557566
put(ViewpointUsageImpl.class, "satisfied", "Views::View::viewpointSatisfactions");
558567

568+
/*
569+
* TODO: ST6RI-843
570+
*
571+
* checkViewpointDefinitionSpecialization
572+
* specializesFromLibrary('Views::Viewpoint')
573+
*
574+
* TODO: ST6RI-843
575+
*
576+
* checkViewpointUsageSpecialization
577+
* specializesFromLibrary('Views::viewpoints')
578+
*
579+
* OCL doesn't match with the implementation
580+
*/
581+
559582
//checkWhileLoopActionUsageSpecialization
560583
put(WhileLoopActionUsageImpl.class, "base", "Actions::whileLoopActions");
561584
//checkWhileLoopActionUsageSubactionSpecialization

0 commit comments

Comments
 (0)