The following are examples of uses for the simple filter:
Configure an action that executes a command when a device meets filter requirements. For example, create a folder that contains only printers with a page count greater than 10,000. When the page count of a monitored printer exceeds 10,000, it is added to the folder.
Monitor only printers with an installed flash device. For example, if a folder contains only printers with an installed flash device, and a flash device is removed from a monitored printer, it is removed from that folder. The filter automatically updates the folder when the printer fails to meet the filter requirements.
Use the “with a delay of” option to delay the execution of an action for a specified amount of time after a device is added or removed from a folder.
Choose the “Trigger on Active” filter to set an action to only execute a command when a condition becomes Active. For example, if you are monitoring the Paper Tray Missing event and someone removes a tray from a monitored printer, the printer generates a Paper Tray Missing event with a state of Active. The Active state satisfies the condition of the filter and the specified action is executed. When the paper tray is replaced, the printer generates another Paper Tray Missing event with a state of Clear. The Clear state does not satisfy the condition of the filter and the action is not executed.
Choose the “Trigger on Either Active or Clear” filter to set an action to execute each time a condition becomes Active or Clear. For example, use the filter to keep a log of all printer paper jams to determine the average time it takes to clear a jam. When a paper jam occurs, the printer generates an event with a state of Active. This satisfies the condition of the filter and executes the action. When the paper jam is cleared, the printer generates another event with a state of Clear. This event also satisfies the condition of the filter and executes the action. There are now two lines on the log file, one with the time at which the paper jam occurred and another with the time it was cleared.
Use a custom filter to define how an action executes. Upload a script file or write a new one. MarkVision Messenger provides a very simple scripting language to define filters. The following is a complete list of the statements and conditions available for use in a custom filter:
(Condition)
(Condition)
(Condition)
{ StatementList }
(Condition_1...Condition_n)
(Condition_1...Condition_n)
(key, value)
(key, value)
The following is an example of the script representation of the built-in “Trigger on Active filter”:
IfThen (EventDataIs("state", "ACTIVE"))
DistributeThe effect of the condition is to ask the event for the value of the event: state keyword. This keyword can be inserted into command lines and e-mail messages. The statement executes the next statement if the condition is true. An condition is true if the value of the keyword (state) matches the given value (ACTIVE). The next statement, , causes the command to execute.
The following is an example of script used when the “Trigger on Active filter” action is delayed by 30 seconds:
{
WaitUntil (TimeIsAfter(30))
IfThen(EventDataIs("state", "ACTIVE"))
Distribute
}The braces ({}) are used to group statements into a list. They were not needed in the previous example because the and following statements were treated as a single statement.
The statement causes the script to pause execution until the condition is true. The condition checks for true only after the specified number of seconds has passed. If the event is still active after 30 seconds, the statement executes the command.
The following is a script representation of the built-in “Trigger on Either Active or Clear” filter for these circumstances: the Paper Tray Missing event is selected for Tray 3, there is a 20-minute delay before the command is executes, and the command repeats every 20 minutes if the condition remains Active.
While (And(EventDataIs("state", "ACTIVE"), EventDataIs("location", "Tray 3")))
{
WaitUntil(TimeIsAfter(1200))
IfThen(EventDataIs("state", "ACTIVE"))
Distribute
}In this example, was used to build a compound condition. The While loop is only entered or repeated if the event is active for Tray 3. The code within the loop is the same as the code for the “Trigger on Active” filter, except the condition is set to wait 1200 seconds (20 minutes).