ILOG JRules User Guide > Querying and Reporting > Tasks > Querying > Creating a Query

Not all query constructs are available in Rule Studio and Rule Team Server. To make sure that a query can be run in both Rule Studio or Rule Team Server, use only query constructs that are available in both. For more information, see Query Synchronization Between Rule Studio and Rule Team Server.

To create a query:

  1. In the Rule Explorer, right-click the queries project folder, and click New > Query to open the New Query wizard.
  2. images/Query_Wizard.png
    The Folder field is used to specify a subfolder within the queries folder. Use Browse to select this subfolder or create it.
  3. Type a Name for the query.
  4. Click Finish.
  5. You have now created an entry for the query in the Rule Explorer in the location you specified (see Rule Project Storage) and the Query Editor opens.
    images/Query_Element_editor.png
  6. In the Code part of the Query Editor, define your query by selecting the required project elements, conditions and actions.
  7. You build a query in the same way you build a rule. The project elements, conditions and actions are displayed in drop-down lists when you click on the building blocks. The conditions and actions available in the lists depend on the elements you select (see Query Conditions and Query Actions).
  8. If you want to enter a description or other information about the query, expand the Documentation section and type the required comments.
  9. Save the query.