Function: |
Logs mesage with event code when file or url content is updated |
---|
Module Name: |
ContentUpdateChecker |
---|---|
Where to Use? |
In a workflow |
Why to Use? |
To check file or url content is updated so a new task can be run |
Description: |
The ContentUpdateChecker is a module that can be used at the start of a workflow to see if new data is available so other tasks can be run. |
Preconditions: |
File or url should return plain text from which the first line dynamically changes |
Outcome(s): |
Log message with event code and content when new content is found, debug message when no new content is found |
Scheendump(s): |
|
Remark(s): |
|
Available since: |
2014.01 |
Contents
Overview
The ContentUpdateChecker is a module that can be used at the start of a workflow to see if new data is available. If so a log message with event code and the new data when new content is found, a debug message is logged when no new content is found.
Configuration
A configuration example of the content update checker is given below:
<?xml version="1.0" encoding="UTF-8"?> <contentUpdateChecker xmlns="http://www.wldelft.nl/fews" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.wldelft.nl/fews http://fews.wldelft.nl/schemas/version1.0/contentUpdateChecker.xsd"> <url>http://matroos.deltares.nl/direct/get_anal_times.php?database=maps&source=knmi_h11_v72&most_recent=1</url> <user>gebruiker</user> <password>wachtwoord</password> <eventCode>HirlamMeteo.NewData</eventCode> <messagePrefix> New data for hirlam meteo for T0: </messagePrefix> <interval unit="second"/> <timeout unit="minute"/> </contentUpdateChecker>
Sample input and output
11-07-2014 09:54:51 DEBUG - No logging of event code HirlamMeteo.NewContent because data still equals: 201407110600
11-07-2014 09:54:47 DEBUG - No logging of event code HirlamMeteo.NewContent because data still equals: 201407110600
11-07-2014 09:54:45 INFO - HirlamMeteo.NewContent: New data for hirlam meteo for T0: $$201407110600
11-07-2014 09:54:44 DEBUG - No content found for event code: HirlamMeteo.NewContent
11-07-2014 09:51:50 DEBUG - No logging of event code HirlamMeteo.NewData because data still equals: 201407110600
11-07-2014 09:51:49 DEBUG - No logging of event code HirlamMeteo.NewData because data still equals: 201407110600
11-07-2014 09:51:48 DEBUG - Most recent content: 201407110600 found for event code: HirlamMeteo.NewData
Error and warning messages
Known issues
Technical reference
Entry in moduleDescriptors: |
nl.wldelft.fews.system.plugin.contentupdatechecker.ContentUpdateChecker |
---|---|
Link to schema: |
http://fews.wldelft.nl/schemas/version1.0/contentUpdateChecker.xsd |