Hi eyeryone,
I‘m looking for a way to display the guide word in FMEA worksheet.
Is there any script could achieve this?
Thanks a lot~
more detail see the attach files.
Hi,
Note that the script I've give above is OCL (easier to handle multiple elements in one line), not Javascript. You'll need to create a new derived property and make sure "OCL" is set as language.
And directly for a "Failure (derived FMEA)" it needs to be
self.element.oclAsType(safetyModel::Malfunction).mediniGetOpposites('value').oclAsType(hazop::GuidewordToFailuresMapEntry).key.oclAsType(hazop::Guideword).name
Hi Qianqian Liang,
You can find this out by looking at the attributes of a guideword analysis entry - there you see guidewordToFailures entries (see 2nd screenshot), which holds the Malfunction in "value".
Therefor for the malfunction itself, you can access the guideword(s) like this:
self.mediniGetOpposites('value')
It creates a list of guideword(s) - clicking on them comes up with an error, as one cannot follow the link to anything visible in the model browser. To avoid the link you can further navigate to the actual names only:
self.mediniGetOpposites('value').oclAsType(hazop::GuidewordToFailuresMapEntry).key.oclAsType(hazop::Guideword).name
Based on this for the malfunction, try using this for the element in the FMEA you like (navigate to the malfunction and then apply the above).
Happy scripting,
Nils
Hi Nils Heuermann,
It seems doesn't work. medini version 2021 R2
Thanks for your time~
Yes, that works - a similar profile property is already available in the BestPractice for Malfunctions since quite a while.
Eckhardt
Hi Nils,
It works, thank you very much~
Qianqian
Dear All
On our side we want also to add guidewords in FMEA but we have Malfunctions and Failure modes. We need to have this
self.element.oclAsType(safetyModel::Malfunction).mediniGetOpposites('value').oclAsType(hazop::GuidewordToFailuresMapEntry).key.oclAsType(hazop::Guideword).nameself.element.oclAsType(safetyModel::FailureMode).mediniGetOpposites('value').oclAsType(hazop::GuidewordToFailuresMapEntry).key.oclAsType(hazop::Guideword).name
but it not works
how to merge ?
Thank you for your help
Hello Philippe,
I suppose this shall be a profile property of FMEA-Failure? In that case the following OCL should do it:
self.element.oclAsType(safetyModel::CauseEffect).mediniGetOpposites('value')
Perfects
it works
Thanks
Philippe