Body:
I want to run a QAction via a timer-driven group and have it trigger other groups (HTTP/SNMP).
One of the groups is an HTTP request session with a URL that needs to be polled dynamically.
Question:
How can I poll QAction logic and trigger it (including an HTTP request session URL) through groups and a timer, following best-practice patterns or examples?
Hi Deema Mahmud,
You can run QActions on a timer by creating a group of type poll action, and adding this group to your timer:
<Group id="1">
<Name>Run Qaction</Name>
<Type>poll action</Type>
<Content>
<Action>1</Action>
</Content>
</Group>
This Action needs to be of type run action that targets a dummy parameter:
<Action id="1">
<Name>Run QAction</Name>
<On id="1">parameter</On>
<Type>run actions</Type>
</Action>
<Param id="1">
<Name>Run Qaction</Name>
<Type>dummy</Type>
</Param>
This dummy will act as trigger for the QAction:
<QAction id="2" name="My QAction on a timer" encoding="csharp" triggers="1">
To start other groups from the QAction, you can use the protocol.CheckTrigger(2) method to start a trigger:
<Trigger id="2">
<Name>Do HTTP request</Name>
<Type>action</Type>
<Content>
<Id>2</Id>
</Content>
</Trigger>
This trigger starts the action that can execute the group with your http request:
<Action id="2">
<Name>Execute HTTP group</Name>
<On id="2">group</On>
<Type>execute</Type>
</Action>
<Group id="2">
<Name>Poll http request</Name>
<Type>poll</Type>
<Content>
<Session>2</Session>
</Content>
</Group>
This documentation could help you understand the pattern in more detail:
https://docs.dataminer.services/develop/devguide/Connector/InnerWorkingsSLProtocol.html