Hi Jan,
I am looking for a solution, which displays me all safe states of all safety goals linked to a requirement.
The script shall look for all traced safety-goals and then get the safe state (and FTTI later on).
thanks,
Sven
A final statement on this part: it seems that indeed in 2019 R3 there is an issue with mediniGetOpposites navigating custom or domain references.
For example: the expression:
self.mediniGetOpposites('ISO26262_safetyGoal').oclAsType(hazard::HazardousEvent).id
works fine in 20.1 but not in 19.5. The reason is difficult to explain but I propose to rewrite such statements to Java Script for 19.5 like:
finder.findByType(Metamodel.hazard.HazardousEvent).filter(function (he) { return he.ISO26262_safetyGoal == self;}).asArray();
If you have further questions, don't hesitate to put them here.
Jan
Hi Sven,
in OCL that should be pretty much straight forward;
self.contributedGoals.safeState
Happy Scripting
ok, Thanks A lot. The second Thing is: how can a Access a profile property? (FTTI) of the safety Goal?
I was wrong in the first place, sorry, the goal does not have a native FTTI property,
though the ESL example and the best practices template have a custom property "fault_tolerant_time_level".
So with 2020 R1 you could write:
self.contributedGoals.user_fault_tolerant_time_level
with 2019 R3 it would be something like:
self.contributedGoals.getProfilePropertyValue('fault_tolerant_time_level')
How can a show all linked Hazardous events to a safety goal? (In the Safety-Goal List editor)
Here you have to use "mediniGetOpposites", to
self.mediniGetOpposites("safetyGoal")// or since 2019 RXself.mediniGetOpposites("ISO26262_safetyGoal")
I receive the error:
Can not evaluate script:
I found the error. I should use '' instead of "".
But: my result Looks like that:
but I want a result like: "HR001: Name vom Hazard"
Sven, please try something like:
self.mediniGetOpposites("ISO26262_safetyGoal").name
or
let a : hazard::HazardousEvent = self.mediniGetOpposites("ISO26262_safetyGoal")in a.id + ' ' + a.name
Seems like the "to string" method for events is not what you expect.
Actually, I have the same question. I want to link all hazardous events which reference the goal (In the Safety-Goal List editor). And I try this script (medini 2020 R1) but this script doesn't work.
Best regards,
NIAZI
Well, actually I posted the code without testing it sorry, especially not for R1.
There are several mistakes in here, first of all the usage of " instead of '
Anyway, for some reasons I have troubles myself with 2019 R1 so I need to check myself what's going on.
Stay tuned