We are exploring an option of invoking Data Action /api/v2/routing/queues/{queueId}/members?expand=conversationSummary&routingStatus=IDLE from one of the rules in the outbound Ruleset in order to differente IDLE agents from the agents who are in Alerting (this is for the Preview Campaign).
To extract the value for the active attribute for the callback media we use this JSONPath: $.entities[0:25].user.conversationSummary.callback.contactCenter.active
We would like to return one value: the number of the IDLE agents who are not in Alerting segment so we can apply the proper action in the Outbound rule.
For the Preview campaign when the Agent is presented with the contact, his/her routing status is Idle before the call is answered. By expanding the routing API using conversationStatus we can get more details for each of the media and in particular is it active or not, where active is set to "1" when agent is in Alerting segment (an excerpt from the API response is below).
The replaceAll method call uses a regex matching any character not equal to 1 and replacing those with nothing - the result is a string only containing the occurrences of 1, and since it's a string there is a length() method available that returns an integer, giving you the count.
In this example the output contract of the data action would be an object with one integer property "count".
I have not tested this exhaustively but from a quick test it seems to do the trick
This should work regardless of the notation of VTL (formal, silent formal et.c.).