I've tried to implement a batch edit, with the example post provided above (https://medini.freshdesk.com/support/discussions/topics/1000114569)
to get the selection of mission profiles. I now face the problem, that i
can't assign values to the parameters in the mission profile. The whole script is attached.
When trying to assign a value to Mission Profile Parameters such as
internalWorkingCycle.averageAmbientTemperature
the error:
Failed to execute Java Script: class java.lang.Double cannot be cast to class java.lang.Integer (java.lang.Double and java.lang.Integer are in module java.base of loader 'bootstrap')
class java.lang.Double cannot be cast to class java.lang.Integer (java.lang.Double and java.lang.Integer are in module java.base of loader 'bootstrap')
occurs in the function
function change_parameterValue_byName(internalWorkingCycle, name, value){
if(internalWorkingCycle.prototype != Metamodel.failureratecatalogs.InternalWorkingCycle){
console.log("Internal Working Cycle not valid!")
throw "Internal Working Cycle not valid!";
}
if(name = "Average Ambient Temperature (°C)"){
internalWorkingCycle.averageAmbientTemperature = value;
return 0;
}
if(name = "tau"){
internalWorkingCycle.tau = value;
return 0;
}
if(name = "Self Increase Temperature (°C)"){
if (isDouble(value)){
value = Math.round(value);
}
internalWorkingCycle.deltaTemp = value;
return 0;
}
return -1;
}
I can't find the correct way to cast this variable, so i can assign it. I've also tried parseInt(), which didn't help. Can anyone help with this?