The TIX Alarm API provides functionality for setting, getting and removing alarms. Alarm API allows you to schedule actions (like sending mail) when a import of a EPCISDocument meets a set of alarm conditions (triggers).

Resources

POST /alarm - create new alarm

Create a new alarm by uploading a DRL (Drools Rule File), see Rule Language Reference for more details about the DRL. See Alarms, triggers and actions for details about the triggers and actions available for the alarm system.

POST /alarm
rule "name"
attributes
when
LHS
then
RHS
end

GET /alarm - get alarms

Get details about one or more alarms created by the authenticated user

Parameter

Description

 

id

The id(s) to get details about, optional

query

pageSize

Specifies how many alarms to include on each page, optional

query

pageNumber

Specifies which page to retrieve. If not specified it returns the first page. Counting from 1 to Integer.MAX_VALUE / pageSize, optional

query

username

The username(s) to get details about, optional, reserved for ADMIN users

query

GET /alarm
<?xml version="1.0" encoding="UTF-8"?>
<ns3:rules xmlns:ns3="urn:epcglobal:epcis-query:xsd:1">
<rule>
<id>#{ID}</id>
<created>2013-07-23T10:01:05.827+02:00</created>
<username>administrator</username>
<node>0800000024000011</node>
<drl>package com.tracetracker.tix.alarms.process
rule "Send mail when ADD action events are imported"
when
$bn : DomContext( xpath("//ObjectEvent/action" ).stringValue() &lt;= "ADD")
then
$bn.mail().send( "user@domain.com", "Action ADD", "Add Events imported" )
end
</drl>
</rule>
</ns3:rules>

DELETE /alarm - delete alarms

Delete one or more alarms created by authenticated user

Parameter

Description

 

id

Id(s) of the alarm to remove, required

query

username

The username (owner) of the alarms, optional, reserved for ADMIN users

query

DELETE /alarm?id=x&id=y
<?xml version="1.0" encoding="UTF-8"?>
<ns3:rules xmlns:ns3="urn:epcglobal:epcis-query:xsd:1" />

POST /alarm/validate - validate alarm

Validate a alarm without adding it to the TIX.

POST /alarm/validate - example response
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<epcisq:rules>
<rule>
<created>2013-07-23T13:46:43.216+02:00</created>
<username>administrator</username>
<node>0800000033000013</node>
<drl>package com.tracetracker.tix.alarms.process
rule &quot;Send mail when ADD action events are imported&quot;
when
$bn : DomContext( xpath(&quot;//ObjectEvent/action&quot; ).stringValue() &lt;= &quot;ADD&quot; )
then
$bn.mail().send( &quot;user@domain.com&quot;, &quot;Action ADD&quot;, &quot;Add Events imported&quot; )
end</drl>
</rule>
<error>
<serverity>ERROR</serverity>
<message>Rule Compilation error Syntax error, insert &quot;;&quot; to complete Statement</message>
<lines>[3]</lines>
</error>
</epcisq:rules>

GET /alarm/log - alarm action log

Get the action log for one or more rules. The action log contains details about what alarm rule triggered the action, the time it was completed and the status.

Parameter

Description

 

alarmId

The id(s) to get log details about, optional

query

geTimeTriggered  

Filter when the action was triggered, greater or equal, optional

query

leTimeTriggered  

Filter when the action was trigger, less or equal, optional

query

geTimeCompleted 

Filter when the action was completed, greater or equal, optional

query

leTimeCompleted 

Filter when the action was completed, less or equal, optional

query

pageSize 

Specify how many log entries to include on one page, optional

query

pageNumber 

Specifies which page to retrieve. If not specified it returns the first page. Counting from 1 to Integer.MAX_VALUE / pageSize, optional

query

orderBy

The field to order the result by, default is timeTriggered, optional

value

Description

action

order by action

alarmid

order by alarm id

id

order by id

ruleName

order by rule name

timeCompleted

order by when alarm action completed

timeTriggered

order by when alarm was triggered

query

asc

Ordering will be ascending if true, default is false, optional

query

username

The username (owner) of the alarms, optional, reserved for ADMIN users

query