ServoyForge COM plugin sending Real not Integer
Posted: Mon Aug 27, 2018 6:09 pm
Good Day!
Is anyone using COM in their solution?
My issue, already ticketed under ServoyForge #1364, is that the COM bridge isn't resolving the integer argument I send. Instead the receiving COM server gets a Real number.
The COM server is particular about a database name versus a database index. If the index is not an integer, it is resolved to be a String which locates the database name, based on the index passed into the COM Server, from the COM bridge which is a Real number. There is no database name represented by the generated Real number index string.
If an index is specified as an integer, always an integer 1 in my case, the COM Server gets 1.000000, and says database 1.000000 cannot be found.
If an index is specified as a String, '1', the COM Server generates the 'cannot find database 1' error.
If an existing database name is entered, then it returns the database object for that name. Yup, that one works.
=>DBs.getChildJSCOM('GetDataBase','',['barcodelabel'])
com.servoyguy.plugins.servoycom.RemoteCOM@52f8cb16
if a (bad) index number of 1.2345678910 is provided, then the database '1.234567' cannot be found.
if a non-existent database name of 1.234567890 is provided, then the database '1.234567890' cannot be found.
That's why it is convincing the Int_to_Real and Real_to_String issue occurs.
It was suggested that a suitable package be sent that can resolve to the integer.
I've tried numerous casting methods to force the input to be an Integer. Among the responses:
=>DBs.getChildJSCOM('GetDataBase',[new Packages.java.lang.Integer(1)])
null
=>DBs.getLastError()
"com.jacob.com.NotImplementedException: populateVariant() not implemented for class org.mozilla.javascript.NativeNumber"
=>
=>DBs.call('GetDataBase',new Packages.java.lang.Integer(1))
null
=>DBs.getLastError()
"com.jacob.com.NotImplementedException: populateVariant() not implemented for class org.mozilla.javascript.NativeNumber"
=>DBs.getChildJSCOM('GetDataBase','',[new Packages.java.lang.Integer(1)])
null
=>DBs.getLastError()
"com.jacob.com.NotImplementedException: populateVariant() not implemented for class org.mozilla.javascript.NativeNumber"
=>DBs.getChildJSCOM("GetDatabase",'',[Math.ceil('1')])
null
=>DBs.getLastError()
"com.jacob.com.ComFailException: Invoke of: GetDatabase
Source: BarTend
Description: Cannot find database 1.000000.
"
It may be that the COM bridge needs an argument of type Variant.VariantInt.. Sending something cast to a Number fails since the arguments reject the type Number as an argument type.
I'm working on that part.
has anyone else seen this behavior?
thanks,
Joe.
Is anyone using COM in their solution?
My issue, already ticketed under ServoyForge #1364, is that the COM bridge isn't resolving the integer argument I send. Instead the receiving COM server gets a Real number.
The COM server is particular about a database name versus a database index. If the index is not an integer, it is resolved to be a String which locates the database name, based on the index passed into the COM Server, from the COM bridge which is a Real number. There is no database name represented by the generated Real number index string.
If an index is specified as an integer, always an integer 1 in my case, the COM Server gets 1.000000, and says database 1.000000 cannot be found.
If an index is specified as a String, '1', the COM Server generates the 'cannot find database 1' error.
If an existing database name is entered, then it returns the database object for that name. Yup, that one works.
=>DBs.getChildJSCOM('GetDataBase','',['barcodelabel'])
com.servoyguy.plugins.servoycom.RemoteCOM@52f8cb16
if a (bad) index number of 1.2345678910 is provided, then the database '1.234567' cannot be found.
if a non-existent database name of 1.234567890 is provided, then the database '1.234567890' cannot be found.
That's why it is convincing the Int_to_Real and Real_to_String issue occurs.
It was suggested that a suitable package be sent that can resolve to the integer.
I've tried numerous casting methods to force the input to be an Integer. Among the responses:
=>DBs.getChildJSCOM('GetDataBase',[new Packages.java.lang.Integer(1)])
null
=>DBs.getLastError()
"com.jacob.com.NotImplementedException: populateVariant() not implemented for class org.mozilla.javascript.NativeNumber"
=>
=>DBs.call('GetDataBase',new Packages.java.lang.Integer(1))
null
=>DBs.getLastError()
"com.jacob.com.NotImplementedException: populateVariant() not implemented for class org.mozilla.javascript.NativeNumber"
=>DBs.getChildJSCOM('GetDataBase','',[new Packages.java.lang.Integer(1)])
null
=>DBs.getLastError()
"com.jacob.com.NotImplementedException: populateVariant() not implemented for class org.mozilla.javascript.NativeNumber"
=>DBs.getChildJSCOM("GetDatabase",'',[Math.ceil('1')])
null
=>DBs.getLastError()
"com.jacob.com.ComFailException: Invoke of: GetDatabase
Source: BarTend
Description: Cannot find database 1.000000.
"
It may be that the COM bridge needs an argument of type Variant.VariantInt.. Sending something cast to a Number fails since the arguments reject the type Number as an argument type.
I'm working on that part.
has anyone else seen this behavior?
thanks,
Joe.