Dear all
I want to create a script to import existing FMEA (not only an excel import) but with an interface with components/functions, feared event, preventive action, detection action..
In the library (finder.js and factory.js) I don’t find control to create a component in a FMEA
We have this script to create failure entry in factory
// helper
function __createFailureEntry(scope) {
if (!scope) {
console.error("Scope is undefined in create method!");
}
var entry = FMEAFactory.eINSTANCE.create(Metamodel.FMEA.FailureEntry);
// XXX changing containment is not supported in 3.1.0 API
var feature = Metamodel.FMEA.ComponentEntry.failureModes;
MediniModelModificationUtil.addValueOfFeature(scope, feature, entry);
return entry;
}
If i use in script like this
var created = Factory.createElement(scope, Metamodel.FMEA.FailureEntry);
it don’t run
We don’t have this command in this list in factory.js
// FMEA
if (type == Metamodel.FMEA.TakenAction) {
return __createTakenAction(scope);
}
if (type == Metamodel.FMEA.RecommendedAction) {
return __createRecommendedAction(scope);
}
if (type == Metamodel.FMEA.CurrentDesignControl) {
return __createCurrentDesignControl(scope);
}
if (type == Metamodel.FMEA.FMEAWorksheet) {
return __createFMEAWorksheet(scope);
}
And it return me this message
// not supported
throw"type is not supported";
same even if I add this in the previous list
if (type == Metamodel.FMEA.FailureEntry) {
return __createFailureEntry(scope);
}
Do you have an idea ?
Thank you in advance