Hi all,
I have created a collection with 4 malfunctions which shall be copied to functions at a SYSML model. How can I address the right collection and read the including malfunctions?

As seen in the picture above, there are more collections in the project and I need the content of ETA_Malfunctions. Copying malfunctions a UML model selected at the Model Browser is already working. However, this is currently hard coded.
for (var i = 0; i < children.size(); i++) {
var c = children.get(i);
var ctype = c.name;
console.log("function: {0}",ctype);
MF_scope = Global.getFinder(c);
var MF_children = MF_scope.findByType(Metamodel.safetyModel.Malfunction, true).asList();
if (verbose) {
console.log("{0} entires found", MF_children.size());
}
for (var j = 0; j < MF_children.size(); j++) {
var MF_c = MF_children.get(j);
var MF_ctype = MF_c.name;
if (MF_ctype=="Does not execute") {
if (verbose) console.log("Malfunction 'Does not execute' already exists");
}
if (MF_ctype=="Executes to often") {
if (verbose) console.log("Malfunction 'Executes to often' already exists");
}
if (MF_ctype=="Executes not often enough") {
if (verbose) console.log("Malfunction 'Executes not often enough' already exists");
}
if (MF_ctype=="Provides wrong output") {
if (verbose) console.log("Malfunction 'Provides wrong output' already exists");
}
}
if (!MF_children || !MF_children.size()) {
// alert( "There are no entries in the selected scope"); return;
var newMF = Factory.createElement(c, Metamodel.safetyModel.Malfunction);
newMF.name = "Does not execute";
var newMF = Factory.createElement(c, Metamodel.safetyModel.Malfunction);
newMF.name = "Executes to often";
var newMF = Factory.createElement(c, Metamodel.safetyModel.Malfunction);
newMF.name = "Executes not often enough";
var newMF = Factory.createElement(c, Metamodel.safetyModel.Malfunction);
newMF.name = "Provides wrong output";
}
}
Furthermore, I would like to derive a FMEA worksheet by script, after the malfunctions have been copied to the UML model. How can this be realized?
Kind regards
Günter Gäbelein