Adding a Result Checker

Create or add a result checker when you edit Attribute or Operation properties for a mobile business object derived from a data source under the Definitions tab. You can also configure result checkers when you create an object. You can choose a predefined or a custom result checker, if you have created one.

  1. In the New Attributes or New Operation wizard, in the Result checker section, select from these options:
    Option Description
    Default The result checker used depends on the data source type:
    • SAP – com.sybase.sup.sap.DefaultSAPResultCheck. If a RETURN parameter is found in the selected operation, this option is automatically selected.
    • Web service (SOAP) – com.sybase.sup.ws.soap.DefaultWSResultCheck. The default checker always returns the status as successful with the message
      DefaultWSResultCheck Passed.
    • Web service (RESTful) – com.sybase.sup.ws.rest.DefaultRestResultCheck. The default checker always returns the status as successful with the message
      DefaultRestResultCheck Passed.
    None This option always returns the status as successful with no message. The result checker used depends on the data source type:
    • SAP – com.sybase.sup.sap.NoOpSAPResultCheck
    • Web service (SOAP) – com.sybase.sup.ws.soap.NoOpWSResultCheck
    • Web service (RESTful) – com.sybase.sup.ws.rest.NoOpRestResultCheck
    Custom Select this option to specify a custom result checker.
  2. (Optional) If you have not yet created the result checker classes, select Custom in the Result checker area of the New Attributes or New Operation dialog, and click Create to run the New Java Class wizard.
  3. If prompted, add a Java nature.
    1. Click Yes to add a Java nature. In Eclipse, a Java nature adds Java-specific behavior to projects. A Java nature is recommended because you are adding a Java class to it. By default Unwired Platform projects do not include all the required behaviors for Java development. In the New Java Class wizard, enter:
      Option Description
      Source Folder By default, this is the Filters folder from your project. Click Browse to locate the source folder for the Java class.
      Package Click Browse to locate the package for the new Java class.
      Note: Sybase recommends that you specify the package and not leave this field blank as the JDK 1.4 Java class in the default package cannot be resolved in other packages.
      Enclosing type Select to choose a type in which to enclose the new class. You can select either this option or the Package option, above. Either enter a valid name or click Browse.
      Name Enter a name for the result checker class.
      Modifiers Select the Java class modifiers. The default Modifier is public.
      Superclass
      1. Click Browse.
      2. In the Superclass Selection dialog, enter:
        • Choose a Type
        • Matching Items
      3. Click OK.
      Interfaces By default, this is populated with the corresponding interface:
      • SAP – com.sybase.sup.sap.SAPResultChecker
      • Web service (SOAP) – com.sybase.sup.ws.soap.WSResultChecker
      Click Add to select interfaces implemented by the new class.
      Which Method Stubs Would You Like to Create
      • Public Static Void Main
      • Constructors From Superclass
      • (Default) Inherited Abstract Methods
      Do You Want to Add Comments Select Generate Comments to add comments. From here you can modify the preferences of the code templates by clicking the link for Configure templates and default values.
      Note: If you set the Java project compiler compliance level to later than 1.4, you receive comments about missing classes. Set the Java project compiler compliance level to 1.4 or earlier. Java projects that are configured to compile with a compiler compliance level later than 1.4, have a known issue, where Java files referring to the RIM API have missing class errors.
      Note: The wizard generates a skeleton Java source file only.
    2. Click No if you do not want to add the Java nature to the selected Mobile Application Project.
    3. Click Finish in the wizard to compile the java skeleton source file and add the skeleton java checker class to the MBO.
      The created result checker appears next to the Custom option.
  4. In the Result checker section, next to the Custom option, click Browse to find an existing result checker class.
    1. In the Select Result Checker Class dialog, select the result checker class and click OK. The result checker class appears next to the Custom option.
      Note: A valid result checker is a Java class that implements:
      • SAP – com.sybase.sup.sap.SAPResultChecker
      • Web service (SOAP) – com.sybase.sup.ws.soap.WSResultChecker
      Only classes implementing the correct interface appear in the search dialog.
  5. Implement the new class by writing the implementation on top of the skeleton, as documented in the topic, Writing a Custom Result Checker.
  6. Test and preview the result of your result checker:
    1. To reuse input values you have already saved for previous previews, select Existing Configuration. Otherwise, load defaults, or create a new set of input values expressly for this preview instance.
    2. Click Preview.


    If the data runs successfully, Execution Succeeded appears at the top of the Preview dialog and data appears in the Preview Result window.