Support Article

Unable to use java object property as parameter

SA-32779

Summary



User is unable to call the function which accepts the java object type java.io.InputStream.

User is using a javaproperty(java.io.Stream) in a function to unzip, and get its contents to set that value in a Data Transform.


Error Messages



Invalid expression or reference: No suitable instance found
[seeking]
@(<Library>).<Function_Name>(String)
[candidate functions are]
@(Library).<Function_Name>(void)".


Steps to Reproduce



1. Create function which accepts the input parameter of type java.io.InputStream.
2. Create property of type java object of java.io.InputStream
3. Create Data Transform.
4. Call the function by passing property.
5. Save the Data Transform or validate the expression.


Root Cause



Type safety or check of pega internal language while compilation enforces type safety, which in turn requires pega developer to pass the right type safety object while saving the rule.

Resolution



Create a wrapper function that accepts the object parameter and call the original ruf from the wrapper ruf with type casting the passed object



Published January 23, 2017 - Updated February 6, 2017

Have a question? Get answers now.

Visit the Collaboration Center to ask questions, engage in discussions, share ideas, and help others.