- How do I control which AARI requests my extension runs on?
- How do I control which AARI task my extension runs on?
How do I control which AARI requests my extension runs on?
AARI uses a URL routing approach called “hash” routing. The AARI path/request appears after the
# in the URL.
Therefore, to control which extensions/AARI pages the extension runs on use a Sites rule with an Advanced: Match Rules > URL Patterns rule
The Sites for your extension could contain the root AARI URL:
https://[[Control Room URL]]/aari/*
In the URL Patterns, fill the hash with the URL pattern. In AARI, the request reference follows the pattern processId-runId.
Therefore to match all runs of a given process, provide a regular expression pattern for the reference:
How do I control which AARI task my extension runs on?
AARI does not encode the active task in the URL. Therefore, to restrict an extension to a particular task, you have to check the page content.
To restrict an extension to when a particular task is selected, use the Advanced: Match Rules > Selectors configuration
For example, to restrict by task name, where Task Name is the name of the task
.task-list--selected .task-list__details-title:contains("Task Name")