As for many major releases of medini, there have been some improvements and modifications of the metamodel. This time the changes were somewhat bigger in the sense that the effect to the scripting API and scripts especially for HARA is significant. This article gives a overview on the changes and quick guidance in case a script need adaptation.
In short: The HARA metamodel was changed with 2019 R1, mainly due to separation between HARA (ISO Automotive) and FHA (ARP Aviation). Attributes were either (1) renamed, (2) moved or (3) prefixed with "ISO26262". That mainly impacts constraints, scrips and reports using scripts.
Attached to this article are two example projects with scripts for 19.2 and 2019 R1 (internal number is 19.3) - check them to understand the changes or see this script overview script that script shows all changes in a single example:
var he = finder.findByType(Metamodel.hazard.HazardousEvent).first(); // <-- same as 19.2
console.log("GENERAL");
console.log("ID: {0}", he.id); // <-- same as 19.2
console.log("Analysis: {0}", he.hazardAnalysisModel.name); // <-- same as 19.2
console.log("Index: {0}", he.hazardAnalysisModel.hazardElements.indexOf(he)); // <-- same as 19.2
// OPSI
console.log("\r\nSITUATION");
//console.log("Location: {0}", he.operationalSituation.location);
console.log("Location: {0}", he.operationalSituation.ISO26262_location); // <-- prefixed with 19.3
//console.log("Conditions: {0}", he.operationalSituation.roadConditions);
console.log("Conditions: {0}", he.operationalSituation.ISO26262_roadConditions); // <-- prefixed with 19.3
//console.log("Environment: {0}", he.operationalSituation.environment);
console.log("Environment: {0}", he.operationalSituation.ISO26262_environment); // <-- prefixed with 19.3
//console.log("Operation Mode: {0}", he.operationalSituation.operationMode);
console.log("Operation Mode: {0}", he.operationalSituation.ISO26262_operationMode); // <-- prefixed with 19.3
//console.log("Traffic/People: {0}", he.operationalSituation.trafficAndPeople);
console.log("Traffic/People: {0}", he.operationalSituation.ISO26262_trafficAndPeople); // <-- prefixed with 19.3
//console.log("Item Usage: {0}", he.operationalSituation.itemUsage);
console.log("Item Usage: {0}", he.operationalSituation.ISO26262_itemUsage); // <-- prefixed with 19.3
//console.log("Other: {0} (not visible at UI)", "" + he.operationalSituation.otherCharacteristics); // <-- REMOVED WITH 19.3
// PRE-ASSESSMENT
//console.log("Default Exposure: {0} - {1}", he.operationalSituation.defaultExposure, he.operationalSituation.defaultExposureComment);
console.log("Default Exposure: {0} - {1}", he.operationalSituation.ISO26262_defaultExposure, he.operationalSituation.ISO26262_defaultExposureComment); // <-- prefixed with 19.3
// Failure
console.log("Failure: {0}", he.malfunctions.get(0).name); // <-- same as 19.2
// ASIL
console.log("\r\nASSESSMENT");
//console.log("E: {0} - {1}", he.isoAsil.exposure, he.isoAsil.exposureComment);
console.log("E: {0} - {1}", he.ISO26262_exposure, he.ISO26262_exposureComment); // <-- moved and prefixed with 19.3
//console.log("S: {0} - {1}", he.isoAsil.severity, he.isoAsil.severityComment);
console.log("S: {0} - {1}", he.ISO26262_severity, he.ISO26262_severityComment); // <-- moved and prefixed with 19.3
//console.log("C: {0} - {1}", he.isoAsil.controllability, he.isoAsil.controllabilityComment);
console.log("C: {0} - {1}", he.ISO26262_controllability, he.ISO26262_controllabilityComment); // <-- moved and prefixed with 19.3
//console.log("ASIL: {0}", he.isoAsil.value);
console.log("ASIL: {0}", he.ISO26262_asil); // <-- moved, renamed and prefixed with 19.3 (Note: always try to use "integrityLevel")
console.log("IL: {0}", he.integrityLevel); // <-- same as 19.2
// Effect/Hazard
console.log("Effect: {0}", he.effect); // <-- same as 19.2
console.log("Hazard: {0}", he.hazard.name); // <-- same as 19.2
// Custom
console.log("Custom: {0}", he.custom_property); // <-- same as 19.2 (!)
// Goal
console.log("\r\nMITIGATION");
//console.log("Goal: {0} (Safet State: {1})", he.safetyGoal.name, he.safetyGoal.safeState);
console.log("Goal: {0} (Safet State: {1})", he.ISO26262_safetyGoal.name, he.ISO26262_safetyGoal.safeState); // <-- prefixed with 19.3
// Internal
console.log("\r\nINTERNALS");
console.log("Template based: {0}", he.template ? "yes" : "no"); // <-- same as 19.2
// Setting S, E or C
//he.isoAsil.exposure = Metamodel.hazard.IsoExposureClass.E4.instance
he.ISO26262_exposure = "E4"; // <-- just strings
//he.isoAsil.severity = Metamodel.hazard.IsoSeverityClass.S1.instance
he.ISO26262_severity = "S1"; // <-- just strings
//he.isoAsil.controllability = Metamodel.hazard.IsoControlabilityClass.C3.instance
he.ISO26262_controllability = "C3"; // <-- just strings
Don't hesitate to ask any question related to 2019 R1 and migration in this article.
Happy Scripting Jan