Community Tip - Learn all about the Community Ranking System, a fun gamification element of the PTC Community. X
I get this warning:
"Execution error in service script [blah] :: RHINO USAGE WARNING: Missed Context.javaToJS() conversion:_Rhino runtime detected object of class com.thingworx.types.collections.ValueCollection where it expected String, Number, Boolean or Scriptable instance. Please check your code for missing Context.javaToJS() call."
after running the below generalized code:
var foundRow = infotable.Find(object); if (foundRow !== undefined && foundRow !== null) { logger.info(foundRow.field); }
I believe its telling me that the foundRow variable is a ValueCollection and I shouldn't be referencing it. However, the foundRow.field is returning the value I expect it to. Is there anyway to suppress or avoid this Rhino usage warning?
I found this support Article referencing a similar issue but it doesn't actually provide a resolution nor is my code comparing the Object to a String like the Article says with this line:
tempObject = heatMapInfoTable.Find(obj); /* tempObject is an object but compared to a String in the below if statement which caused Rhino messages */ if(tempObject!= undefined && tempObject!=null && tempObject!=''){ }
In the article linked above, the resolution suggests checking for a null variable explicitly,
var myVar = Things["myThing"]; // myVar is populated with a Thing Object
if (myVar != null) {
// Do stuff here
}
Hi,
In my initial post I noted that I already check for the null variable explicitly. It does not resolve the error.