Hello all,
I was writing an OCL profile script to get the related Events from Failure Modes (self is the failure mode):
self.mediniGetOpposites('represents')->selectByType(FTA::Event)The above code sometimes returns duplicated events. Talking with Michele, from Support, he pointed out that the "duplicated" events were events coming from stored cutsets, and he was completely right.
The solution is simple: filtering the returned list above to get only those events associated with an FTA. Here's the code he suggested and that works:
self.mediniGetOpposites('represents')->selectByType(FTA::Event)->select(e:FTA::Event | e.mediniGetOpposites('analyzedEvents')->first().oclIsUndefined() )
I'm posting here in case any of you have the same problem as I had.
Thanks to Michele for the support and happy scripting!