Jeremy Jurek

Java BOM usage question

Discussion created by Jeremy Jurek on Aug 10, 2009
Latest reply on Aug 10, 2009 by Jeremy Jurek

I've been attempting to utilize the classes I've imported as a Java BOM in order to demonstrate a simple function.  Each time I try to do this I cannot retrieve even a simple string or integer value from my Java method.

 

Java applications and class libraries appear to expose my properties and methods with no problem and executing a method does not cause an error.  However, a simple print within a function will error out consistently.

 

I'm evaluating the trial version of 6.7 and have found the documentation to be either very clear or exceptionally vague in this area.

 

Here's my Java class (the documentation says any Java object or bean will work so I chose a simple class to test this):

 

import java.io.Serializable;


public class SimpleStringTest implements Serializable
{
    public String returnMeAStringValue()
    {
        String returnString = "SimpleStringTest";
        return returnString;
    }
}

 

...and here's my "main" Blaze function to test it:

si is some SimpleStringTest.
aString is a string.

aString = si.returnMeAStringValue().

print(aString).

 

This is only one example of attempting to interact with a Java object.  In all cases I've received errors and the one returned by the above main function is:

com.blazesoft.engines.rules.NdEvaluationException: Call to 'print' failed
Argument conversion failure for argument number 0
Cannot convert an Advisor exception value to a Java value of type 'java.lang.String'.
Value exception type = unknown. while evaluating print(aString)

It almost appears that I need to cast it to a Blaze string.  Is there a "Blaze String" object I can use in my Java code so there are no issues with type conversions?  Everything I've read in the documentation states that a string will come across perfectly but I have yet to see this work.

 

I realize that this is probably a very simple question but there is not a lot of Blaze information available beyond the documentation provided and the JavaDoc of the Blaze libraries leaves a Lot to be desired (perhaps someone may provide a comment within the JavaDoc so it's a little more obvious to someone attempting to integrate it? hint hint).

 

My end goal is to return an object with a set of primitive Java types (int, string) since the example I'm creating for evaluation purposes needs to show how easy this is to do.

 

As I mentioned it's likely that I'm missing something simple but I have no idea what that is.  A straightforward example would be a huge help.

 

Your help is greatly appreciated.

 

Thank you in advance.

Outcomes