Best Practices When Using Resource Query Language (RQL)

When using Resource Query Language (RQL) there are a number of issues you should bear in mind to ensure that your processes operate most efficiently when deployed. Planning when designing your process and RQL can save problems later on.

Examples of Usage of RQL

When deciding what RQL queries to make, you should plan to minimize the number of calls they make to the database to make them efficient. For information on what options are available, see Organization Entities.

orgunit(name='KEYTeam').position(name='AdditionalStaff') union orgunit(name='Agency').position(name='Contractor')

This example queries the organization unit called KEYTeam and for positions called "AdditionalStaff". It then joins the result of this to a query of the organization unit called Agency, and the results who have the position Contractor.

orgunit(name='KEYTeam').position(name='Director' or name='Management').capability (name='Language' qualifier='French' )

This example queries the organization unit called KEYTeam, and for positions named either Director or Management where the resource in the position has a capability of French language.

orgunit(name='KEYTeam').position(name='AdditionalStaff') intersect resource(attribute.Area='DACH')

This example will find all the resources which have an LDAP attribute of AREA that is equal to DACH. This will take some time because of the querying of LDAP for all resources defined in BPM.

(orgunit(name='KEYTeam').all() intersect not orgunit(name='Management').position(name='*')) union orgunit(name='Vice Presidents*').position(name='Permanent')

This is an example of a complex RQL statement that takes excessive time, as it makes multiple calls on the database to resolve resource queries.