Jiawei recently asked a question regarding extra columns in the FMEA table.
Jiawei, please describe what you are seeking for.
Happy Scripting
Jan
Hi Jiawei,
just to understand, have you already disabled the option "Hide measure groups" in FMEA front page
and checked the new columns appearing in the table?
Isn't hat what you are looking for?
Hi, Jan,
in the standard FMEA, the measure group is aimed to failure causes, but this measure group is not my need.
I am looking for the measure linked with the potential failure of FMEA:
the potential failure of current FMEA may be failure cause in the upper level FMEA, that there may be measures derived.
am I clear?
Crystal clear now :-)
Dear Jan,
Is there any progress for this topic?
Sorry Jiawei,
I totally forgot to post the answer. Well, I think that should be very simple.
Just add a derived property to "Failure Entry" and the script should look like:
self.element.allSafetyMechanisms
That adds a column to the failure:
Note that the script should be the same for OCL and JS.
Do you mean "Failure(derived FMEA only)"? because I did not find a "Failure Entry" in FMEA Worksheet.
In my added column, nothing showed:
Yes, I meant this type ("Failure(derived FMEA only)").
Hm, maybe I missed the point. Let me check... I'll come back soon.
Well, I mixed FMEA and FMEDA, sorry. So that should be then:
self.element.oclAsType(safetyModel::FailureMode).measureGroups.detectionMeasures
Note that I used OCL here because now its much easier to access list of lists.
Can I show both detectionMeasures and preventionMeasures together?
For that purpose, OCL has a nice "union" function to combine two collections, so please try:
self.element.oclAsType(safetyModel::FailureMode).measureGroups.detectionMeasures->union( self.element.oclAsType(safetyModel::FailureMode).measureGroups.preventionMeasures)
sometimes the potential failure is a "FailureMode", and sometimes it is a "Malfunction".
How to update the script to show both's Measures?
"Union" function seems not work in this situation:
self.element.oclAsType(safetyModel::FailureMode).measureGroups.preventionMeasures->union( self.element.oclAsType(safetyModel::FailureMode).measureGroups.detectionMeasures)->union( self.element.oclAsType(safetyModel::Malfunction).measureGroups.preventionMeasures)->union( self.element.oclAsType(safetyModel::Malfunction).measureGroups.detectionMeasures)
Hello, Jan,
Is it because of (Failure Mode & Malfunction) are two different element types?
Should "if else" be used in the script?
yes, its because they are of different type. Luckily they have the same base class AND the "measureGroup" is defined there, not in FailureMode.
So please rewrite to:
self.element.oclAsType(safetyModel::Failure).measureGroups.detectionMeasures->union( self.element.oclAsType(safetyModel::Failure).measureGroups.preventionMeasures)
Thank you for your nice scripts, it works!
I think I need to be more faimilar with medini metal model and OCL,
do you have some user guide or recommand website for OCL learning?
Jiawei
Hi Jiawei, glad it works.
or OCL I will create a separate article with links and docs.
Please mark as "answered" later here.
I used this topic as inspiration to create a Profile Property to be used in MSR FMEA or maybe any other FMEA in which it is required to define Measures not only for Causes, but also Failures and Effects.
The below snippet reads out a unique list of
the below snippet works for a Profile Property of "Failure (derived FMEA)"
self.element.oclAsType(safetyModel::Failure).measureGroups.detectionMeasures->union( self.element.oclAsType(safetyModel::Failure).measureGroups.preventionMeasures)->asSet()->union( self.element.oclAsType(safetyModel::Failure).causedBy.measureGroups.detectionMeasures)->asSet()->union( self.element.oclAsType(safetyModel::Failure).causedBy.measureGroups.preventionMeasures)->asSet()
Nice, thanks Nino for sharing.
Others may notice the need to convert some OCL results into a set to get it working. Reason is that each collection construct in OCL (Set, Bag, Sequence)
has its own definition of union() which only works with collections of the *same* type. The last call to asSet() is to eliminate duplicates.