I would like to display one Safety Requirement in HARA which shall be choosen from a list of Safety Requirements which are linked to the related Safety Goal and need the script for doing this...
Hi Andreas, I did not get all of the idea but the first step probably would be a script for the HARA entry (aka HazardousEvent) like:
-- I suggest OCL hereself.ISO26262_safetyGoal.mediniGetTracedElements(safetygoals::SafetyRequirement).oclAsType(safetygoals::SafetyRequirement).name
Hope that gives you a start
Jan
Hi Andreas, welcome to the forum!
Mixing selection dialogs and (derived) scripting is not directly possible in medini (see also this discussion).
There are reference profile properties, which allow you to pre-define the selection type (Requirement) and if single/multiple references are accepted, and then you get a selection dialog when double-clicking the property in the tables/properties - but this is not filtered any further, so you see all requirements.
A derived profile property script cannot modify the model, so that doesn't help for selection dialogs. Instead it could show you requirements based on logic, e.g. all linked ones (see Jan's script example above), or even further filtered based on existing information in the model.
What do you plan to select your requirement on, which criteria? Is this some logic, which could be implemented into the derived property script, or can information be inserted into another property and then read by the derived property script?
Regards,
Nils
Hi Andreas,
Just one additional note: Jan's OCL assumes that you use a trace to link a requirement to a safety goal. However, typically you would use a Contribution-relation in the safety goals editor to model this. in that case the OCL may need to be a little more complex:
-- OCLself.ISO26262_safetyGoal.targetRelations->select(rel| rel.oclIsKindOf(safetygoals::SafetyReqRelation) and (rel.oclAsType(safetygoals::SafetyReqRelation).kind = safetygoals::SafetyReqRelationKind::UNSPECIFIED ))->collect(rel| rel.source)
Best regards,
Eckhardt
Thank you Nils for the explanation. Unfortunately there is no logic behind which could be implemented...
I assume the solution could be a two step approach. First derive all SR to the SG and then select one SR out of this list...
BR
Andreas
Thank you, Eckhard and Jan,
this is a good startin point. Now I have all Safety Requirements for the Safety Goal available. I would like to select in a new row now exactly one out of this list which is adressing the HE I am working on. Any ideas?
Hello Andreas,
as Nils already wrote, mixing of reference properties and derived properties is not possible and also you can not influence/filter the list of elements shown in a selection dialog (except by type) - it will always show all elements in your project of the type of the reference.
However, if it mainly important to see the appropriate requirements in the HARA table you may use the following strategy:
self.ISO26262_safetyGoal.targetRelations->select(rel| rel.oclIsKindOf(safetygoals::SafetyReqRelation) and (rel.oclAsType(safetygoals::SafetyReqRelation).kind = safetygoals::SafetyReqRelationKind::UNSPECIFIED )) ->collect(rel| rel.source)->select(req|req.mediniTags->includes(self.id))
As result only those requirements which are tagged with the HE ID and which do contribute to the SG of the HE are shown in the HARA table.
Hello again,
sorry for the late reply, I had to do "more important" stuff...
I understood that it would not be possible in a one step approach. I was able to get all requirements linke dto a Safety Goal into one row:
Would this be possible?
Our selection dialogs cannot use information from other properties as a pre-filter.
So the best solution would be to search the found entries (manually type in the IDs) in the selection dialog. Not perfect, but should work. Does that help?