Multiple validation rules across several profiles have been refactored from OCL2.0 scripting language to Java for the 2022x Refresh2 version of the modeling tool. Because of this, the refactored rules do not work with server projects committed with the 2022x Refresh2 version and opened with either the 2022x or 2022x Refresh1 version of the tool (i.e., even if there is an error in the project violating an affected validation rule, you will receive a successful validation notification).
To resolve this, you can:
- Download the OCL2.0 Validation Rules.mdzip file and use it in or copy it to your project to validate it. The attached project contains the "OCL2.0 Validation Rules [2022x-2022x Refresh1]" package, which includes all of the affected validation rules in OCL2.0 language.
- Recreate needed OCL2.0-based validation rules using the scripts provided in the table below.
See the table below of the refactored validation rules:
Name | Severity | Profile | Constrained Element | OCL2.0 Script |
---|---|---|---|---|
Mandatory Tagged Value | warning | UML Standard Profile::Validation Profile::UML completeness constraints::Mandatory Tagged Value | Element | self.appliedStereotype->forAll(c| c.member->forAll(f|f.oclIsKindOf(Property) implies (let sf:Property = f.oclAsType(Property) in (not sf.lowerValue.oclIsUndefined()) and (sf.lower >= 1) and (sf.opposite.oclIsUndefined() or not sf.opposite.oclIsKindOf(ExtensionEnd)) implies self.taggedValue->exists(tv|tv.tagDefinition=sf and tv.value()->size()>=sf.lower) ) ) ) |
Multiple Tagged Values | warning | UML Standard Profile::Validation Profile::UML completeness constraints::Multiple Tagged Values | TaggedValue | self.tagDefinition.owner.oclIsTypeOf(Stereotype) and (self.tagDefinition.upper = 1) implies (self.value()->size()<=1) |
Tags multiplicity 2 | warning | UML Standard Profile::Validation Profile::UML completeness constraints::Tags multiplicity 2 | TaggedValue | self.tagDefinition.owner.oclIsTypeOf(Stereotype) implies (self.tagDefinition.lower <= self.value()->size()) |
Slot multiplicity 2 | warning | UML Standard Profile::Validation Profile::UML completeness constraints::Slot multiplicity 2 | Slot | let A:Association=self.definingFeature.oclAsType(Property).association in (A.oclIsUndefined() or not self.owningInstance.classifier->includes(A)) and not self.definingFeature.owner.oclIsTypeOf(Stereotype) implies (self.definingFeature.upper=-1) or (self.definingFeature.lower <= self.value->size()) |
Multiple Slot Values | warning | UML Standard Profile::Validation Profile::UML completeness constraints::Multiple Slot Values | Slot | (not self.definingFeature.owner.oclIsTypeOf(Stereotype)) and (self.definingFeature.upper = 1) implies (self.value->size()<=1) |
Link slot multiplicity | warning | UML Standard Profile::Validation Profile::UML completeness constraints::Link slot multiplicity | Slot | let A:Association=self.definingFeature.oclAsType(Property).association in (not A.oclIsUndefined() and self.owningInstance.classifier->includes(A)) implies self.value->size()=1 |
No Activity Incoming Edge | warning | UML Standard Profile::Validation Profile::UML completeness constraints::No Activity Incoming Edge | ActivityNode | ((not appliedStereotype->exists(name='startEvent')) and (not appliedStereotype->exists(name='messageStartEvent')) and (not appliedStereotype->exists(name='ruleStartEvent')) and (not appliedStereotype->exists(name='multipleStartEvent')) and (not appliedStereotype->exists(name='timerStartEvent')) and (not appliedStereotype->exists(name='linkStartEvent')) and (not appliedStereotype->exists(name='intermediateEvent')) and (not appliedStereotype->exists(name='multipleIntermediateEvent')) and (not appliedStereotype->exists(name='cancelIntermediateEvent')) and (not appliedStereotype->exists(name='compensationIntermediateEvent')) and (not appliedStereotype->exists(name='compensationIntermediateEvent')) and (not appliedStereotype->exists(name='messageIntermediateEvent')) and (not appliedStereotype->exists(name='ruleIntermediateEvent')) and (not appliedStereotype->exists(name='errorIntermediateEvent')) and (not appliedStereotype->exists(name='timerIntermediateEvent')) and (not appliedStereotype->exists(name='gateway')) and (not appliedStereotype->exists(name='eventBasedXOR')) and (not appliedStereotype->exists(name='aND')) and (not appliedStereotype->exists(name='oR')) and (not appliedStereotype->exists(name='complex')) and (not appliedStereotype->exists(name='dataBasedXOR')) and (not appliedStereotype->exists(name='endEvent')) and (not appliedStereotype->exists(name='cancelEndEvent')) and (not appliedStereotype->exists(name='linkEndEvent')) and (not appliedStereotype->exists(name='messageEndEvent')) and (not appliedStereotype->exists(name='compensationEndEvent')) and (not appliedStereotype->exists(name='terminateEndEvent')) and (not appliedStereotype->exists(name='errorEndEvent')) and (not appliedStereotype->exists(name='task')) and (not appliedStereotype->exists(name='sendTask')) and (not appliedStereotype->exists(name='scriptTask')) and (not appliedStereotype->exists(name='userTask')) and (not appliedStereotype->exists(name='referenceTask')) and (not appliedStereotype->exists(name='receiveTask')) and (not appliedStereotype->exists(name='serviceTask')) and (not appliedStereotype->exists(name='manualTask')) and (not appliedStereotype->exists(name='usddsderTask')) and (not appliedStereotype->exists(name='multiInstanceLoop')) and (not appliedStereotype->exists(name='standardLoop')) and (not appliedStereotype->exists(name='subProcess')) and (not appliedStereotype->exists(name='collapsedSubProcess')) and (not appliedStereotype->exists(name='adHoc')) and (not appliedStereotype->exists(name='compensation')) and not (self.oclIsKindOf(InitialNode) or self.oclIsKindOf(ActivityParameterNode) or self.oclIsKindOf(AcceptEventAction) or self.oclIsKindOf(OutputPin) or self.oclIsKindOf(SendSignalAction))) implies (incoming->notEmpty() or self.oclIsKindOf(Action) and self.oclAsType(Action).input->notEmpty() or self.oclIsKindOf(ObjectNode) and self.oclAsType(ObjectNode)._exceptionHandlerOfExceptionInput->notEmpty()) |
No Activity Outgoing Edge | warning | UML Standard Profile::Validation Profile::UML completeness constraints::No Activity Outgoing Edge | ActivityNode | ((not appliedStereotype->exists(name='startEvent')) and (not appliedStereotype->exists(name='messageStartEvent')) and (not appliedStereotype->exists(name='ruleStartEvent')) and (not appliedStereotype->exists(name='multipleStartEvent')) and (not appliedStereotype->exists(name='timerStartEvent')) and (not appliedStereotype->exists(name='linkStartEvent')) and (not appliedStereotype->exists(name='intermediateEvent')) and (not appliedStereotype->exists(name='multipleIntermediateEvent')) and (not appliedStereotype->exists(name='cancelIntermediateEvent')) and (not appliedStereotype->exists(name='compensationIntermediateEvent')) and (not appliedStereotype->exists(name='compensationIntermediateEvent')) and (not appliedStereotype->exists(name='messageIntermediateEvent')) and (not appliedStereotype->exists(name='ruleIntermediateEvent')) and (not appliedStereotype->exists(name='errorIntermediateEvent')) and (not appliedStereotype->exists(name='timerIntermediateEvent')) and (not appliedStereotype->exists(name='gateway')) and (not appliedStereotype->exists(name='eventBasedXOR')) and (not appliedStereotype->exists(name='aND')) and (not appliedStereotype->exists(name='oR')) and (not appliedStereotype->exists(name='complex')) and (not appliedStereotype->exists(name='dataBasedXOR')) and (not appliedStereotype->exists(name='endEvent')) and (not appliedStereotype->exists(name='cancelEndEvent')) and (not appliedStereotype->exists(name='linkEndEvent')) and (not appliedStereotype->exists(name='messageEndEvent')) and (not appliedStereotype->exists(name='compensationEndEvent')) and (not appliedStereotype->exists(name='terminateEndEvent')) and (not appliedStereotype->exists(name='errorEndEvent')) and (not appliedStereotype->exists(name='task')) and (not appliedStereotype->exists(name='sendTask')) and (not appliedStereotype->exists(name='scriptTask')) and (not appliedStereotype->exists(name='userTask')) and (not appliedStereotype->exists(name='referenceTask')) and (not appliedStereotype->exists(name='receiveTask')) and (not appliedStereotype->exists(name='serviceTask')) and (not appliedStereotype->exists(name='manualTask')) and (not appliedStereotype->exists(name='usddsderTask')) and (not appliedStereotype->exists(name='multiInstanceLoop')) and (not appliedStereotype->exists(name='standardLoop')) and (not appliedStereotype->exists(name='subProcess')) and (not appliedStereotype->exists(name='collapsedSubProcess')) and (not appliedStereotype->exists(name='adHoc')) and (not appliedStereotype->exists(name='compensation')) and not (self.oclIsKindOf(FinalNode) or self.oclIsKindOf(ActivityParameterNode) or self.oclIsKindOf(InputPin) or self.oclIsKindOf(SendSignalAction) or self.oclIsKindOf(AcceptEventAction))) implies (outgoing->notEmpty() or self.oclIsKindOf(ExecutableNode) and self.oclAsType(ExecutableNode).handler->notEmpty() or self.oclIsKindOf(Action) and self.oclAsType(Action).output->notEmpty()) |
Lower Multiplicity Value to High | error | UML Standard Profile::Validation Profile::UML correctness constraints::Lower Multiplicity Value to High | MultiplicityElement | ((not lowerValue.oclIsUndefined()) and (not upperValue.oclIsUndefined())) implies ((lower <= upper) or (upper = -1)) |
Tag type restrictions | error | UML Standard Profile::Validation Profile::UML correctness constraints::Tag type restrictions | Property | (self.oclIsTypeOf(Property) and not type.oclIsUndefined() and type.oclIsKindOf(Stereotype)) implies (self.aggregation <> AggregationKind::composite) |
Multiple Compositions | error | UML Standard Profile::Validation Profile::UML correctness constraints::Multiple Compositions | Classifier | let atr: Set(Property) = attribute->select (a | not a.opposite.oclIsUndefined() and a.opposite.isComposite)->asSet() in atr -> exists( n | not n.lowerValue.oclIsUndefined() and n.lower = 1) implies atr -> size() = 1 |
Abstract Leaf | error | UML Standard Profile::Validation Profile::UML correctness constraints::Abstract Leaf | Classifier | isLeaf implies not isAbstract |
No Classifier for Instance | error | UML Standard Profile::Validation Profile::UML completeness constraints::No Classifier for Instance | InstanceSpecification | (not self.oclIsKindOf(EnumerationLiteral)) implies classifier->notEmpty() |
Nameless Class | error | UML Standard Profile::Validation Profile::UML completeness constraints::Nameless Class | Class | name <> '' |
Not Query Datatype Operation | error | UML Standard Profile::Validation Profile::UML correctness constraints::Not Query Datatype Operation | DataType | ownedOperation->forAll(o|o.isQuery = true) |
No Operation for Call Message | error | UML Standard Profile::Validation Profile::UML completeness constraints::No Operation for Call Message | Message | self.messageSort=MessageSort::synchCall implies (not self.signature.oclIsUndefined() and self.signature.oclIsKindOf(Operation)) |
Call from Foreign Classifier | warning | UML Standard Profile::Validation Profile::UML correctness constraints::Call from Foreign Classifier | Message | let sourceLifeline:Lifeline = self.sendEvent.oclAsType(MessageOccurrenceSpecification).covered->any(true) in let targetLifeline:Lifeline = self.receiveEvent.oclAsType(MessageOccurrenceSpecification).covered->any(true) in (sourceLifeline <> targetLifeline) implies (let sourceType:Type = sourceLifeline.represents.type in let targetOperation:Operation = self.signature.oclAsType(Operation) in (not sourceType.oclIsUndefined() and not targetOperation.oclIsUndefined()) implies ((targetOperation.visibility <> VisibilityKind::private) or (targetOperation.UMLClass = sourceType))) |
No Incoming Transitions | warning | UML Standard Profile::Validation Profile::UML completeness constraints::No Incoming Transitions | Vertex | let k : PseudostateKind = self.oclAsType(Pseudostate).kind in (((self.oclIsKindOf(State) and self.oclAsType(State).submachine.oclIsUndefined() and self.oclAsType(State).region->isEmpty() or self.oclIsKindOf(Pseudostate) or self.oclIsKindOf(ConnectionPointReference)) and (not self.oclIsKindOf(ConnectionPointReference)) and (k.oclIsUndefined() or not (k=PseudostateKind::initial or k=PseudostateKind::entryPoint or k=PseudostateKind::exitPoint)))) implies incoming->notEmpty() |
No Outgoing Transitions | warning | UML Standard Profile::Validation Profile::UML completeness constraints::No Outgoing Transitions | Vertex | ((self.oclIsKindOf(State) and self.oclAsType(State).submachine.oclIsUndefined() and self.oclAsType(State).region->isEmpty() and (not (self.oclIsKindOf(ConnectionPointReference) or self.oclIsKindOf(FinalState) or (self.oclIsKindOf(Pseudostate) and (self.oclAsType(Pseudostate).kind=PseudostateKind::exitPoint or self.oclAsType(Pseudostate).kind=PseudostateKind::entryPoint or self.oclAsType(Pseudostate).kind=PseudostateKind::terminate or self.oclAsType(Pseudostate).kind=PseudostateKind::deepHistory or self.oclAsType(Pseudostate).kind=PseudostateKind::shallowHistory))))) implies outgoing->notEmpty() |
Multiple Constrained Element | error | UML Standard Profile::Validation Profile::UML correctness constraints::Multiple Constrained Element | OpaqueExpression | (language->exists(lng:String|lng='OCL2.0') and not owningConstraint.oclIsUndefined()) implies owningConstraint.constrainedElement->size()=1 |
Guard on decision | warning | UML Standard Profile::Validation Profile::UML completeness constraints::Guard on decision | ActivityEdge | source.oclIsKindOf(DecisionNode) implies not guard.oclIsUndefined() |
Covered Lifelines | warning | UML Standard Profile::Validation Profile::UML correctness constraints::Covered Lifelines | InteractionUse | let coveredSize : Integer = covered->size() in if refersTo.oclIsUndefined() then coveredSize = 0 else refersTo.lifeline->size() = coveredSize endif |
State of State Invariant | error | UML Standard Profile::Validation Profile::UML correctness constraints::State of State Invariant | StateInvariant | let lifelineType:Type = self.covered->any(true).represents.type in let constraintBody:ValueSpecification = self.invariant.specification in constraintBody.oclIsKindOf(ElementValue) implies (let stateType:Classifier = constraintBody.oclAsType(ElementValue).element.oclAsType(State).redefinitionContext->any(true) in stateType = lifelineType) |
Wrong Maximum Composite Multiplicity | error | UML Standard Profile::Validation Profile::UML correctness constraints::Wrong Maximum Composite Multiplicity | Property | let oppose:Property = association.memberEnd->any(p|p <> self) in implies (upper = 1) |
Flows on decision | warning | UML Standard Profile::Validation Profile::UML completeness constraints::Flows on decision | DecisionNode | outgoing->size()>1 |
No Stereotype Metaclass | error | UML Standard Profile::Validation Profile::UML completeness constraints::No Stereotype Metaclass | Stereotype | self.encoded5FextensionEndOfType->notEmpty() or (self.generalization->notEmpty()) |
Method for Abstract Operation is Defined | error | UML Standard Profile::Validation Profile::UML correctness constraints::Method for Abstract Operation is Defined | Operation | isAbstract implies method->isEmpty() |
Nameless Operation | error | UML Standard Profile::Validation Profile::UML completeness constraints::Nameless Operation | Operation | name <> '' |
Metamodel Reference | warning | UML Standard Profile::Validation Profile::UML completeness constraints::Metamodel Reference | Profile | metamodelReference->size()>0 |
Nameless Actor | error | UML Standard Profile::Validation Profile::UML completeness constraints::Nameless Actor | Actor | name <> '' |
No Type for Parameter | error | UML Standard Profile::Validation Profile::UML completeness constraints::No Type for Parameter | Operation | ownedParameter->forAll(direction <> ParameterDirectionKind::return implies not type.oclIsUndefined()) |
Covered of State Invariant | error | UML Standard Profile::Validation Profile::UML correctness constraints::Covered of State Invariant | StateInvariant | self.covered->size()<=1 |
The reception should have the signal handling it | error | UML Standard Profile::Validation Profile::UML correctness constraints::The reception should have the signal handling it | Reception | not self.signal.oclIsUndefined() |
Actor and Usecase | info | UML Standard Profile::Validation Profile::UML completeness constraints::Actor and Usecase | Actor | encoded5FgeneralizationOfGeneral->isEmpty() implies (self.oclAsType(Type).encoded5FtypedElementOfType->exists(a|a.oclIsKindOf(Property) implies a.oclAsType(Property).opposite.type.oclIsKindOf(UseCase))) |
Nameless Attribute | info | UML Standard Profile::Validation Profile::UML completeness constraints::Nameless Attribute | Property | (association.oclIsUndefined() and (not owner.oclIsKindOf(Interaction))) implies name <> '' |
No Association Multiplicity | info | UML Standard Profile::Validation Profile::UML completeness constraints::No Association Multiplicity | Association | self.memberEnd ->forAll ( n | (not n.lowerValue.oclIsUndefined()) or (not n.upperValue.oclIsUndefined())) |
Invalid owned operation of Requirement | warning | MD Customization for SysML::SysML constraints::SysML ValSuite::SysML ValSuite - Requirements::Requirement::Invalid owned operation of Requirement | Requirement | ownedOperation->isEmpty() |
Invalid ReferenceProperty type | warning | MD Customization for SysML::SysML constraints::SysML ValSuite::SysML ValSuite - Blocks::ReferenceProperty::Invalid ReferenceProperty type | ReferenceProperty | self.oclIsTypeOf(MD_Customization_for_SysML::additional_stereotypes::ReferenceProperty) and (not self.type.oclIsUndefined()) implies self.type.oclIsKindOf(SysML::Blocks::Block) |
Invalid isControlType tag | warning | MD Customization for SysML::SysML constraints::SysML ValSuite::SysML ValSuite - Activities::ControlValue::Invalid isControlType tag | ObjectNode | (type.name='ControlValueKind' and not type.name.oclIsUndefined()) implies isControlType |
Invalid parameter type [Operation] | warning | MD Customization for SysML::SysML constraints::SysML ValSuite::SysML ValSuite - Activities::ControlOperator::Invalid parameter type [Operation] | Operation | self.oclIsTypeOf(SysML::Activities::ControlOperator) or self.ownedParameter->forAll(type.name<>'ControlValueKind' or type.oclIsUndefined()) |
Invalid Activity Edge source | warning | MD Customization for SysML::SysML constraints::SysML ValSuite::SysML ValSuite - Activities::Probability::Invalid Activity Edge source | Probability | self.oclIsKindOf(UML_Standard_Profile::UML2_Metamodel::ActivityEdge) implies self.oclAsType(UML_Standard_Profile::UML2_Metamodel::ActivityEdge).source.oclIsKindOf(UML_Standard_Profile::UML2_Metamodel::DecisionNode) or self.oclAsType(UML_Standard_Profile::UML2_Metamodel::ActivityEdge).source.oclIsKindOf(UML_Standard_Profile::UML2_Metamodel::ObjectNode) |
Invalid interface block inheritance | warning | MD Customization for SysML::SysML constraints::SysML ValSuite::SysML ValSuite - Ports and Flows::InterfaceBlock::Invalid interface block inheritance | InterfaceBlock | self.generalization->forAll(i | i.general.oclIsKindOf(InterfaceBlock)) |
Invalid Optional lower multiplicity | warning | MD Customization for SysML::SysML constraints::SysML ValSuite::SysML ValSuite - Activities::Optional::Invalid Optional lower multiplicity | Optional | not lower.oclIsUndefined() and lower = 0 |
Invalid owned attribute of Requirement | warning | MD Customization for SysML::SysML constraints::SysML ValSuite::SysML ValSuite - Requirements::Requirement::Invalid owned attribute of Requirement | Requirement | ownedAttribute->isEmpty() |
Invalid generalization of Requirement | warning | MD Customization for SysML::SysML constraints::SysML ValSuite::SysML ValSuite - Requirements::Requirement::Invalid generalization of Requirement | Generalization | (not general.oclIsKindOf(SysML::Requirements::Requirement)) and (not specific.oclIsKindOf(SysML::Requirements::Requirement)) |
Missing Probability stereotype | warning | MD Customization for SysML::SysML constraints::SysML ValSuite::SysML ValSuite - Activities::Probability::Missing Probability stereotype | ActivityEdge | self.source.outgoing->exists(oclIsKindOf(SysML::Activities::Probability)) implies self.oclIsKindOf(SysML::Activities::Probability) |
Invalid No Optional lower multiplicity | warning | MD Customization for SysML::SysML constraints::SysML ValSuite::SysML ValSuite - Activities::Optional::Invalid No Optional lower multiplicity | Optional Parameter | (not appliedStereotype->exists(name='Optional')) implies ((not lower.oclIsUndefined()) and lower > 0) |
Invalid SharedProperty type | warning | MD Customization for SysML::SysML constraints::SysML ValSuite::SysML ValSuite - Blocks::ShareProperty::Invalid SharedProperty type | SharedProperty | self.oclIsTypeOf(MD_Customization_for_SysML::additional_stereotypes::SharedProperty) and (not self.type.oclIsUndefined()) implies self.type.oclIsKindOf(SysML::Blocks::Block) |
Invalid source or target of DeriveReqt | warning | MD Customization for SysML::SysML constraints::SysML ValSuite::SysML ValSuite - Requirements::DeriveReqt::Invalid source or target of DeriveReqt | DeriveReqt | client->forAll(oclIsKindOf(SysML::Requirements::Requirement)) and supplier->forAll(oclIsKindOf(SysML::Requirements::Requirement)) |
Invalid parameter type [Behavior] | warning | MD Customization for SysML::SysML constraints::SysML ValSuite::SysML ValSuite - Activities::ControlOperator::Invalid parameter type [Behavior] | Behavior | self.oclIsTypeOf(SysML::Activities::ControlOperator) or self.ownedParameter->forAll(type.name<>'ControlValueKind' or type.oclIsUndefined()) |
Invalid isStream tag | warning | MD Customization for SysML::SysML constraints::SysML ValSuite::SysML ValSuite - Activities::Rate::Invalid isStream tag | Rate | self.oclIsKindOf(UML_Standard_Profile::UML2_Metamodel::Parameter) implies self.oclAsType(UML_Standard_Profile::UML2_Metamodel::Parameter).isStream |
Duplicated Associations | warning | UseCase Description Profile::Use Case domain constraints::Duplicated Associations | Association | let dub:Set(Association)= Association::allInstances()->select(a|a.endType->forAll(b|b.oclIsKindOf(UseCase) or b.oclIsKindOf(Actor))) in |