Open topic with navigation

TIBCO Business Studio™ - BPM Edition 5.4.0

# 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.

- All RQL is dynamic, so there are design implications because of that. You should be aware that changes to the deployed organization model are reflected in the RQL results set after a period of time.
- Model your system as relevant to the application - this is almost certainly not the same as the durable organization you might see in an organization chart. If you do, you might not need to use RQL in most cases.
- RQL is more complex than using basic participants. Where possible use basic participants - and only use RQL for special cases.
- In both new and existing projects, consider whether you need to use RQL at all, or whether it can be replaced more efficiently with Dynamic Organization Participants. Dynamic Organization Participants allow you to do many actions without the overhead of RQL and are quicker. Dynamic Participants only allow valid actions, and at runtime they perform better than RQL because you are explicitly specifying an internal identifier for an organization entity (GUID). So there is instant lookup, with no parsing. Using Dynamic Organization Participants is the preferred way of dynamically assigning work. See Dynamic Organization Participants.
- Work items allocated using RQL do not appear in any managed work lists as they are not directly associated with specific organizational entities. You should use dynamic performer fields to get the association of work items to organizational entities functionality. See Using a Performer Data Field or Parameter to Dynamically Define a Participant.
- Use RQL when you want to reference LDAP attributes or reference capabilities.
- When you deploy an organization model it is cached in memory. Actions using this in memory cache are quick ( for example, RQL using references to an orgunit in the model). However, RQL that references resources, makes calls to the database and takes time.
- If you are looking at all LDAP attributes on a resource, looking them up in LDAP is time-consuming. If combined with operators such as OR, then it is even slower.
- You need to use RQL for more complicated queries - those involving union, intersect, and qualifying LDAP attributes for example.
- You could produce valid RQL which does not identify any actual resources. You do not receive any warning that this might happen, so must be careful to understand the results of the RQL you are providing.
- RQL cannot refer to Dynamic Organization Units (as these are replaced with dynamic instances at runtime).

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 finds all the resources which have an LDAP attribute of AREA that is equal to DACH. This takes 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.

Did you find this helpful?

Yes No
Great!
Thanks for taking the time to give us some feedback.
Sorry about that

Why wasn't this helpful? (check all that apply)

Could not find what I was looking for
Instructions confusing or unclear
Instructions did not work

Want to tell us more?

Please select at least one option or provide details about the issue!!

Error occurred while submitting feedback.

Error2 occurred while submitting feedback.

TIBCO Business Studio™ - BPM Edition

Copyright © 2015-2023. Cloud Software Group, Inc. All Rights Reserved.