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:

NameSeverityProfileConstrained ElementOCL2.0 Script
Mandatory Tagged Valuewarning

UML Standard Profile::Validation Profile::UML completeness constraints::Mandatory Tagged Value

Elementself.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 ValueswarningUML Standard Profile::Validation Profile::UML completeness constraints::Multiple Tagged ValuesTaggedValueself.tagDefinition.owner.oclIsTypeOf(Stereotype) and (self.tagDefinition.upper = 1) implies (self.value()->size()<=1)
Tags multiplicity 2warningUML Standard Profile::Validation Profile::UML completeness constraints::Tags multiplicity 2TaggedValueself.tagDefinition.owner.oclIsTypeOf(Stereotype) implies (self.tagDefinition.lower <= self.value()->size())
Slot multiplicity 2 warningUML Standard Profile::Validation Profile::UML completeness constraints::Slot multiplicity 2Slotlet 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 warningUML Standard Profile::Validation Profile::UML completeness constraints::Multiple Slot ValuesSlot(not self.definingFeature.owner.oclIsTypeOf(Stereotype)) and (self.definingFeature.upper = 1) implies (self.value->size()<=1)
Link slot multiplicity warningUML Standard Profile::Validation Profile::UML completeness constraints::Link slot multiplicitySlotlet 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 warningUML Standard Profile::Validation Profile::UML completeness constraints::No Activity Incoming EdgeActivityNode((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 warningUML Standard Profile::Validation Profile::UML completeness constraints::No Activity Outgoing EdgeActivityNode((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 errorUML Standard Profile::Validation Profile::UML correctness constraints::Lower Multiplicity Value to HighMultiplicityElement((not lowerValue.oclIsUndefined()) and (not upperValue.oclIsUndefined())) implies ((lower <= upper) or (upper = -1))
Tag type restrictions errorUML Standard Profile::Validation Profile::UML correctness constraints::Tag type restrictionsProperty(self.oclIsTypeOf(Property) and not type.oclIsUndefined() and type.oclIsKindOf(Stereotype)) implies (self.aggregation <> AggregationKind::composite)
Multiple Compositions errorUML Standard Profile::Validation Profile::UML correctness constraints::Multiple CompositionsClassifierlet 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 errorUML Standard Profile::Validation Profile::UML correctness constraints::Abstract LeafClassifierisLeaf implies not isAbstract
No Classifier for Instance errorUML Standard Profile::Validation Profile::UML completeness constraints::No Classifier for InstanceInstanceSpecification(not self.oclIsKindOf(EnumerationLiteral)) implies classifier->notEmpty()
Nameless ClasserrorUML Standard Profile::Validation Profile::UML completeness constraints::Nameless ClassClassname <> ''
Not Query Datatype OperationerrorUML Standard Profile::Validation Profile::UML correctness constraints::Not Query Datatype OperationDataTypeownedOperation->forAll(o|o.isQuery = true)
No Operation for Call MessageerrorUML Standard Profile::Validation Profile::UML completeness constraints::No Operation for Call MessageMessageself.messageSort=MessageSort::synchCall implies (not self.signature.oclIsUndefined() and self.signature.oclIsKindOf(Operation))
Call from Foreign ClassifierwarningUML Standard Profile::Validation Profile::UML correctness constraints::Call from Foreign ClassifierMessagelet 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 TransitionswarningUML Standard Profile::Validation Profile::UML completeness constraints::No Incoming TransitionsVertexlet 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

warningUML Standard Profile::Validation Profile::UML completeness constraints::No Outgoing TransitionsVertex

((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) 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 ElementerrorUML Standard Profile::Validation Profile::UML correctness constraints::Multiple Constrained ElementOpaqueExpression(language->exists(lng:String|lng='OCL2.0') and not owningConstraint.oclIsUndefined())  implies owningConstraint.constrainedElement->size()=1
Guard on decisionwarningUML Standard Profile::Validation Profile::UML completeness constraints::Guard on decisionActivityEdgesource.oclIsKindOf(DecisionNode) implies not guard.oclIsUndefined()
Covered LifelineswarningUML Standard Profile::Validation Profile::UML correctness constraints::Covered LifelinesInteractionUselet coveredSize : Integer = covered->size() in
if refersTo.oclIsUndefined() then 
coveredSize = 0
else
refersTo.lifeline->size() = coveredSize
endif

State of State Invariant

errorUML Standard Profile::Validation Profile::UML correctness constraints::State of State InvariantStateInvariantlet 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 errorUML Standard Profile::Validation Profile::UML correctness constraints::Wrong Maximum Composite Multiplicity Property

let oppose:Property =  association.memberEnd->any(p|p <> self) in
(not oppose.oclIsUndefined()
and oppose.isComposite
and not upperValue.oclIsUndefined())

implies (upper = 1)

Flows on decisionwarningUML Standard Profile::Validation Profile::UML completeness constraints::Flows on decisionDecisionNodeoutgoing->size()>1
No Stereotype MetaclasserrorUML Standard Profile::Validation Profile::UML completeness constraints::No Stereotype MetaclassStereotypeself.encoded5FextensionEndOfType->notEmpty() or
(self.generalization->notEmpty())
Method for Abstract Operation is DefinederrorUML Standard Profile::Validation Profile::UML correctness constraints::Method for Abstract Operation is DefinedOperationisAbstract implies method->isEmpty()
Nameless OperationerrorUML Standard Profile::Validation Profile::UML completeness constraints::Nameless OperationOperationname <> ''
Metamodel ReferencewarningUML Standard Profile::Validation Profile::UML completeness constraints::Metamodel ReferenceProfilemetamodelReference->size()>0
Nameless ActorerrorUML Standard Profile::Validation Profile::UML completeness constraints::Nameless ActorActorname <> ''
No Type for ParametererrorUML Standard Profile::Validation Profile::UML completeness constraints::No Type for ParameterOperationownedParameter->forAll(direction <> ParameterDirectionKind::return implies not type.oclIsUndefined())
Covered of State InvarianterrorUML Standard Profile::Validation Profile::UML correctness constraints::Covered of State InvariantStateInvariantself.covered->size()<=1
The reception should have the signal handling iterrorUML Standard Profile::Validation Profile::UML correctness constraints::The reception should have the signal handling itReceptionnot self.signal.oclIsUndefined()
Actor and UsecaseinfoUML Standard Profile::Validation Profile::UML completeness constraints::Actor and UsecaseActorencoded5FgeneralizationOfGeneral->isEmpty()
implies
(self.oclAsType(Type).encoded5FtypedElementOfType->exists(a|a.oclIsKindOf(Property) implies a.oclAsType(Property).opposite.type.oclIsKindOf(UseCase)))
Nameless AttributeinfoUML Standard Profile::Validation Profile::UML completeness constraints::Nameless AttributeProperty(association.oclIsUndefined() and (not owner.oclIsKindOf(Interaction))) implies name <> ''
No Association MultiplicityinfoUML Standard Profile::Validation Profile::UML completeness constraints::No Association MultiplicityAssociationself.memberEnd ->forAll ( n | (not n.lowerValue.oclIsUndefined()) or (not n.upperValue.oclIsUndefined()))
Invalid owned operation of RequirementwarningMD Customization for SysML::SysML constraints::SysML ValSuite::SysML ValSuite - Requirements::Requirement::Invalid owned operation of RequirementRequirementownedOperation->isEmpty()
Invalid ReferenceProperty typewarningMD Customization for SysML::SysML constraints::SysML ValSuite::SysML ValSuite - Blocks::ReferenceProperty::Invalid ReferenceProperty typeReferencePropertyself.oclIsTypeOf(MD_Customization_for_SysML::additional_stereotypes::ReferenceProperty) and (not self.type.oclIsUndefined()) implies self.type.oclIsKindOf(SysML::Blocks::Block)
Invalid isControlType tagwarningMD Customization for SysML::SysML constraints::SysML ValSuite::SysML ValSuite - Activities::ControlValue::Invalid isControlType tagObjectNode(type.name='ControlValueKind' and not type.name.oclIsUndefined()) implies isControlType
Invalid parameter type [Operation]warningMD Customization for SysML::SysML constraints::SysML ValSuite::SysML ValSuite - Activities::ControlOperator::Invalid parameter type [Operation]Operationself.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 sourceProbabilityself.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 inheritancewarningMD Customization for SysML::SysML constraints::SysML ValSuite::SysML ValSuite - Ports and Flows::InterfaceBlock::Invalid interface block inheritanceInterfaceBlockself.generalization->forAll(i | i.general.oclIsKindOf(InterfaceBlock))
Invalid Optional lower multiplicitywarningMD Customization for SysML::SysML constraints::SysML ValSuite::SysML ValSuite - Activities::Optional::Invalid Optional lower multiplicityOptionalnot lower.oclIsUndefined() and lower = 0
Invalid owned attribute of RequirementwarningMD Customization for SysML::SysML constraints::SysML ValSuite::SysML ValSuite - Requirements::Requirement::Invalid owned attribute of RequirementRequirementownedAttribute->isEmpty()
Invalid generalization of RequirementwarningMD Customization for SysML::SysML constraints::SysML ValSuite::SysML ValSuite - Requirements::Requirement::Invalid generalization of RequirementGeneralization(not general.oclIsKindOf(SysML::Requirements::Requirement)) and (not specific.oclIsKindOf(SysML::Requirements::Requirement))
Missing Probability stereotypewarningMD Customization for SysML::SysML constraints::SysML ValSuite::SysML ValSuite - Activities::Probability::Missing Probability stereotypeActivityEdgeself.source.outgoing->exists(oclIsKindOf(SysML::Activities::Probability)) implies self.oclIsKindOf(SysML::Activities::Probability)
Invalid No Optional lower multiplicitywarningMD Customization for SysML::SysML constraints::SysML ValSuite::SysML ValSuite - Activities::Optional::Invalid No Optional lower multiplicityOptional
Parameter
(not appliedStereotype->exists(name='Optional')) implies ((not lower.oclIsUndefined()) and lower > 0)
Invalid SharedProperty typewarningMD Customization for SysML::SysML constraints::SysML ValSuite::SysML ValSuite - Blocks::ShareProperty::Invalid SharedProperty typeSharedPropertyself.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 DeriveReqtwarningMD Customization for SysML::SysML constraints::SysML ValSuite::SysML ValSuite - Requirements::DeriveReqt::Invalid source or target of DeriveReqtDeriveReqtclient->forAll(oclIsKindOf(SysML::Requirements::Requirement)) and supplier->forAll(oclIsKindOf(SysML::Requirements::Requirement))
Invalid parameter type [Behavior]warningMD Customization for SysML::SysML constraints::SysML ValSuite::SysML ValSuite - Activities::ControlOperator::Invalid parameter type [Behavior]Behaviorself.oclIsTypeOf(SysML::Activities::ControlOperator) or
self.ownedParameter->forAll(type.name<>'ControlValueKind' or type.oclIsUndefined())
Invalid isStream tagwarningMD Customization for SysML::SysML constraints::SysML ValSuite::SysML ValSuite - Activities::Rate::Invalid isStream tagRateself.oclIsKindOf(UML_Standard_Profile::UML2_Metamodel::Parameter) implies self.oclAsType(UML_Standard_Profile::UML2_Metamodel::Parameter).isStream
Duplicated AssociationswarningUseCase Description Profile::Use Case domain constraints::Duplicated AssociationsAssociation

let dub:Set(Association)= Association::allInstances()->select(a|a.endType->forAll(b|b.oclIsKindOf(UseCase) or b.oclIsKindOf(Actor))) in
dub->forAll(d|
    (self <> d and self.endType->size()=2 and d.endType->size()=2) implies
        not (self.endType->asSet()->union(d.endType->asSet())->size()=2))