This pattern detects a condition and generates alerts based on a condition. (e.g., Alarm on high temperature). These alerts can be based on a simple value or more complex conditions such as rate of increase etc.
In Odysseus generating an altert is simply so create a data pipeline where an element reaches an final operator that sends out the value. E.g. if you use the Select operator to filter out every bid that has a lower price than 400 only bids with a value higher or equals 400 is send to the next operator. An altert can be sending an e-mail (in the following example without authentification at the SMTP server). See Transport handler for further ways to output values.
Code Block |
---|
out = SELECT({
predicate = 'price >= 400'
},
nexmark:bid
)
mail = SENDER({
sink='Sink',
wrapper='GenericPush',
transport='SMTP',
protocol='CSV',
datahandler='Tuple',
options=[
['from','alert@test.de'],
['to','receiver@test.de'],
['subject','Price Alert'],
['host','smtp.server.de'],
['tls','false']
]
},
out
) |
More complex filter or conditions can be defined using Pattern operators.