DFA by using checklists populated from Cut Sets, FMEA and Metric Analysis
Hi all, I found a solution to provide automatic generated checklists for the Dependend Failure Analysis. First step was create a collection of dependend failure initiators. I used a malfunction collection for the initiators according to ISO 26262 and our DFA work instruction. In total 23 initiators have been added. This initiators will be populated by Java scripts to all cust sets. DFA checklist generated from Cut Set Analysis Cut sets can be used as output from FTA. The Java script is populating all cut sets from a cut set analysis selected at the Model Browser. For each cut set the initiators are added at sub level. According to the level of the DFA the initiators can be filtered for System, HW and SW level. The artifacts can be used for navigation. DFA checklist generated from DC Worksheet Next step was to provide the cut sets from the DC worksheet. The Java script is populating all failure modes that violates the safety goal in combination with a second fault from a DC worksheet selected at the Model Browser. Here only the HW relevant dependend failure initiators are used. DFA checklist generated from FMEA Third step was to provide the cut sets from the FMEA. The Java script is populating all failure causes prevented or detected by a safety mechanism from a FMEA worksheet selected at the Model Browser. For each cut set the initiators are added at sub level. The DFA initiators, the profile attributes and the 3 Java Scripts are provided by my template. The template is stored at my OneDrive at ZF_Master_Div_ARU.mprx. It is intended to store the template at a central Integrity project in the future. The DFA approach provided by this populated checklists is compliant to the ZF DFA Work Instruction. However, the DFA Analyser (Excel) can be replaced and cut sets can be identified from FMEA and DC Worksheet too (only if analysed in medini analyze). Script 1 (Cut Sets) //$EXPERIMENTAL$ $STRICT_MODE$ $WARNINGS_AS_ERRORS$ $ENHANCED_CONTAINMENT_ACCESS$
// $DEBUG$ <- move to first line to enable debugging
/*
* v2021-10-21 - initial version
*
* This script exemplary extracts information from a selected cut-set model
* and exports it to a checklist.
*/
load("../.lib/finderEx.js");
load("../.lib/factory.js");
load("../.lib/trashbin.js");
load("../.lib/ui.js");
var verbose = true; // {true; false}
var list;
var item = [];
var z;
var DFIn;
z = 1;
/*
* Main function doing the "main" job.
*/
function main() {
//find collection with the name "Dependend Failure Initiators"
var col_scope = finder;
var col = col_scope.findByType(Metamodel.safetyModel.FailureCollection, true).and("name", "Dependend Failure Initiators").first();
//if collection is found, read all dependend failure initiators and store it to array DFIarr
if (col) {
var cDFI_scope = Global.getFinder(col);
var cDFI_children = cDFI_scope.findByType(Metamodel.safetyModel.Malfunction, true).asList();
var DFIarr1 = cDFI_children.toArray(); //declaration of array DFIarr1
var DFIarr2 = cDFI_children.toArray(); //declaration of array DFIarr2
var DFIarr3 = cDFI_children.toArray(); //declaration of array DFIarr3
var DFIarr4 = cDFI_children.toArray(); //declaration of array DFIarr4
DFIn = cDFI_children.size(); //identify number of dependend failure initiators
for (var m = 0; m < DFIn; m++ ) { //loop for all dependend failure initiators
var cDFI = cDFI_children.get(m); //get input from initiators collection
var cDFI_name = cDFI.name; //name of dependend failure initiator
var cDFI_description = cDFI.description; //description of dependend failure initiator
var cDFI_comment = cDFI.user_comment; //comment to dependend failure initiator
var cDFI_kind = cDFI.kind; //kind (System, HW, SW) of dependend failure initiator
DFIarr1[m] = cDFI_name; //store name of Dependend Failure Initiator from collection to array DFIarr
DFIarr2[m] = cDFI_description; //store description of Dependend Failure Initiator from collection to array DFIarr
DFIarr3[m] = cDFI_comment; //store comment of Dependend Failure Initiator from collection to array DFIarr
DFIarr4[m] = cDFI_kind; //store kind of Dependend Failure Initiator from collection to array DFIarr
if (verbose) console.log("Dependent Failure Initiator: {0}",DFIarr1[m]); //logging to console
}
if (verbose) console.log("{0} intiators found", DFIn); //logging to console
}
// make sure something is selected
if (selection) {
// by default we scan selected elements
var scan = selection;
// however, is a SINGLE package is selected, we scan the tree below
if (selection.length == 1 && selection[0].prototype == Metamodel.projectmodel.PJProxyModel.originalModel) {
scan = Global.getFinder(selection[0]).findByType(Metamodel.projectmodel.PJProxyModel.originalModel.cutSets).asArray();
}
if (verbose) console.log("selection is: {0}", selection[0].name); //logging to console
if (verbose) console.log("number of cutsets: {0}", selection[0].cutSets.size()); //logging to console
var pScope = finder.project; //seting scope for finder
list = findOrCreateChecklist(pScope, "DFA Checklist " + selection[0].name); //create checklist if not exists
list.name = "DFA Checklist " + selection[0].name; //name the checklist
for (var j = 0; j < selection[0].cutSets.size(); j++) { //loop for number of cutsets
var CSEvents =selection[0].cutSets[j].events.toArray(); //read cutsets into array
var CutsetName = ""; //reset name of cutset
for (var k = 0; k < selection[0].cutSets[j].events.size(); k++) { //loop for number of events in cutset
CSEvents[k] = selection[0].cutSets[j].events[k].name; //read cutset name
if (verbose) console.log("Event: {0}", CSEvents[k]); //logging to console
if (k > 0) { //add name of events to cutset name
CutsetName = CutsetName + " AND simultanously " + CSEvents[k];
} else {
CutsetName = CutsetName + CSEvents[k];
}
}
var found = findChecklistItem(list, CutsetName); //check if item already exists
item[1] = findOrCreateChecklistItem(list, CutsetName); //add custset to checklist at level 1 if not exists
if (verbose) console.log("Item name: {0}", CutsetName); //logging to console
if (!found) {
item[1].user_kind.add("System"); //add kind "System" to the cutset to allow filtering
item[1].user_kind.add("HW"); //add kind "HW" to the cutset to allow filtering
item[1].user_kind.add("SW"); //add kind "SW" to the cutset to allow filtering
item[1].artifacts.add(selection[0].cutSets[j]); //add artifact of curset, can be shown at Browser
}
var order = selection[0].cutSets[j].events.size(); //identify cutset order
if (verbose) console.log("cutset order: {0}", order); //logging to console
item[1].user_cutset_order = order.toString(); //set cutset order for checklist item
if (verbose) console.log("Cutset: {0}", CutsetName); //logging to console
item[1].name = CutsetName; //set name for cutset for checklist item
for (var n = 0; n < DFIn; n++) { //loop for number of dependend failure initiators
item[2] = findOrCreateChecklistItem(item[1], DFIarr1[n]); //add dependend failure initiator to the checklist at level 2 if not exists
item[2].name = DFIarr1[n]; //set name for DFI for checklist item
item[2].user_initiator = DFIarr1[n]; //set initiator for DFI for checklist item
item[2].user_initiator_description = DFIarr2[n]; //set description for DFI for checklist item
item[2].user_initiator_comment = DFIarr3[n]; //set comment for DFI for checklist item
item[2].user_cutset_order = order.toString(); //set cutset order for DFI for checklist item
if (!found) {
item[2].user_kind.add(DFIarr4[n]); //set kind for DFI for checklist item
}
}
}
} else {
console.log("Please select one or more elements or a single package."); //logging to console
}
if (verbose) console.log("finished\n\n"); //logging to console
return "DFA checklist " + selection[0].name + " created";
}
// do it!
main(); Script 2 (DC Worksheet) //$EXPERIMENTAL$ $STRICT_MODE$ $WARNINGS_AS_ERRORS$ $ENHANCED_CONTAINMENT_ACCESS$
// $DEBUG$ <- move to first line to enable debugging
/*
* v2021-10-21 - initial version
*
* This script exemplary extracts information from a selected cut-set model
* and exports it to a checklist.
*/
load("../.lib/finderEx.js");
load("../.lib/factory.js");
load("../.lib/trashbin.js");
load("../.lib/ui.js");
var verbose = true; // {true; false}
var list;
var item = [];
var z;
var DFIn;
var NL = "\n"; // newline character
z = 1;
/*
* Main function doing the "main" job.
*/
function main() {
//find collection with the name "Dependend Failure Initiators"
var col_scope = finder;
var col = col_scope.findByType(Metamodel.safetyModel.FailureCollection, true).and("name", "Dependend Failure Initiators").first();
//if collection is found, read all dependend failure initiators and store it to array DFIarr
if (col) {
var cDFI_scope = Global.getFinder(col);
var cDFI_children = cDFI_scope.findByType(Metamodel.safetyModel.Malfunction, true).asList();
var DFIarr1 = cDFI_children.toArray(); //declaration of array DFIarr1
var DFIarr2 = cDFI_children.toArray(); //declaration of array DFIarr2
var DFIarr3 = cDFI_children.toArray(); //declaration of array DFIarr3
var DFIarr4 = cDFI_children.toArray(); //declaration of array DFIarr4
DFIn = cDFI_children.size(); //identify number of dependend failure initiators
for (var m = 0; m < DFIn; m++ ) { //loop for all dependend failure initiators
var cDFI = cDFI_children.get(m); //get input from initiators collection
var cDFI_name = cDFI.name; //name of dependend failure initiator
var cDFI_description = cDFI.description; //description of dependend failure initiator
var cDFI_comment = cDFI.user_comment; //comment to dependend failure initiator
var cDFI_kind = cDFI.kind; //kind (System, HW, SW) of dependend failure initiator
DFIarr1[m] = cDFI_name; //store name of Dependend Failure Initiator from collection to array DFIarr
DFIarr2[m] = cDFI_description; //store description of Dependend Failure Initiator from collection to array DFIarr
DFIarr3[m] = cDFI_comment; //store comment of Dependend Failure Initiator from collection to array DFIarr
DFIarr4[m] = cDFI_kind; //store kind of Dependend Failure Initiator from collection to array DFIarr
if (verbose) console.log("Dependent Failure Initiator: {0}",DFIarr1[m]); //logging to console
}
if (verbose) console.log("{0} intiators found", DFIn); //logging to console
}
// make sure something is selected
if (selection) {
// by default we scan selected elements
var scan = selection;
// however, is a SINGLE package is selected, we scan the tree below
if (selection.length == 1 && selection[0].prototype == Metamodel.projectmodel.PJProxyModel.originalModel) {
scan = Global.getFinder(selection[0]).findByType(Metamodel.projectmodel.PJProxyModel.originalModel.components).asArray();
}
if (verbose) console.log("selection is: {0}", selection[0].name); //logging to console
if (verbose) console.log("number of components: {0}", selection[0].components.size()); //logging to console
var pScope = finder.project; //seting scope for finder
list = findOrCreateChecklist(pScope, "DFA Checklist " + selection[0].name); //create checklist if not exists
list.name = "DFA Checklist " + selection[0].name; //name the checklist
for (var j = 0; j < selection[0].components.size(); j++) { //loop for number of components
var ComponentName = selection[0].components[j].element.name;
if (verbose) console.log("component name is: {0}", ComponentName); //logging to console
var CFailureModes = selection[0].components[j].element.failures.toArray(); //loop for number of failure modes
if (verbose) console.log("Number of failure modes: {0}", selection[0].components[j].element.failures.size()); //logging to console
for (var k = 0; k < selection[0].components[j].element.failures.size(); k++) { //loop for number of failure modes
var CutsetName = ""; //reset name of cutset
if (verbose) console.log("Failure mode name: {0}", selection[0].components[j].element.failures[k].name); //logging to console
var CFailureMode = selection[0].components[j].element.failures[k].name; //read failure mode name
if (verbose) console.log("component failure mode is: {0}", CFailureMode); //logging to console
if (selection[0].components[j].failureModes[k].lmpfViolation == true) {
var secondFault = selection[0].components[j].failureModes[k].user_example_of_2nd_fault && selection[0].components[j].failureModes[k].user_example_of_2nd_fault.name; //mediniGetOpposites("user_example_of_2nd_fault").label;
CutsetName = CutsetName.concat(ComponentName, ' ', CFailureMode, ' AND SIMULTANOUSLY ', secondFault);
var found = findChecklistItem(list, CutsetName); //check if item already exists
item[1] = findOrCreateChecklistItem(list, CutsetName); //add custset to checklist at level 1 if not exists
if (verbose) console.log("Item name: {0}", CutsetName); //logging to console
if (!found) {
item[1].user_kind.add("System"); //add kind "System" to the cutset to allow filtering
item[1].user_kind.add("HW"); //add kind "HW" to the cutset to allow filtering
item[1].user_kind.add("SW"); //add kind "SW" to the cutset to allow filtering
}
var order = 2; //set cutset order to 2
if (verbose) console.log("cutset order: {0}", order); //logging to console
item[1].user_cutset_order = order.toString(); //set cutset order for checklist item
if (verbose) console.log("Cutset: {0}", CutsetName); //logging to console
item[1].name = CutsetName; //set name for cutset for checklist item
item[1].artifacts.add(selection[0].components[j].element.failures[k]);
if (secondFault != "") {
item[1].artifacts.add(selection[0].components[j].failureModes[k].user_example_of_2nd_fault);
}
for (var n = 0; n < DFIn; n++) { //loop for number of dependend failure initiators
if (DFIarr4[n] == "HW") { //add only HW related DFI
item[2] = findOrCreateChecklistItem(item[1], DFIarr1[n]); //add dependend failure initiator to the checklist at level 2 if not exists
item[2].name = DFIarr1[n]; //set name for DFI for checklist item
item[2].user_initiator = DFIarr1[n]; //set initiator for DFI for checklist item
item[2].user_initiator_description = DFIarr2[n]; //set description for DFI for checklist item
item[2].user_initiator_comment = DFIarr3[n]; //set comment for DFI for checklist item
item[2].user_cutset_order = order.toString(); //set cutset order for DFI for checklist item
if (!found) {
item[2].user_kind.add(DFIarr4[n]); //set kind for DFI for checklist item
}
}
}
}
}
}
} else {
console.log("Please select one or more elements or a single package."); //logging to console
}
if (verbose) console.log("finished\n\n"); //logging to console
return "DFA checklist " + selection[0].name + " created";
}
// do it!
main(); Script 3 (FMEA) //$EXPERIMENTAL$ $STRICT_MODE$ $WARNINGS_AS_ERRORS$ $ENHANCED_CONTAINMENT_ACCESS$
// $DEBUG$ <- move to first line to enable debugging
/*
* v2021-10-27 - initial version
*
* This script exemplary extracts information from a selected FMEA worksheet
* and exports it to a checklist.
*/
load("../.lib/finderEx.js");
load("../.lib/factory.js");
load("../.lib/trashbin.js");
load("../.lib/ui.js");
var verbose = true; // {true; false}
var list;
var item = [];
var z;
var DFIn;
var NL = "\n"; // newline character
z = 1;
var SM = []; //declaration of array for safety mechanisms
/*
* Main function doing the "main" job.
*/
function main() {
//find collection with the name "Dependend Failure Initiators"
var col_scope = finder;
var col = col_scope.findByType(Metamodel.safetyModel.FailureCollection, true).and("name", "Dependend Failure Initiators").first();
//if collection is found, read all dependend failure initiators and store it to array DFIarr
if (col) {
var cDFI_scope = Global.getFinder(col);
var cDFI_children = cDFI_scope.findByType(Metamodel.safetyModel.Malfunction, true).asList();
var DFIarr1 = cDFI_children.toArray(); //declaration of array DFIarr1
var DFIarr2 = cDFI_children.toArray(); //declaration of array DFIarr2
var DFIarr3 = cDFI_children.toArray(); //declaration of array DFIarr3
var DFIarr4 = cDFI_children.toArray(); //declaration of array DFIarr4
DFIn = cDFI_children.size(); //identify number of dependend failure initiators
for (var m = 0; m < DFIn; m++ ) { //loop for all dependend failure initiators
var cDFI = cDFI_children.get(m); //get input from initiators collection
var cDFI_name = cDFI.name; //name of dependend failure initiator
var cDFI_description = cDFI.description; //description of dependend failure initiator
var cDFI_comment = cDFI.user_comment; //comment to dependend failure initiator
var cDFI_kind = cDFI.kind; //kind (System, HW, SW) of dependend failure initiator
DFIarr1[m] = cDFI_name; //store name of Dependend Failure Initiator from collection to array DFIarr
DFIarr2[m] = cDFI_description; //store description of Dependend Failure Initiator from collection to array DFIarr
DFIarr3[m] = cDFI_comment; //store comment of Dependend Failure Initiator from collection to array DFIarr
DFIarr4[m] = cDFI_kind; //store kind of Dependend Failure Initiator from collection to array DFIarr
if (verbose) console.log("Dependent Failure Initiator: {0}",DFIarr1[m]); //logging to console
}
if (verbose) console.log("{0} intiators found", DFIn); //logging to console
}
// make sure something is selected
if (selection) {
// by default we scan selected elements
var scan = selection;
// however, is a SINGLE package is selected, we scan the tree below
if (selection.length == 1 && selection[0].prototype == Metamodel.projectmodel.PJProxyModel.originalModel) {
scan = Global.getFinder(selection[0]).findByType(Metamodel.projectmodel.PJProxyModel.originalModel.components).asArray();
}
if (verbose) console.log("selection is: {0}", selection[0].name); //logging to console
if (verbose) console.log("number of components: {0}", selection[0].components.size()); //logging to console
var pScope = finder.project; //seting scope for finder
list = findOrCreateChecklist(pScope, "DFA Checklist " + selection[0].name); //create checklist if not exists
list.name = "DFA Checklist " + selection[0].name; //name the checklist
for (var j = 0; j < selection[0].components.size(); j++) { //loop for number of components
var ComponentName = selection[0].components[j].element.name; //read component name
if (verbose) console.log("component name is: {0}", ComponentName); //logging to console
var CFailureModes = selection[0].components[j].element.failures.toArray(); //loop for number of failure modes
if (verbose) console.log("Number of failure modes: {0}", selection[0].components[j].element.failures.size()); //logging to console
for (var k = 0; k < selection[0].components[j].element.failures.size(); k++) { //loop for number of failure modes
var CutsetName = ""; //reset name of cutset
var CFailureMode = selection[0].components[j].element.failures[k].id + ' ' + selection[0].components[j].element.failures[k].name; //read failure mode name
if (verbose) console.log("Failure mode is: {0}", CFailureMode); //logging to console
if (selection[0].components[j].element.failures[k].causedBy.size() > 0) { //check if failure causes exists
var CCauses = selection[0].components[j].element.failures[k].causedBy.toArray(); //read failure causes
for (q =0; q < selection[0].components[j].element.failures[k].causedBy.size(); q++) { //loop for failure causes
SM.length = 0; //delete safety mechanisms from array SM
if (verbose) console.log("Failure cause is: {0}", selection[0].components[j].element.failures[k].causedBy[q].name); //logging to console
var order = 1; //reset cut set order
if (selection[0].components[j].element.failures[k].causedBy[q].measureGroups.size() > 0) { //check if measure groups exists
var CMeasureGroups = selection[0].components[j].element.failures[k].causedBy[q].measureGroups.toArray(); //read measure groups
for (l = 0; l < selection[0].components[j].element.failures[k].causedBy[q].measureGroups.size(); l++) { //loop for measure groups
var CDetectionMeasures= selection[0].components[j].element.failures[k].causedBy[q].measureGroups[l].detectionMeasures.toArray; //read detection measures
CutsetName = selection[0].components[j].element.failures[k].id + ' ' + selection[0].components[j].element.failures[k].causedBy[q].name; //add failure cause to cut set name
for (o = 0; o < selection[0].components[j].element.failures[k].causedBy[q].measureGroups[l].detectionMeasures.size(); o++) { //loop for detection measures
var CDetectionMeasure = selection[0].components[j].element.failures[k].causedBy[q].measureGroups[l].detectionMeasures[o].name; //read measure name
if (verbose) console.log("detection measure is: {0}", CDetectionMeasure); //logging to console
if (selection[0].components[j].element.failures[k].causedBy[q].measureGroups[l].detectionMeasures[o] instanceof Metamodel.safetyModel.SafetyMechanism) { //check ist measure is safety mechanism
if (verbose) console.log("Its a safety mechanism (detection): {0}", CDetectionMeasure); //logging to console
CutsetName = CutsetName.concat(' AND SIMULTANOUSLY failure of safety mechanism ', CDetectionMeasure); //build name of cut set
SM.push(selection[0].components[j].element.failures[k].causedBy[q].measureGroups[l].detectionMeasures[o]); //add artifact of curset, can be shown at Browser
order = order + 1; //increase cutset order according to identified safety mechanism
}
}
var CPreventionMeasures= selection[0].components[j].element.failures[k].causedBy[q].measureGroups[l].preventionMeasures.toArray; //read prevention measures
for (p = 0; p < selection[0].components[j].element.failures[k].causedBy[q].measureGroups[l].preventionMeasures.size(); p++) { //loop for prevention measures
var CPreventionMeasure = selection[0].components[j].element.failures[k].causedBy[q].measureGroups[l].preventionMeasures[p].name; //read measure name
if (verbose) console.log("prevention measure is: {0}", CPreventionMeasure); //logging to console
if (selection[0].components[j].element.failures[k].causedBy[q].measureGroups[l].preventionMeasures[p] instanceof Metamodel.safetyModel.SafetyMechanism) { //check ist measure is safety mechanism
if (verbose) console.log("Its a safety mechanism (prevention): {0}", CPreventionMeasure); //logging to console
CutsetName = CutsetName.concat(' AND SIMULTANOUSLY failure of safety mechanism ', CPreventionMeasure); //build name of cut set
SM.push(selection[0].components[j].element.failures[k].causedBy[q].measureGroups[l].preventionMeasures[p]); //add artifact of curset, can be shown at Browser
order = order + 1; //increase cutset order according to identified safety mechanism
}
}
}
}
if (order > 1) {
var found = findChecklistItem(list, CutsetName); //check if item already exists
item[1] = findOrCreateChecklistItem(list, CutsetName); //add custset to checklist at level 1 if not exists
if (verbose) console.log("Item name: {0}", CutsetName); //logging to console
if (!found) {
item[1].user_kind.add("System"); //add kind "System" to the cutset to allow filtering
item[1].user_kind.add("HW"); //add kind "HW" to the cutset to allow filtering
item[1].user_kind.add("SW"); //add kind "SW" to the cutset to allow filtering
item[1].artifacts.add(selection[0].components[j].element.failures[k].causedBy[q]); //add artifact of failure cause, for navigation to Browser
}
if (verbose) console.log("cutset order: {0}", order); //logging to console
item[1].user_cutset_order = order.toString(); //set cutset order for checklist item
if (verbose) console.log("Cutset: {0}", CutsetName); //logging to console
item[1].name = CutsetName; //set name for cutset for checklist item
for (var n = 0; n < DFIn; n++) { //loop for number of dependend failure initiators
item[2] = findOrCreateChecklistItem(item[1], DFIarr1[n]); //add dependend failure initiator to the checklist at level 2 if not exists
item[2].name = DFIarr1[n]; //set name for DFI for checklist item
item[2].user_initiator = DFIarr1[n]; //set initiator for DFI for checklist item
item[2].user_initiator_description = DFIarr2[n]; //set description for DFI for checklist item
item[2].user_initiator_comment = DFIarr3[n]; //set comment for DFI for checklist item
item[2].user_cutset_order = order.toString(); //set cutset order for DFI for checklist item
if (!found) {
item[2].user_kind.add(DFIarr4[n]); //set kind for DFI for checklist item
}
}
for (var r = 0; r < SM.length; r++) { //loop for each identified safety mechanisms
item[1].artifacts.add(SM[r]); //add artifacts of safety mechanisms, for navigation to Browser
}
}
}
}
}
}
} else {
console.log("Please select one or more elements or a single package."); //logging to console
}
if (verbose) console.log("finished\n\n"); //logging to console
return "DFA checklist " + selection[0].name + " created";
}
// do it!
main(); Comments are welcome Kind regards Günter