This snippet will print „hello” to stderr on every machine, when object is updated. It defines new listener and script, that are executed on model change.
Second part (data) adds new object.
version: 2020.02
application:
scripts:
say_hello_script:
timeout: 10
interpreter: /bin/bash
script: |
# This will redirect stdout to stderr to make it visible in application run
>&2 echo Hello $NEW_VALUE
listeners:
say_hello_listener:
call_on:
- authorized_updated
trigger: Minion:[id]:value_name
action: script
script_name: say_hello_script
read_as: "@Person"
models:
Minion:
fields:
name:
can_read: all
can_update: authorized
data:
Minion:
- fields:
name:
value: Bob
- fields:
name:
value: Kevin
- fields:
name:
value: Steward