Creo™ Schematics 4.0 Help Center > Customizing Creo Schematics Using Java APIs > Example: Syntax to Call a Custom Java Method for Filtering Criteria
  
Example: Syntax to Call a Custom Java Method for Filtering Criteria
In the following example, the report is filtered to return only artifacts which contain the letter u or U. The report criteria for this method is {reportTest.reportFilter()}.
import rsdesigner.component.Artifact;
import rsdesigner.design.PropertySet;

public class reportTest {

public static String reportFilter(Artifact art) {
String artName=null;

PropertySet myProp=(PropertySet)art;
try {
artName = myProp.getStringProperty("name");
}
catch (Exception e){
System.out.println("Fail on Exception");
return ("error");// TODO handle exception
}
if (artName.contains("u")||artName.contains("U")){
return "true";
}
return "false";
}
}