Adding Result Set Filters

Choose and add a result set filter when you edit Attribute properties for a mobile business object from the Definitions tab. You can also configure result set filters when you create an object. You can choose a predefined or a custom filter, if you have created one.

  1. (Optional) If you have not yet created the classes, then in the Resultset Filters area of the New Attributes dialog, click Create to run the New Java Class wizard.
  2. If prompted, add a Java nature.
    • (Recommended) 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 creating a new Java project and adding a Java class to it. By default an Unwired Platform project does not include all the required behaviors for Java development. Clicking Yes automates this process.

      If you clicked Yes, a wizard appears allowing you to enter the java package name and java class name. Click Finish in the wizard to compile the java skeleton source file and add the skeleton java filter class to the MBO. If you are adding the filter from the Definition tab of Attribute Properties view, you are prompted to refresh the data source definition. Choose Yes in response to this prompt. Other wise, choose No and only refresh after the logic has been put implemented and the java class has been built.

      Note: Only the wizard generates a skeleton java source file.
    • Click No if you do not want to add the Java nature to the selected Mobile Application Project.
      Note: When a mobile application project is exported as an archive file, the Filters folder is not archived in the zip file if the Filters folder is empty. In these cases, you must manually create the Filters folder after you import the project into Unwired WorkSpace.
  3. Implement the new class by writing the real implementation on top of the skeleton created as documented in the next topic, Writing a Custom Result Set Filter.
  4. Add the filter you require to your mobile business object. In the Resultset Filters area of the New Attributes dialog, click Add. If you are creating an MBO, you can also perform similar action with the corresponding wizard.
  5. Select an existing filter class that you imported into Unwired WorkSpace.
    Only valid filters (that is, filters implemented with com.sybase.uep.eis.ResultFilter) appear in the filters table.
  6. (Optional) Repeat steps 3 and 4 to add more filters to the mobile object.
  7. (Optional) If the filters are not in the order you require, reorder them with either the Up or Down button. The order of multiple filters affects the actual Result set and metadata.
  8. Test and preview the Result of your filter settings:
    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. To run the preview, click Preview.

    If the data filters successfully, Execution Succeeded appears at the top of the Preview dialog and data appears in the Preview Result window.
Related concepts
Result Set Filters