Skip to content

An open-source, privacy-first, self-hosted knowledge workspace where humans and AI agents work together 开源、隐私优先、自托管的知识工作空间,让人与智能体在此协作

:sparkles: Notify committed database automation results https://github.com/siyuan-note/siyuan/issues/20642

Danielb1d5502b6a30
diff --git a/app/appearance/langs/ar.json b/app/appearance/langs/ar.json
index 5c962df06c..10946900cc 100644
--- a/app/appearance/langs/ar.json
+++ b/app/appearance/langs/ar.json
@@ -1,4 +1,12 @@
{
+ "automationNotifySuccess": "الإشعار عند النجاح",
+ "automationResultRule": "اكتملت الأتمتة «${1}»: ${2}",
+ "automationResultSummary": "اكتملت أتمتة قاعدة البيانات: ${1}",
+ "automationResultAdded": "العناصر المضافة: ${1}",
+ "automationResultUpdated": "العناصر المحدّثة: ${1}",
+ "automationResultCollected": "الكتل المجمّعة: ${1}",
+ "automationResultRemoved": "العناصر المُزالة: ${1}",
+ "automationResultSeparator": "؛ ",
"cleanUnusedAssets": "تنظيف الموارد غير المشار إليها",
"tableSelectRange": "تحديد نطاق خلايا",
"listMindmapConnectors": "خطوط التوصيل",
diff --git a/app/appearance/langs/de.json b/app/appearance/langs/de.json
index e45c4381b2..e401b7cc1d 100644
--- a/app/appearance/langs/de.json
+++ b/app/appearance/langs/de.json
@@ -1,4 +1,12 @@
{
+ "automationNotifySuccess": "Bei Erfolg benachrichtigen",
+ "automationResultRule": "Automatisierung „${1}“ abgeschlossen: ${2}",
+ "automationResultSummary": "Datenbankautomatisierungen abgeschlossen: ${1}",
+ "automationResultAdded": "Hinzugefügte Einträge: ${1}",
+ "automationResultUpdated": "Aktualisierte Einträge: ${1}",
+ "automationResultCollected": "Gesammelte Blöcke: ${1}",
+ "automationResultRemoved": "Entfernte Einträge: ${1}",
+ "automationResultSeparator": "; ",
"cleanUnusedAssets": "Nicht referenzierte Ressourcen bereinigen",
"tableSelectRange": "Zellbereich auswählen",
"listMindmapConnectors": "Verbindungslinien",
diff --git a/app/appearance/langs/en.json b/app/appearance/langs/en.json
index 8ab6ac4ea0..655bc52f52 100644
--- a/app/appearance/langs/en.json
+++ b/app/appearance/langs/en.json
@@ -1,4 +1,12 @@
{
+ "automationNotifySuccess": "Notify on success",
+ "automationResultRule": "Automation \"${1}\" completed: ${2}",
+ "automationResultSummary": "Database automations completed: ${1}",
+ "automationResultAdded": "Entries added: ${1}",
+ "automationResultUpdated": "Entries updated: ${1}",
+ "automationResultCollected": "Blocks collected: ${1}",
+ "automationResultRemoved": "Entries removed: ${1}",
+ "automationResultSeparator": "; ",
"cleanUnusedAssets": "Clean up unreferenced assets",
"tableSelectRange": "Select cell range",
"listMindmapConnectors": "Connectors",
diff --git a/app/appearance/langs/es.json b/app/appearance/langs/es.json
index 36723b88b1..39874a2122 100644
--- a/app/appearance/langs/es.json
+++ b/app/appearance/langs/es.json
@@ -1,4 +1,12 @@
{
+ "automationNotifySuccess": "Notificar al completarse correctamente",
+ "automationResultRule": "Automatización «${1}» completada: ${2}",
+ "automationResultSummary": "Automatizaciones de la base de datos completadas: ${1}",
+ "automationResultAdded": "Entradas añadidas: ${1}",
+ "automationResultUpdated": "Entradas actualizadas: ${1}",
+ "automationResultCollected": "Bloques recopilados: ${1}",
+ "automationResultRemoved": "Entradas retiradas: ${1}",
+ "automationResultSeparator": "; ",
"cleanUnusedAssets": "Limpiar recursos sin referencias",
"tableSelectRange": "Seleccionar rango de celdas",
"listMindmapConnectors": "Conectores",
diff --git a/app/appearance/langs/fr.json b/app/appearance/langs/fr.json
index 5faff3d935..8ddeb92951 100644
--- a/app/appearance/langs/fr.json
+++ b/app/appearance/langs/fr.json
@@ -1,4 +1,12 @@
{
+ "automationNotifySuccess": "Notifier en cas de succès",
+ "automationResultRule": "Automatisation « ${1} » terminée : ${2}",
+ "automationResultSummary": "Automatisations de la base de données terminées : ${1}",
+ "automationResultAdded": "Entrées ajoutées : ${1}",
+ "automationResultUpdated": "Entrées mises à jour : ${1}",
+ "automationResultCollected": "Blocs collectés : ${1}",
+ "automationResultRemoved": "Entrées retirées : ${1}",
+ "automationResultSeparator": " ; ",
"cleanUnusedAssets": "Nettoyer les ressources non référencées",
"tableSelectRange": "Sélectionner une plage de cellules",
"listMindmapConnectors": "Connecteurs",
diff --git a/app/appearance/langs/he.json b/app/appearance/langs/he.json
index 86628ce9a3..15a7063847 100644
--- a/app/appearance/langs/he.json
+++ b/app/appearance/langs/he.json
@@ -1,4 +1,12 @@
{
+ "automationNotifySuccess": "הודעה לאחר הצלחה",
+ "automationResultRule": "האוטומציה „${1}” הושלמה: ${2}",
+ "automationResultSummary": "האוטומציות של מסד הנתונים הושלמו: ${1}",
+ "automationResultAdded": "רשומות שנוספו: ${1}",
+ "automationResultUpdated": "רשומות שעודכנו: ${1}",
+ "automationResultCollected": "בלוקים שנאספו: ${1}",
+ "automationResultRemoved": "רשומות שהוסרו: ${1}",
+ "automationResultSeparator": "; ",
"cleanUnusedAssets": "ניקוי משאבים ללא הפניות",
"tableSelectRange": "בחירת טווח תאים",
"listMindmapConnectors": "קווי חיבור",
diff --git a/app/appearance/langs/hi.json b/app/appearance/langs/hi.json
index 3f9ac1547b..417a9f1934 100644
--- a/app/appearance/langs/hi.json
+++ b/app/appearance/langs/hi.json
@@ -1,4 +1,12 @@
{
+ "automationNotifySuccess": "सफल होने पर सूचना दें",
+ "automationResultRule": "स्वचालन “${1}” पूरा हुआ: ${2}",
+ "automationResultSummary": "डेटाबेस स्वचालन पूरा हुआ: ${1}",
+ "automationResultAdded": "जोड़ी गई प्रविष्टियाँ: ${1}",
+ "automationResultUpdated": "अपडेट की गई प्रविष्टियाँ: ${1}",
+ "automationResultCollected": "एकत्र किए गए ब्लॉक: ${1}",
+ "automationResultRemoved": "हटाई गई प्रविष्टियाँ: ${1}",
+ "automationResultSeparator": "; ",
"cleanUnusedAssets": "असंदर्भित संसाधनों को साफ़ करें",
"tableSelectRange": "सेल श्रेणी चुनें",
"listMindmapConnectors": "कनेक्टर",
diff --git a/app/appearance/langs/id.json b/app/appearance/langs/id.json
index 05900e7e29..b173f29860 100644
--- a/app/appearance/langs/id.json
+++ b/app/appearance/langs/id.json
@@ -1,4 +1,12 @@
{
+ "automationNotifySuccess": "Beri tahu saat berhasil",
+ "automationResultRule": "Otomatisasi “${1}” selesai: ${2}",
+ "automationResultSummary": "Otomatisasi basis data selesai: ${1}",
+ "automationResultAdded": "Entri ditambahkan: ${1}",
+ "automationResultUpdated": "Entri diperbarui: ${1}",
+ "automationResultCollected": "Blok dikumpulkan: ${1}",
+ "automationResultRemoved": "Entri dikeluarkan: ${1}",
+ "automationResultSeparator": "; ",
"cleanUnusedAssets": "Bersihkan aset tanpa referensi",
"tableSelectRange": "Pilih rentang sel",
"listMindmapConnectors": "Penghubung",
diff --git a/app/appearance/langs/it.json b/app/appearance/langs/it.json
index e6b3b71b49..eb0b6d9ba4 100644
--- a/app/appearance/langs/it.json
+++ b/app/appearance/langs/it.json
@@ -1,4 +1,12 @@
{
+ "automationNotifySuccess": "Notifica in caso di successo",
+ "automationResultRule": "Automazione «${1}» completata: ${2}",
+ "automationResultSummary": "Automazioni del database completate: ${1}",
+ "automationResultAdded": "Voci aggiunte: ${1}",
+ "automationResultUpdated": "Voci aggiornate: ${1}",
+ "automationResultCollected": "Blocchi raccolti: ${1}",
+ "automationResultRemoved": "Voci rimosse: ${1}",
+ "automationResultSeparator": "; ",
"cleanUnusedAssets": "Pulisci le risorse senza riferimenti",
"tableSelectRange": "Seleziona intervallo di celle",
"listMindmapConnectors": "Collegamenti",
diff --git a/app/appearance/langs/ja.json b/app/appearance/langs/ja.json
index 18d0344cdf..f98dd4afc4 100644
--- a/app/appearance/langs/ja.json
+++ b/app/appearance/langs/ja.json
@@ -1,4 +1,12 @@
{
+ "automationNotifySuccess": "実行成功時に通知",
+ "automationResultRule": "自動化「${1}」を実行しました:${2}",
+ "automationResultSummary": "データベースの自動化が完了しました:${1}",
+ "automationResultAdded": "追加項目数:${1}",
+ "automationResultUpdated": "更新項目数:${1}",
+ "automationResultCollected": "収集ブロック数:${1}",
+ "automationResultRemoved": "削除項目数:${1}",
+ "automationResultSeparator": "、",
"cleanUnusedAssets": "未参照のリソースをクリーンアップ",
"tableSelectRange": "セル範囲を選択",
"listMindmapConnectors": "接続線",
diff --git a/app/appearance/langs/ko.json b/app/appearance/langs/ko.json
index ca42f1c585..f758a72abf 100644
--- a/app/appearance/langs/ko.json
+++ b/app/appearance/langs/ko.json
@@ -1,4 +1,12 @@
{
+ "automationNotifySuccess": "실행 성공 시 알림",
+ "automationResultRule": "자동화 “${1}” 실행 완료: ${2}",
+ "automationResultSummary": "데이터베이스 자동화 실행 완료: ${1}",
+ "automationResultAdded": "추가된 항목: ${1}",
+ "automationResultUpdated": "업데이트된 항목: ${1}",
+ "automationResultCollected": "수집된 블록: ${1}",
+ "automationResultRemoved": "제거된 항목: ${1}",
+ "automationResultSeparator": "; ",
"cleanUnusedAssets": "참조되지 않은 리소스 정리",
"tableSelectRange": "셀 범위 선택",
"listMindmapConnectors": "연결선",
diff --git a/app/appearance/langs/nl.json b/app/appearance/langs/nl.json
index 9727158570..628a9cce5c 100644
--- a/app/appearance/langs/nl.json
+++ b/app/appearance/langs/nl.json
@@ -1,4 +1,12 @@
{
+ "automationNotifySuccess": "Melden bij succes",
+ "automationResultRule": "Automatisering ‘${1}’ voltooid: ${2}",
+ "automationResultSummary": "Databaseautomatiseringen voltooid: ${1}",
+ "automationResultAdded": "Toegevoegde items: ${1}",
+ "automationResultUpdated": "Bijgewerkte items: ${1}",
+ "automationResultCollected": "Verzamelde blokken: ${1}",
+ "automationResultRemoved": "Verwijderde items: ${1}",
+ "automationResultSeparator": "; ",
"cleanUnusedAssets": "Niet-verwezen bronnen opruimen",
"tableSelectRange": "Celbereik selecteren",
"listMindmapConnectors": "Verbindingslijnen",
diff --git a/app/appearance/langs/pl.json b/app/appearance/langs/pl.json
index ee21b6dbc0..189148aeef 100644
--- a/app/appearance/langs/pl.json
+++ b/app/appearance/langs/pl.json
@@ -1,4 +1,12 @@
{
+ "automationNotifySuccess": "Powiadamiaj po pomyślnym wykonaniu",
+ "automationResultRule": "Automatyzacja „${1}” zakończona: ${2}",
+ "automationResultSummary": "Automatyzacje bazy danych zakończone: ${1}",
+ "automationResultAdded": "Dodane wpisy: ${1}",
+ "automationResultUpdated": "Zaktualizowane wpisy: ${1}",
+ "automationResultCollected": "Zebrane bloki: ${1}",
+ "automationResultRemoved": "Usunięte wpisy: ${1}",
+ "automationResultSeparator": "; ",
"cleanUnusedAssets": "Usuń nieużywane zasoby",
"tableSelectRange": "Wybierz zakres komórek",
"listMindmapConnectors": "Łączniki",
diff --git a/app/appearance/langs/pt-BR.json b/app/appearance/langs/pt-BR.json
index 846741f0cd..38da3a6661 100644
--- a/app/appearance/langs/pt-BR.json
+++ b/app/appearance/langs/pt-BR.json
@@ -1,4 +1,12 @@
{
+ "automationNotifySuccess": "Notificar em caso de sucesso",
+ "automationResultRule": "Automação “${1}” concluída: ${2}",
+ "automationResultSummary": "Automações do banco de dados concluídas: ${1}",
+ "automationResultAdded": "Entradas adicionadas: ${1}",
+ "automationResultUpdated": "Entradas atualizadas: ${1}",
+ "automationResultCollected": "Blocos coletados: ${1}",
+ "automationResultRemoved": "Entradas removidas: ${1}",
+ "automationResultSeparator": "; ",
"cleanUnusedAssets": "Limpar recursos sem referências",
"tableSelectRange": "Selecionar intervalo de células",
"listMindmapConnectors": "Conectores",
diff --git a/app/appearance/langs/ru.json b/app/appearance/langs/ru.json
index 670a2ea6e1..a61530c236 100644
--- a/app/appearance/langs/ru.json
+++ b/app/appearance/langs/ru.json
@@ -1,4 +1,12 @@
{
+ "automationNotifySuccess": "Уведомлять об успешном выполнении",
+ "automationResultRule": "Автоматизация «${1}» выполнена: ${2}",
+ "automationResultSummary": "Автоматизации базы данных выполнены: ${1}",
+ "automationResultAdded": "Добавлено записей: ${1}",
+ "automationResultUpdated": "Обновлено записей: ${1}",
+ "automationResultCollected": "Собрано блоков: ${1}",
+ "automationResultRemoved": "Удалено записей: ${1}",
+ "automationResultSeparator": "; ",
"cleanUnusedAssets": "Очистить ресурсы без ссылок",
"tableSelectRange": "Выбрать диапазон ячеек",
"listMindmapConnectors": "Соединительные линии",
diff --git a/app/appearance/langs/sk.json b/app/appearance/langs/sk.json
index 2384718816..bad81b1297 100644
--- a/app/appearance/langs/sk.json
+++ b/app/appearance/langs/sk.json
@@ -1,4 +1,12 @@
{
+ "automationNotifySuccess": "Upozorniť pri úspechu",
+ "automationResultRule": "Automatizácia „${1}“ dokončená: ${2}",
+ "automationResultSummary": "Automatizácie databázy dokončené: ${1}",
+ "automationResultAdded": "Pridané položky: ${1}",
+ "automationResultUpdated": "Aktualizované položky: ${1}",
+ "automationResultCollected": "Zhromaždené bloky: ${1}",
+ "automationResultRemoved": "Odstránené položky: ${1}",
+ "automationResultSeparator": "; ",
"cleanUnusedAssets": "Vyčistiť neodkazované zdroje",
"tableSelectRange": "Vybrať rozsah buniek",
"listMindmapConnectors": "Spojnice",
diff --git a/app/appearance/langs/sr.json b/app/appearance/langs/sr.json
index 8a126a4ccb..2ca8427084 100644
--- a/app/appearance/langs/sr.json
+++ b/app/appearance/langs/sr.json
@@ -1,4 +1,12 @@
{
+ "automationNotifySuccess": "Обавести о успешном извршавању",
+ "automationResultRule": "Аутоматизација „${1}“ је завршена: ${2}",
+ "automationResultSummary": "Аутоматизације базе података су завршене: ${1}",
+ "automationResultAdded": "Додате ставке: ${1}",
+ "automationResultUpdated": "Ажуриране ставке: ${1}",
+ "automationResultCollected": "Прикупљени блокови: ${1}",
+ "automationResultRemoved": "Уклоњене ставке: ${1}",
+ "automationResultSeparator": "; ",
"cleanUnusedAssets": "Очисти ресурсе без референци",
"tableSelectRange": "Изабери опсег ћелија",
"listMindmapConnectors": "Линије повезивања",
diff --git a/app/appearance/langs/th.json b/app/appearance/langs/th.json
index 283149bd0d..db77a9ac99 100644
--- a/app/appearance/langs/th.json
+++ b/app/appearance/langs/th.json
@@ -1,4 +1,12 @@
{
+ "automationNotifySuccess": "แจ้งเตือนเมื่อสำเร็จ",
+ "automationResultRule": "ระบบอัตโนมัติ “${1}” ทำงานเสร็จแล้ว: ${2}",
+ "automationResultSummary": "ระบบอัตโนมัติของฐานข้อมูลทำงานเสร็จแล้ว: ${1}",
+ "automationResultAdded": "รายการที่เพิ่ม: ${1}",
+ "automationResultUpdated": "รายการที่อัปเดต: ${1}",
+ "automationResultCollected": "บล็อกที่รวบรวม: ${1}",
+ "automationResultRemoved": "รายการที่นำออก: ${1}",
+ "automationResultSeparator": "; ",
"cleanUnusedAssets": "ล้างทรัพยากรที่ไม่มีการอ้างอิง",
"tableSelectRange": "เลือกช่วงเซลล์",
"listMindmapConnectors": "เส้นเชื่อม",
diff --git a/app/appearance/langs/tr.json b/app/appearance/langs/tr.json
index 77185a39c3..e45042c5d2 100644
--- a/app/appearance/langs/tr.json
+++ b/app/appearance/langs/tr.json
@@ -1,4 +1,12 @@
{
+ "automationNotifySuccess": "Başarıyla tamamlandığında bildir",
+ "automationResultRule": "“${1}” otomasyonu tamamlandı: ${2}",
+ "automationResultSummary": "Veritabanı otomasyonları tamamlandı: ${1}",
+ "automationResultAdded": "Eklenen kayıtlar: ${1}",
+ "automationResultUpdated": "Güncellenen kayıtlar: ${1}",
+ "automationResultCollected": "Toplanan bloklar: ${1}",
+ "automationResultRemoved": "Çıkarılan kayıtlar: ${1}",
+ "automationResultSeparator": "; ",
"cleanUnusedAssets": "Başvurulmayan kaynakları temizle",
"tableSelectRange": "Hücre aralığı seç",
"listMindmapConnectors": "Bağlantı çizgileri",
diff --git a/app/appearance/langs/uk.json b/app/appearance/langs/uk.json
index 49aa760a67..ade57ed943 100644
--- a/app/appearance/langs/uk.json
+++ b/app/appearance/langs/uk.json
@@ -1,4 +1,12 @@
{
+ "automationNotifySuccess": "Сповіщати про успішне виконання",
+ "automationResultRule": "Автоматизацію «${1}» виконано: ${2}",
+ "automationResultSummary": "Автоматизації бази даних виконано: ${1}",
+ "automationResultAdded": "Додано записів: ${1}",
+ "automationResultUpdated": "Оновлено записів: ${1}",
+ "automationResultCollected": "Зібрано блоків: ${1}",
+ "automationResultRemoved": "Вилучено записів: ${1}",
+ "automationResultSeparator": "; ",
"cleanUnusedAssets": "Очистити ресурси без посилань",
"tableSelectRange": "Вибрати діапазон клітинок",
"listMindmapConnectors": "З’єднувальні лінії",
diff --git a/app/appearance/langs/zh-CN.json b/app/appearance/langs/zh-CN.json
index ed10ff21e1..8a5fa1866c 100644
--- a/app/appearance/langs/zh-CN.json
+++ b/app/appearance/langs/zh-CN.json
@@ -1,4 +1,12 @@
{
+ "automationNotifySuccess": "执行成功时通知",
+ "automationResultRule": "自动化「${1}」已执行:${2}",
+ "automationResultSummary": "数据库自动化执行完成:${1}",
+ "automationResultAdded": "新增 ${1} 个条目",
+ "automationResultUpdated": "更新 ${1} 个条目",
+ "automationResultCollected": "收集 ${1} 个块",
+ "automationResultRemoved": "移出 ${1} 个条目",
+ "automationResultSeparator": ",",
"cleanUnusedAssets": "清理未引用资源",
"tableSelectRange": "选择区域",
"listMindmapConnectors": "连线",
diff --git a/app/appearance/langs/zh-TW.json b/app/appearance/langs/zh-TW.json
index 97bf1b3ea1..3664135af4 100644
--- a/app/appearance/langs/zh-TW.json
+++ b/app/appearance/langs/zh-TW.json
@@ -1,4 +1,12 @@
{
+ "automationNotifySuccess": "執行成功時通知",
+ "automationResultRule": "自動化「${1}」已執行:${2}",
+ "automationResultSummary": "資料庫自動化執行完成:${1}",
+ "automationResultAdded": "新增 ${1} 個項目",
+ "automationResultUpdated": "更新 ${1} 個項目",
+ "automationResultCollected": "收集 ${1} 個區塊",
+ "automationResultRemoved": "移出 ${1} 個項目",
+ "automationResultSeparator": ",",
"cleanUnusedAssets": "清理未引用資源",
"tableSelectRange": "選取區域",
"listMindmapConnectors": "連線",
diff --git a/app/guide/20210808180117-6v0mkxr/20200923234011-ieuun1p/20210808180303-xaduj2o/20240208172514-9dsv6na.sy b/app/guide/20210808180117-6v0mkxr/20200923234011-ieuun1p/20210808180303-xaduj2o/20240208172514-9dsv6na.sy
index c05c6bf2bf..f501ccad5a 100644
--- a/app/guide/20210808180117-6v0mkxr/20200923234011-ieuun1p/20210808180303-xaduj2o/20240208172514-9dsv6na.sy
+++ b/app/guide/20210808180117-6v0mkxr/20200923234011-ieuun1p/20210808180303-xaduj2o/20240208172514-9dsv6na.sy
@@ -3900,6 +3900,20 @@
}
]
},
+ {
+ "ID": "20261017202044-s3bkzez",
+ "Type": "NodeParagraph",
+ "Properties": {
+ "id": "20261017202044-s3bkzez",
+ "updated": "20261017202044"
+ },
+ "Children": [
+ {
+ "Type": "NodeText",
+ "Data": "Notify on success is enabled by default and can be set independently for each rule. It reports actual additions, updates, collections, or removals after the entire transaction commits; several rules share one summary, counting only rules with notifications enabled. Updating several fields of one entry counts as one updated entry. Block collection and removal use the same rule setting. Turning notifications off does not stop execution or hide errors. Unmatched conditions, missing targets, unchanged values, repeated matches, manual collection, undo, redo, and failed transactions do not produce success messages."
+ }
+ ]
+ },
{
"ID": "20261002224707-ayryj7q",
"Type": "NodeParagraph",
diff --git a/app/guide/20210808180117-czj9bvb/20200812220555-lj3enxa/20210808180321-hbvl5c2/20240208113259-nykkvaq.sy b/app/guide/20210808180117-czj9bvb/20200812220555-lj3enxa/20210808180321-hbvl5c2/20240208113259-nykkvaq.sy
index 353e9ae962..ad1e9b0d27 100644
--- a/app/guide/20210808180117-czj9bvb/20200812220555-lj3enxa/20210808180321-hbvl5c2/20240208113259-nykkvaq.sy
+++ b/app/guide/20210808180117-czj9bvb/20200812220555-lj3enxa/20210808180321-hbvl5c2/20240208113259-nykkvaq.sy
@@ -3900,6 +3900,20 @@
}
]
},
+ {
+ "ID": "20261017202044-0g91x8n",
+ "Type": "NodeParagraph",
+ "Properties": {
+ "id": "20261017202044-0g91x8n",
+ "updated": "20261017202044"
+ },
+ "Children": [
+ {
+ "Type": "NodeText",
+ "Data": "「执行成功时通知」默认开启,每条规则可独立设置。只有自动新增、更新、收集或移出实际产生变化,且整个事务提交成功后才提示;同一事务合并为一条消息,仅统计开启通知的规则,同一条目的多个字段更新按一个条目统计。普通块的收集和移出共用该规则的通知开关。关闭通知不会停止执行,也不会隐藏错误。条件不符、没有目标、值未改变、重复匹配、手动收集、撤销重做及失败事务均不发送成功通知。"
+ }
+ ]
+ },
{
"ID": "20261002224707-6us9kvt",
"Type": "NodeParagraph",
diff --git a/app/guide/20211226090932-5lcq56f/20211226115423-d5z1joq/20211226121203-rjjngpz/20240208171522-y7dxcno.sy b/app/guide/20211226090932-5lcq56f/20211226115423-d5z1joq/20211226121203-rjjngpz/20240208171522-y7dxcno.sy
index abd405173b..a5e4cc3387 100644
--- a/app/guide/20211226090932-5lcq56f/20211226115423-d5z1joq/20211226121203-rjjngpz/20240208171522-y7dxcno.sy
+++ b/app/guide/20211226090932-5lcq56f/20211226115423-d5z1joq/20211226121203-rjjngpz/20240208171522-y7dxcno.sy
@@ -3900,6 +3900,20 @@
}
]
},
+ {
+ "ID": "20261017202044-5hl3pi0",
+ "Type": "NodeParagraph",
+ "Properties": {
+ "id": "20261017202044-5hl3pi0",
+ "updated": "20261017202044"
+ },
+ "Children": [
+ {
+ "Type": "NodeText",
+ "Data": "「執行成功時通知」預設開啟,每條規則可獨立設定。只有自動新增、更新、收集或移出實際產生變化,且整個交易提交成功後才提示;同一交易合併為一則訊息,僅統計開啟通知的規則,同一項目的多個欄位更新按一個項目統計。普通區塊的收集和移出共用該規則的通知開關。關閉通知不會停止執行,也不會隱藏錯誤。條件不符、沒有目標、值未改變、重複匹配、手動收集、復原重做及失敗交易均不傳送成功通知。"
+ }
+ ]
+ },
{
"ID": "20261002224707-81zsovc",
"Type": "NodeParagraph",
diff --git a/app/guide/20240530133126-axarxgx/20240530101000-4qitucx/20240530101000-g3ugxml/20240530101000-3eaevtp.sy b/app/guide/20240530133126-axarxgx/20240530101000-4qitucx/20240530101000-g3ugxml/20240530101000-3eaevtp.sy
index eb6db07dd8..36c18c89cb 100644
--- a/app/guide/20240530133126-axarxgx/20240530101000-4qitucx/20240530101000-g3ugxml/20240530101000-3eaevtp.sy
+++ b/app/guide/20240530133126-axarxgx/20240530101000-4qitucx/20240530101000-g3ugxml/20240530101000-3eaevtp.sy
@@ -3910,6 +3910,20 @@
}
]
},
+ {
+ "ID": "20261017202044-wiy1os1",
+ "Type": "NodeParagraph",
+ "Properties": {
+ "id": "20261017202044-wiy1os1",
+ "updated": "20261017202044"
+ },
+ "Children": [
+ {
+ "Type": "NodeText",
+ "Data": "「実行成功時に通知」は既定で有効で、ルールごとに設定できます。自動追加・更新・収集・削除による実際の変更を、トランザクション全体の確定後に通知します。同じトランザクションの結果は一つにまとめ、通知を有効にしたルールだけを集計します。一つの項目の複数フィールド更新は一項目として数えます。通常ブロックの収集と削除は同じ設定を使います。通知を無効にしても実行を止めず、エラーも隠しません。条件不一致、対象なし、値の変更なし、継続した一致、手動収集、元に戻す、やり直し、失敗時は成功通知を送りません。"
+ }
+ ]
+ },
{
"ID": "20261002224707-1kdcd41",
"Type": "NodeParagraph",
diff --git a/app/src/protyle/render/av/automation.ts b/app/src/protyle/render/av/automation.ts
index 4c10c3b2b3..05f187eca3 100644
--- a/app/src/protyle/render/av/automation.ts
+++ b/app/src/protyle/render/av/automation.ts
@@ -314,6 +314,7 @@ export const openAutomationMenu = async (options: {
body.innerHTML = `<div class="ft__on-surface ft__smaller av__automation-tip">${lang.automationTip}</div>
<div class="av__automation-row">${rule ? `<button type="button" class="b3-button b3-button--cancel fn__flex-1 av__automation-source-action" data-action="rules" aria-label="${escapeAttr(lang.automationRule)}"><span class="fn__ellipsis" data-rule-name>${escapeHtml(rule.name)}</span><svg><use xlink:href="#iconDown"></use></svg></button><input type="checkbox" class="b3-switch ariaLabel" aria-label="${escapeAttr(lang.enable)}" data-position="north" data-enabled${rule.enabled ? " checked" : ""}>` : ""}${iconButton("add-rule", "iconAdd", lang.new)}</div>
${rule ? `
+<label class="av__automation-row"><span class="fn__flex-1">${lang.automationNotifySuccess}</span><input type="checkbox" class="b3-switch" data-notify-success${rule.notifyOnSuccess !== false ? " checked" : ""}></label>
<div class="ft__on-surface ft__smaller av__automation-tip">${lang.automationAutoSaveTip}</div>
<div class="ft__on-surface ft__smaller fn__none av__automation-status" role="status" data-status></div>
<section class="av__automation-section"><div class="av__automation-row ft__b"><span class="ft__on-surface av__automation-section-index">1</span><span class="av__automation-section-title">${lang.automationWhen}</span></div>
@@ -396,7 +397,11 @@ ${iconButton("remove-field", "iconClose", lang.delete, true, true)}`;
const target = event.target as HTMLInputElement;
const rule = rules[index];
const action = rule?.actions[Number(target.closest<HTMLElement>("[data-index]")?.dataset.index)];
- if (target.matches("[data-enabled]")) {
+ if (target.matches("[data-notify-success]")) {
+ rule.notifyOnSuccess = target.checked;
+ save(null);
+ return;
+ } else if (target.matches("[data-enabled]")) {
rule.enabled = target.checked;
save();
const preview = body.querySelector<HTMLButtonElement>('[data-action="preview-collection"]');
diff --git a/app/src/types/api/index.d.ts b/app/src/types/api/index.d.ts
index 7b70ae2615..791e5da8a7 100644
--- a/app/src/types/api/index.d.ts
+++ b/app/src/types/api/index.d.ts
@@ -264,9 +264,9 @@ export type AVAutomationConfig = { "rules": Array<AVAutomationRule | null> | nul
export type AVAutomationConfigInput = { "rules": Array<AVAutomationRuleInput | null>; "spec": number; };
-export type AVAutomationRule = { "actions": Array<AVAutomationAction | null> | null; "blockSource"?: AVAutomationBlockSource; "conditions"?: Array<AVViewFilter | null>; "enabled": boolean; "id": string; "keyID"?: string; "name": string; "timeZone"?: string; "trigger": "added" | "changed" | "block"; };
+export type AVAutomationRule = { "actions": Array<AVAutomationAction | null> | null; "blockSource"?: AVAutomationBlockSource; "conditions"?: Array<AVViewFilter | null>; "enabled": boolean; "id": string; "keyID"?: string; "name": string; "notifyOnSuccess"?: boolean; "timeZone"?: string; "trigger": "added" | "changed" | "block"; };
-export type AVAutomationRuleInput = { "actions": Array<AVAutomationActionInput | null>; "blockSource"?: AVAutomationBlockSourceInput | null; "conditions"?: Array<AVViewFilterInput | null>; "enabled": boolean; "id": string; "keyID"?: string; "name": string; "timeZone"?: string; "trigger": "added" | "changed" | "block"; };
+export type AVAutomationRuleInput = { "actions": Array<AVAutomationActionInput | null>; "blockSource"?: AVAutomationBlockSourceInput | null; "conditions"?: Array<AVViewFilterInput | null>; "enabled": boolean; "id": string; "keyID"?: string; "name": string; "notifyOnSuccess"?: boolean | null; "timeZone"?: string; "trigger": "added" | "changed" | "block"; };
export type AVAutomationTemplatePreviewRequestInput = { "avID": string; "inputs"?: Record<string, string>; "itemID": string; "keyID": string; "targetAvID"?: string; "template": string; "timeZone": string; "triggerTime"?: string; };
@@ -7817,6 +7817,8 @@ export interface APIPOSTRoutes {
* 数据库自动化通过 setAttrViewAutomations 操作整体保存,配置 spec 为 1、2 或 3,所有视图共享数据库级规则。
* blockSource.types 主类型包含全部子类型;spec 3 可指定 h:h1 至 h:h6、l:u/o/t、i:u/o/t、callout:类型名。
* blockSource 的 tagMatch、attributeMatch 缺省为 and;spec 3 支持各组独立设置 or,空组不限制,组间仍为 and。
+ * 规则的 notifyOnSuccess 缺省或 null 为开启,仅实际变更且事务成功提交后通知,同一事务合并;错误提示不受其控制。
+ * 手动收集、无变化、撤销重放和失败回滚不发送成功通知。
* addAttributeViewBlocks、setAttributeViewBlockAttr、batchSetAttributeViewBlockAttrs 触发启用的新增或字段变化规则。
* 自动操作与原修改一同提交,失败一起回滚;普通 API 写入不生成编辑器撤销记录。
* 自动化不串联,导入、同步、历史恢复和撤销重放不重新触发;重做保留原条目 ID 和触发时间。
diff --git a/app/tests/automationPanel.test.js b/app/tests/automationPanel.test.js
index bb3b4d7627..42a0f440c5 100644
--- a/app/tests/automationPanel.test.js
+++ b/app/tests/automationPanel.test.js
@@ -115,6 +115,12 @@ const runCases = async (sources, css, mobile) => {
assert.equal(get("[data-trigger-field] option").textContent, lang.automationAnyField);
assert.equal(get("[data-status]").textContent, lang.automationReady);
assert.equal(transactions.length, 0, "opening settings must preserve the stored rule");
+ assert.equal(get("[data-notify-success]").checked, true, "legacy rules notify by default");
+ get("[data-notify-success]").click();
+ assert.equal(latest().notifyOnSuccess, false);
+ assert.equal(latest().enabled, false, "notification settings do not enable a rule");
+ get("[data-notify-success]").click();
+ assert.equal(latest().notifyOnSuccess, true);
const nameRect = get('[data-action="rules"]').getBoundingClientRect();
const enabledRect = get("[data-enabled]").getBoundingClientRect();
assert.ok(Math.abs((nameRect.top + nameRect.bottom) / 2 - (enabledRect.top + enabledRect.bottom) / 2) <= 1,
@@ -131,11 +137,13 @@ const runCases = async (sources, css, mobile) => {
const renameInput = rulePopup.querySelector("[data-rules] input");
renameInput.value = "Cancelled";
renameInput.dispatchEvent(new KeyboardEvent("keydown", {key: "Escape", bubbles: true}));
- assert.equal(transactions.length, 0, "Escape cancels renaming");
+ const writesBeforeRename = transactions.length;
+ assert.equal(latest().name, "Record completion time", "Escape cancels renaming");
rulePopup.querySelector("[data-rename]").click();
const nextName = rulePopup.querySelector("[data-rules] input");
nextName.value = "Renamed completion";
nextName.dispatchEvent(new KeyboardEvent("keydown", {key: "Enter", bubbles: true}));
+ assert.equal(transactions.length, writesBeforeRename + 1);
assert.equal(latest().name, "Renamed completion");
assert.equal(transactions.at(-1).undo[0].data.rules[0].name, "Record completion time");
const searchRules = rulePopup.querySelector("[data-search]");
diff --git a/docs/API.ja.md b/docs/API.ja.md
index 8d22732934..e79ca4c92d 100644
--- a/docs/API.ja.md
+++ b/docs/API.ja.md
@@ -2212,7 +2212,7 @@ if (response.code === 0 && response.data) {
* `data.av`: 完全な `AttributeView` 定義——フィールド(`keyValues`)、フィールド順序(`keyIDs`、`null` の場合あり)、および全ビューの生のレイアウト設定(`table`/`gallery`/`kanban`)とアイテム順序(`itemIds`)。互換性フィールド `viewID` は最初に利用可能なビューから算出され、永続化されません。レンダリング後の行やページングは含まれないため、計算後の行データが必要な場合は [レンダリング](#レンダリング) を使用してください
- * `data.av.automations` は省略可能で、データベース全体のルール(`spec: 1`、`2`、`3`)を保持します。`block` トリガーの `blockSource` はノートブック/文書の範囲、ブロックの種類、タグ、カスタム属性を指定し、`collect` アクションは一致する元のブロックを現在のデータベースにバインドします。主種類はすべてのサブタイプを含みます。形式 3 は `h:h1`~`h:h6`、`l:u/o/t`、`i:u/o/t`、`callout:TYPE`(大文字小文字を区別し、独自種類も指定可能)をサポートします。種類の未選択は制限なし、複数選択は OR です。自動作成された主キー値には、カーネルが管理する `block.collectionRuleID` が含まれる場合があります。手動で追加した既存項目は保持されます。削除後に再び一致すると初期値を持つ新しい項目を作成し、元に戻す操作では元の項目とフィールドを復元します `blockSource.tagMatch` と `attributeMatch` は既定で `and`、形式 3 では各組を個別に `or` にできます。組の間は AND のままで、空の組は制限しません。
+ * `data.av.automations` は省略可能で、データベース全体のルール(`spec: 1`、`2`、`3`)を保持します。`block` トリガーの `blockSource` はノートブック/文書の範囲、ブロックの種類、タグ、カスタム属性を指定し、`collect` アクションは一致する元のブロックを現在のデータベースにバインドします。主種類はすべてのサブタイプを含みます。形式 3 は `h:h1`~`h:h6`、`l:u/o/t`、`i:u/o/t`、`callout:TYPE`(大文字小文字を区別し、独自種類も指定可能)をサポートします。種類の未選択は制限なし、複数選択は OR です。自動作成された主キー値には、カーネルが管理する `block.collectionRuleID` が含まれる場合があります。手動で追加した既存項目は保持されます。削除後に再び一致すると初期値を持つ新しい項目を作成し、元に戻す操作では元の項目とフィールドを復元します `blockSource.tagMatch` と `attributeMatch` は既定で `and`、形式 3 では各組を個別に `or` にできます。組の間は AND のままで、空の組は制限しません。 各ルールの省略可能な `notifyOnSuccess` は既定(`null` を含む)で `true` です。実際の変更をトランザクション確定後に一つの通知にまとめます。無効にしてもエラーは通知します。変更なし・明示的な収集・元に戻す・やり直し・ロールバックでは成功通知を送信しません。
### 主キー値を取得
diff --git a/docs/API.md b/docs/API.md
index ea34278677..13d9cb5d9d 100644
--- a/docs/API.md
+++ b/docs/API.md
@@ -2222,7 +2222,7 @@ The field types (`keyType`) are:
* `data.av`: The full `AttributeView` definition — fields (`keyValues`), field ordering (`keyIDs`, may be `null`), and all views with their raw layout config (`table`/`list`/`gallery`/`kanban`) and item ordering (`itemIds`). The compatibility `viewID` is computed as the first available view and is not persisted. Returns no rendered rows or pagination; therefore, use [Render](#Render) for computed rows
- * `data.av.automations` optionally contains database-wide rules (`spec: 1`, `2`, or `3`). A `block` trigger uses `blockSource` to select notebooks/documents, block types, tags, and custom attributes; its `collect` action binds matching source blocks to this database. Main types include every subtype; format 3 supports `h:h1` through `h:h6`, `l:u/o/t`, `i:u/o/t`, and `callout:TYPE` (case-sensitive, including custom types). Empty types impose no restriction, and multiple types use OR. Automatically created primary values may include `block.collectionRuleID`, which is maintained by the kernel. Existing manual rows are preserved; a new match after removal creates a new initialized row, while undo restores the original row and fields `blockSource.tagMatch` and `attributeMatch` default to `and`; format 3 also supports `or` independently within each group. Groups remain ANDed, and empty groups add no restriction.
+ * `data.av.automations` optionally contains database-wide rules (`spec: 1`, `2`, or `3`). A `block` trigger uses `blockSource` to select notebooks/documents, block types, tags, and custom attributes; its `collect` action binds matching source blocks to this database. Main types include every subtype; format 3 supports `h:h1` through `h:h6`, `l:u/o/t`, `i:u/o/t`, and `callout:TYPE` (case-sensitive, including custom types). Empty types impose no restriction, and multiple types use OR. Automatically created primary values may include `block.collectionRuleID`, which is maintained by the kernel. Existing manual rows are preserved; a new match after removal creates a new initialized row, while undo restores the original row and fields `blockSource.tagMatch` and `attributeMatch` default to `and`; format 3 also supports `or` independently within each group. Groups remain ANDed, and empty groups add no restriction. Each rule's optional `notifyOnSuccess` defaults to `true` (including `null`); successful changes are summarized once after the transaction commits. Disabled notifications do not suppress errors. No-op actions, explicit collection, undo, redo, and rolled-back transactions do not generate success messages.
### Get primary key values
diff --git a/docs/API.zh-CN.md b/docs/API.zh-CN.md
index 55116bb012..6278c7cbf0 100644
--- a/docs/API.zh-CN.md
+++ b/docs/API.zh-CN.md
@@ -2218,7 +2218,7 @@ if (response.code === 0 && response.data) {
* `data.av`: 完整的 `AttributeView` 定义——字段(`keyValues`)、字段顺序(`keyIDs`,可能为 `null`),以及所有视图的原始布局配置(`table`/`list`/`gallery`/`kanban`)和条目顺序(`itemIds`)。兼容字段 `viewID` 动态取第一个可用视图,不会持久化。返回值不含渲染后的行或分页;需要计算后的行数据请使用 [渲染](#渲染)
- * `data.av.automations` 可选,保存数据库共享的规则(`spec: 1`、`2` 或 `3`)。`block` 触发器通过 `blockSource` 指定笔记本/文档范围、块类型、标签和自定义属性,`collect` 动作将符合条件的原块绑定到当前数据库。主类型包含全部子类型;格式 3 支持 `h:h1` 至 `h:h6`、`l:u/o/t`、`i:u/o/t` 和 `callout:TYPE`(区分大小写,允许自定义提示类型)。类型为空不限制,多个类型取任一匹配。自动创建的主键值可能包含由内核维护的 `block.collectionRuleID`。已有手动条目不受影响;移出后再次匹配会创建新条目并初始化字段,撤销则恢复原条目及字段 `blockSource.tagMatch` 和 `attributeMatch` 缺省为 `and`,格式 3 支持各组独立设置 `or`;组间仍取与关系,空组不限制。
+ * `data.av.automations` 可选,保存数据库共享的规则(`spec: 1`、`2` 或 `3`)。`block` 触发器通过 `blockSource` 指定笔记本/文档范围、块类型、标签和自定义属性,`collect` 动作将符合条件的原块绑定到当前数据库。主类型包含全部子类型;格式 3 支持 `h:h1` 至 `h:h6`、`l:u/o/t`、`i:u/o/t` 和 `callout:TYPE`(区分大小写,允许自定义提示类型)。类型为空不限制,多个类型取任一匹配。自动创建的主键值可能包含由内核维护的 `block.collectionRuleID`。已有手动条目不受影响;移出后再次匹配会创建新条目并初始化字段,撤销则恢复原条目及字段 `blockSource.tagMatch` 和 `attributeMatch` 缺省为 `and`,格式 3 支持各组独立设置 `or`;组间仍取与关系,空组不限制。 每条规则的可选 `notifyOnSuccess` 缺省或 `null` 为 `true`,实际变更在事务提交成功后合并通知;关闭不影响错误提示。无变化、手动收集、撤销重做及回滚事务不发送成功通知。
### 获取主键值
diff --git a/kernel/api/av_contract_automation.go b/kernel/api/av_contract_automation.go
index 716d68bde8..f0985676a5 100644
--- a/kernel/api/av_contract_automation.go
+++ b/kernel/api/av_contract_automation.go
@@ -40,7 +40,7 @@ func toContractAVAutomationConfig(value *av.AutomationConfig) *apicontract.AVAut
return nil
}
return &apicontract.AVAutomationRule{ID: rule.ID, Name: rule.Name, Enabled: rule.Enabled, Trigger: rule.Trigger,
- TimeZone: rule.TimeZone,
+ TimeZone: rule.TimeZone, NotifyOnSuccess: rule.NotifyOnSuccess,
BlockSource: toContractAVAutomationBlockSource(rule.BlockSource),
KeyID: rule.KeyID, Conditions: avContractSlice(rule.Conditions, toContractAVViewFilter),
Actions: avContractSlice(rule.Actions, func(action *av.AutomationAction) *apicontract.AVAutomationAction {
diff --git a/kernel/api/contract_av_automation_test.go b/kernel/api/contract_av_automation_test.go
index 656eb3e193..14cfd3ee9a 100644
--- a/kernel/api/contract_av_automation_test.go
+++ b/kernel/api/contract_av_automation_test.go
@@ -155,6 +155,8 @@ func TestAVContractAutomationWrites(t *testing.T) {
Actions: []*av.AutomationAction{{Type: "collect", Target: "current", Fields: map[string]*av.AutomationValue{
fixture.textKeyID: {Mode: "static", Value: &av.Value{Type: av.KeyTypeText, Text: &av.ValueText{Content: "collected"}}},
}}}}
+ notify := false
+ collection.NotifyOnSuccess = &notify
if err = model.PerformAttributeViewOperations([]*model.Operation{{Action: "setAttrViewAutomations", AvID: database.ID,
Data: &av.AutomationConfig{Spec: 1, Rules: []*av.AutomationRule{collection}}}}); err != nil {
t.Fatal(err)
diff --git a/kernel/apicontract/av_automation.go b/kernel/apicontract/av_automation.go
index d7b418622a..57bd5c7eaa 100644
--- a/kernel/apicontract/av_automation.go
+++ b/kernel/apicontract/av_automation.go
@@ -24,6 +24,8 @@ type AVAutomationRule struct {
Actions []*AVAutomationAction `json:"actions"`
BlockSource *AVAutomationBlockSource `json:"blockSource,omitempty" api:"optional"`
TimeZone string `json:"timeZone,omitempty" api:"optional"`
+ // 缺省或 null 表示开启;仅控制实际变更后的成功通知,不影响错误提示。
+ NotifyOnSuccess *bool `json:"notifyOnSuccess,omitempty" api:"optional"`
}
// AVAutomationBlockSource 监听范围取笔记本与文档的并集,文档包含子文档;范围至少选择一项。
diff --git a/kernel/apicontract/contracts.go b/kernel/apicontract/contracts.go
index bc3275e951..6bdb9fcfbb 100644
--- a/kernel/apicontract/contracts.go
+++ b/kernel/apicontract/contracts.go
@@ -1440,6 +1440,8 @@ var SystemAddUIProcess = define[EmptyRequest, Null]("addUIProcess", "/api/system
// 数据库自动化通过 setAttrViewAutomations 操作整体保存,配置 spec 为 1、2 或 3,所有视图共享数据库级规则。
// blockSource.types 主类型包含全部子类型;spec 3 可指定 h:h1 至 h:h6、l:u/o/t、i:u/o/t、callout:类型名。
// blockSource 的 tagMatch、attributeMatch 缺省为 and;spec 3 支持各组独立设置 or,空组不限制,组间仍为 and。
+// 规则的 notifyOnSuccess 缺省或 null 为开启,仅实际变更且事务成功提交后通知,同一事务合并;错误提示不受其控制。
+// 手动收集、无变化、撤销重放和失败回滚不发送成功通知。
// addAttributeViewBlocks、setAttributeViewBlockAttr、batchSetAttributeViewBlockAttrs 触发启用的新增或字段变化规则。
// 自动操作与原修改一同提交,失败一起回滚;普通 API 写入不生成编辑器撤销记录。
// 自动化不串联,导入、同步、历史恢复和撤销重放不重新触发;重做保留原条目 ID 和触发时间。
diff --git a/kernel/apicontract/schema.json b/kernel/apicontract/schema.json
index 80f4d2abbd..7b8fb6d3b0 100644
--- a/kernel/apicontract/schema.json
+++ b/kernel/apicontract/schema.json
@@ -6880,6 +6880,9 @@
"name": {
"type": "string"
},
+ "notifyOnSuccess": {
+ "type": "boolean"
+ },
"timeZone": {
"type": "string"
},
@@ -6952,6 +6955,16 @@
"name": {
"type": "string"
},
+ "notifyOnSuccess": {
+ "anyOf": [
+ {
+ "type": "boolean"
+ },
+ {
+ "type": "null"
+ }
+ ]
+ },
"timeZone": {
"type": "string"
},
diff --git a/kernel/av/automation.go b/kernel/av/automation.go
index 2fc836dc0c..beb41c6d36 100644
--- a/kernel/av/automation.go
+++ b/kernel/av/automation.go
@@ -15,15 +15,16 @@ type AutomationConfig struct {
}
type AutomationRule struct {
- ID string `json:"id"`
- Name string `json:"name"`
- Enabled bool `json:"enabled"`
- Trigger string `json:"trigger"` // added、changed 或 block
- KeyID string `json:"keyID,omitempty"`
- Conditions []*ViewFilter `json:"conditions,omitempty"`
- Actions []*AutomationAction `json:"actions"`
- BlockSource *AutomationBlockSource `json:"blockSource,omitempty"`
- TimeZone string `json:"timeZone,omitempty"`
+ ID string `json:"id"`
+ Name string `json:"name"`
+ Enabled bool `json:"enabled"`
+ Trigger string `json:"trigger"` // added、changed 或 block
+ KeyID string `json:"keyID,omitempty"`
+ Conditions []*ViewFilter `json:"conditions,omitempty"`
+ Actions []*AutomationAction `json:"actions"`
+ BlockSource *AutomationBlockSource `json:"blockSource,omitempty"`
+ TimeZone string `json:"timeZone,omitempty"`
+ NotifyOnSuccess *bool `json:"notifyOnSuccess,omitempty"`
}
// AutomationBlockSource 的范围取并集,各类条件取交集;文档范围包含其子文档。
diff --git a/kernel/model/attribute_view_automation.go b/kernel/model/attribute_view_automation.go
index 4edfef30bd..521ffd92ad 100644
--- a/kernel/model/attribute_view_automation.go
+++ b/kernel/model/attribute_view_automation.go
@@ -39,6 +39,7 @@ type attributeViewAutomationState struct {
count int
recordUndo bool
paused []automationPausedRule
+ results map[string]*automationRuleResult
}
type automationUnavailableReference struct {
@@ -270,8 +271,9 @@ func (tx *Transaction) runAttributeViewAutomations() error {
}
// 先确定全部触发条件,关联关键词也不会读到前一自动动作修改后的标题。
for _, entry := range triggered {
+ result := tx.automationResult(entry.source.boxID, entry.current.ID, entry.rule)
for _, action := range entry.rule.Actions {
- if err := tx.runAutomationAction(entry.source, entry.current, entry.itemID, action, entry.rule.TimeZone); err != nil {
+ if err := tx.runAutomationAction(entry.source, entry.current, entry.itemID, action, entry.rule.TimeZone, result); err != nil {
return fmt.Errorf("automation [%s]: %w", entry.rule.ID, err)
}
}
@@ -537,7 +539,7 @@ func (tx *Transaction) validateAutomationRule(source *av.AttributeView, rule *av
}
func (tx *Transaction) runAutomationAction(source *attributeViewAutomationSource, current *av.AttributeView,
- itemID string, action *av.AutomationAction, timeZone string) error {
+ itemID string, action *av.AutomationAction, timeZone string, result *automationRuleResult) error {
target, err := tx.automationTarget(current, action, source.boxID)
if err != nil {
return err
@@ -567,6 +569,7 @@ func (tx *Transaction) runAutomationAction(source *attributeViewAutomationSource
return err
}
ids = []string{id}
+ result.record("added", target.ID, id)
} else {
switch action.Target {
case "current":
@@ -655,6 +658,9 @@ func (tx *Transaction) runAutomationAction(source *attributeViewAutomationSource
if err = tx.applyAutomationOperation(op, inverse); err != nil {
return err
}
+ if action.Type != "add" {
+ result.record("updated", target.ID, id)
+ }
}
}
return nil
diff --git a/kernel/model/attribute_view_automation_notification.go b/kernel/model/attribute_view_automation_notification.go
new file mode 100644
index 0000000000..2353f8782e
--- /dev/null
+++ b/kernel/model/attribute_view_automation_notification.go
@@ -0,0 +1,94 @@
+package model
+
+import (
+ "sort"
+ "strconv"
+ "strings"
+
+ "github.com/siyuan-note/siyuan/kernel/av"
+ "github.com/siyuan-note/siyuan/kernel/util"
+)
+
+type automationRuleResult struct {
+ name string
+ items map[string]map[string]bool
+}
+
+// 各规则仅记录开启通知的实际写入,按数据库和条目去重,不把字段初始化重复计为更新。
+func (tx *Transaction) automationResult(boxID, viewID string, rule *av.AutomationRule) *automationRuleResult {
+ if tx.isReplay || tx.attributeViewAutomations == nil || rule == nil || rule.NotifyOnSuccess != nil && !*rule.NotifyOnSuccess {
+ return nil
+ }
+ state := tx.attributeViewAutomations
+ if state.results == nil {
+ state.results = map[string]*automationRuleResult{}
+ }
+ key := boxID + "/" + viewID + "/" + rule.ID
+ if state.results[key] == nil {
+ state.results[key] = &automationRuleResult{name: rule.Name, items: map[string]map[string]bool{}}
+ }
+ return state.results[key]
+}
+
+func (result *automationRuleResult) record(kind, viewID, itemID string) {
+ if result == nil {
+ return
+ }
+ if result.items[kind] == nil {
+ result.items[kind] = map[string]bool{}
+ }
+ result.items[kind][viewID+"/"+itemID] = true
+}
+
+// 在事务提交后生成单条摘要,未产生实际结果的规则不影响名称或统计。
+func (state *attributeViewAutomationState) successMessage() string {
+ if state == nil {
+ return ""
+ }
+ totals := map[string]map[string]bool{}
+ names := []string{}
+ keys := make([]string, 0, len(state.results))
+ for key := range state.results {
+ keys = append(keys, key)
+ }
+ sort.Strings(keys)
+ for _, key := range keys {
+ result := state.results[key]
+ count := 0
+ for kind, items := range result.items {
+ count += len(items)
+ if totals[kind] == nil {
+ totals[kind] = map[string]bool{}
+ }
+ for id := range items {
+ totals[kind][id] = true
+ }
+ }
+ if count > 0 {
+ names = append(names, result.name)
+ }
+ }
+ for id := range totals["added"] {
+ delete(totals["updated"], id)
+ }
+ for id := range totals["collected"] {
+ delete(totals["updated"], id)
+ }
+ parts := []string{}
+ for _, result := range []struct{ kind, key string }{
+ {"added", "automationResultAdded"}, {"updated", "automationResultUpdated"},
+ {"collected", "automationResultCollected"}, {"removed", "automationResultRemoved"},
+ } {
+ if count := len(totals[result.kind]); count > 0 {
+ parts = append(parts, strings.ReplaceAll(util.I18nTerm(Conf.Lang, result.key), "${1}", strconv.Itoa(count)))
+ }
+ }
+ if len(parts) == 0 {
+ return ""
+ }
+ summary := strings.Join(parts, util.I18nTerm(Conf.Lang, "automationResultSeparator"))
+ if len(names) == 1 {
+ return strings.NewReplacer("${1}", util.EscapeHTML(names[0]), "${2}", summary).Replace(util.I18nTerm(Conf.Lang, "automationResultRule"))
+ }
+ return strings.ReplaceAll(util.I18nTerm(Conf.Lang, "automationResultSummary"), "${1}", summary)
+}
diff --git a/kernel/model/attribute_view_automation_notification_fts5_test.go b/kernel/model/attribute_view_automation_notification_fts5_test.go
new file mode 100644
index 0000000000..b9e6378ecf
--- /dev/null
+++ b/kernel/model/attribute_view_automation_notification_fts5_test.go
@@ -0,0 +1,268 @@
+//go:build fts5
+
+package model
+
+import (
+ "encoding/json"
+ "errors"
+ "os"
+ "path/filepath"
+ "strings"
+ "testing"
+
+ "github.com/88250/lute/ast"
+ "github.com/88250/lute/parse"
+ "github.com/siyuan-note/siyuan/kernel/av"
+ "github.com/siyuan-note/siyuan/kernel/filesys"
+ "github.com/siyuan-note/siyuan/kernel/util"
+)
+
+func setupAutomationNotificationLanguage(t *testing.T) {
+ t.Helper()
+ previous, language := util.WorkingDir, Conf.Lang
+ previousTime, hadTime := util.TimeLangs["en"]
+ working, err := filepath.Abs("../../app")
+ if err != nil {
+ t.Fatal(err)
+ }
+ util.WorkingDir, Conf.Lang = working, "en"
+ data, err := os.ReadFile(filepath.Join(working, "appearance", "langs", "en.json"))
+ if err != nil {
+ t.Fatal(err)
+ }
+ var terms struct {
+ Time map[string]any `json:"_time"`
+ }
+ if err = json.Unmarshal(data, &terms); err != nil {
+ t.Fatal(err)
+ }
+ util.TimeLangs["en"] = terms.Time
+ t.Cleanup(func() {
+ util.WorkingDir, Conf.Lang = previous, language
+ if hadTime {
+ util.TimeLangs["en"] = previousTime
+ } else {
+ delete(util.TimeLangs, "en")
+ }
+ })
+}
+
+func captureAutomationNotifications(t *testing.T, tx *Transaction, messages *[]string) {
+ t.Helper()
+ tx.pushAutomationMessage = func(message string, timeout int) string {
+ if tx.state.Load() != 2 || timeout != 5000 {
+ t.Fatal("notification preceded the complete transaction commit")
+ }
+ *messages = append(*messages, message)
+ return "test-message"
+ }
+}
+
+func TestAutomationSuccessNotificationsCommitAndReplay(t *testing.T) {
+ fixture, source, target, statusID, _ := setupAutomationTest(t)
+ setupAutomationNotificationLanguage(t)
+ source.Automations.Rules[0].Name = "<Start ${2}>"
+ if err := av.SaveAttributeView(source); err != nil {
+ t.Fatal(err)
+ }
+ itemID := source.GetBlockKeyValues().Values[0].BlockID
+ messages := []string{}
+ tx := automationStatusTransaction(source, fixture.sourceID, statusID, itemID, "Active")
+ captureAutomationNotifications(t, tx, &messages)
+ tx.writeTransactionTree = func(tree *parse.Tree) error {
+ if len(messages) != 0 {
+ t.Fatal("success was announced before writing the source document")
+ }
+ _, err := filesys.WriteTree(tree)
+ return err
+ }
+ if err := PerformTxSync(tx); err != nil {
+ t.Fatal(err)
+ }
+ want := `Automation "&lt;Start ${2}&gt;" completed: Entries added: 1`
+ if len(messages) != 1 || messages[0] != want {
+ t.Fatalf("unexpected notification: %v", messages)
+ }
+ if len(readAttributeViewItemsTest(t, target.ID).GetBlockKeyValues().Values) != 1 {
+ t.Fatal("notification did not match persisted rows")
+ }
+ for _, operations := range [][]*Operation{cloneOperations(tx.UndoOperations), cloneOperations(tx.DoOperations)} {
+ replay := &Transaction{DoOperations: operations, isReplay: true}
+ captureAutomationNotifications(t, replay, &messages)
+ if err := PerformTxSync(replay); err != nil {
+ t.Fatal(err)
+ }
+ }
+ if len(messages) != 1 {
+ t.Fatal("undo or redo announced another successful execution")
+ }
+ source = readAttributeViewItemsTest(t, source.ID)
+ repeat := automationStatusTransaction(source, fixture.sourceID, statusID, itemID, "Active")
+ captureAutomationNotifications(t, repeat, &messages)
+ if err := PerformTxSync(repeat); err != nil {
+ t.Fatal(err)
+ }
+ if len(messages) != 1 {
+ t.Fatal("an unchanged trigger generated a notification")
+ }
+}
+
+func TestAutomationSuccessNotificationSuppression(t *testing.T) {
+ for _, scenario := range []string{"muted", "unmatched", "no-target", "unchanged", "rollback", "action-error", "muted-error"} {
+ t.Run(scenario, func(t *testing.T) {
+ fixture, source, target, statusID, logsID := setupAutomationTest(t)
+ setupAutomationNotificationLanguage(t)
+ rule := source.Automations.Rules[0]
+ source.Automations.Rules = source.Automations.Rules[:1]
+ itemID := source.GetBlockKeyValues().Values[0].BlockID
+ status := "Active"
+ switch scenario {
+ case "muted", "muted-error":
+ notify := false
+ rule.NotifyOnSuccess = &notify
+ case "unmatched":
+ status = "Done"
+ case "no-target":
+ rule.Actions = []*av.AutomationAction{{Type: "edit", Target: "related", RelationKeyID: logsID,
+ Fields: map[string]*av.AutomationValue{target.KeyValues[2].Key.ID: {Mode: "currentTime"}}}}
+ case "unchanged":
+ rule.Actions = []*av.AutomationAction{{Type: "edit", Target: "current", Fields: map[string]*av.AutomationValue{
+ source.GetBlockKey().ID: {Mode: "static", Value: &av.Value{Type: av.KeyTypeBlock, Block: &av.ValueBlock{Content: "Primary"}}},
+ }}}
+ }
+ if strings.HasSuffix(scenario, "error") {
+ source.Automations.Spec, rule.TimeZone = 2, "UTC"
+ rule.Actions[0].Fields[target.GetBlockKey().ID] = &av.AutomationValue{Mode: "template", Template: `.action{field "missing-field"}`}
+ }
+ if err := av.SaveAttributeView(source); err != nil {
+ t.Fatal(err)
+ }
+ messages := []string{}
+ tx := automationStatusTransaction(source, fixture.sourceID, statusID, itemID, status)
+ captureAutomationNotifications(t, tx, &messages)
+ if scenario == "rollback" {
+ tx.writeTransactionTree = func(*parse.Tree) error { return errors.New("injected commit failure") }
+ }
+ err := PerformTxSync(tx)
+ if (err != nil) != (scenario == "rollback" || strings.HasSuffix(scenario, "error")) {
+ t.Fatalf("unexpected execution result: %v", err)
+ }
+ if len(messages) != 0 {
+ t.Fatalf("%s announced success: %v", scenario, messages)
+ }
+ if scenario == "muted" && len(readAttributeViewItemsTest(t, target.ID).GetBlockKeyValues().Values) != 1 {
+ t.Fatal("muting notifications stopped execution")
+ }
+ })
+ }
+}
+
+func TestAutomationSuccessNotificationsMergeCollectionAndActions(t *testing.T) {
+ fixture, source, _, statusID, _ := setupAutomationTest(t)
+ setupAutomationNotificationLanguage(t)
+ source.Automations.Rules = source.Automations.Rules[:1]
+ source.Automations.Rules = append(source.Automations.Rules, &av.AutomationRule{ID: ast.NewNodeID(), Name: "Collect", Enabled: true, Trigger: "block",
+ BlockSource: &av.AutomationBlockSource{DocumentIDs: []string{fixture.targetID}, Types: []string{"d"}, Tags: []string{"todo"}},
+ Actions: []*av.AutomationAction{{Type: "collect", Target: "current", Fields: map[string]*av.AutomationValue{}}}})
+ if err := av.SaveAttributeView(source); err != nil {
+ t.Fatal(err)
+ }
+ messages := []string{}
+ tx := automationStatusTransaction(source, fixture.sourceID, statusID, source.GetBlockKeyValues().Values[0].BlockID, "Active")
+ collection := blockCollectionTags(t, fixture.targetID, "todo")
+ tx.DoOperations = append(tx.DoOperations, collection.DoOperations...)
+ tx.UndoOperations = append(tx.UndoOperations, collection.UndoOperations...)
+ captureAutomationNotifications(t, tx, &messages)
+ if err := PerformTxSync(tx); err != nil {
+ t.Fatal(err)
+ }
+ if len(messages) != 1 || messages[0] != "Database automations completed: Entries added: 1; Blocks collected: 1" {
+ t.Fatalf("collection and ordinary actions did not share a notification: %v", messages)
+ }
+}
+
+func TestAutomationSuccessNotificationsMergeAndCountItems(t *testing.T) {
+ fixture, source, target, statusID, _ := setupAutomationTest(t)
+ setupAutomationNotificationLanguage(t)
+ start := source.Automations.Rules[0]
+ fieldID := ast.NewNodeID()
+ source.KeyValues = append(source.KeyValues, &av.KeyValues{Key: &av.Key{ID: fieldID, Name: "Note", Type: av.KeyTypeText}})
+ edit := &av.AutomationRule{ID: ast.NewNodeID(), Name: "Edit", Enabled: true, Trigger: "changed", KeyID: statusID,
+ Conditions: start.Conditions, Actions: []*av.AutomationAction{{Type: "edit", Target: "current", Fields: map[string]*av.AutomationValue{
+ source.GetBlockKey().ID: {Mode: "static", Value: &av.Value{Type: av.KeyTypeBlock, Block: &av.ValueBlock{Content: "Updated"}}},
+ fieldID: {Mode: "static", Value: &av.Value{Type: av.KeyTypeText, Text: &av.ValueText{Content: "Updated note"}}},
+ }}}}
+ notify := false
+ muted := *start
+ muted.ID, muted.Name, muted.NotifyOnSuccess = ast.NewNodeID(), "Muted", &notify
+ source.Automations.Rules = []*av.AutomationRule{edit, start, &muted}
+ if err := av.SaveAttributeView(source); err != nil {
+ t.Fatal(err)
+ }
+ messages := []string{}
+ tx := automationStatusTransaction(source, fixture.sourceID, statusID, source.GetBlockKeyValues().Values[0].BlockID, "Active")
+ captureAutomationNotifications(t, tx, &messages)
+ if err := PerformTxSync(tx); err != nil {
+ t.Fatal(err)
+ }
+ if len(messages) != 1 || messages[0] != "Database automations completed: Entries added: 1; Entries updated: 1" {
+ t.Fatalf("unmerged or inaccurate result: %v", messages)
+ }
+ if len(readAttributeViewItemsTest(t, target.ID).GetBlockKeyValues().Values) != 2 {
+ t.Fatal("muted rule did not execute")
+ }
+}
+
+func TestAutomationCollectionSuccessNotifications(t *testing.T) {
+ fixture, view, _ := setupBlockCollectionTest(t)
+ setupAutomationNotificationLanguage(t)
+ messages := []string{}
+ for _, tags := range []string{"todo", "todo,other", ""} {
+ tx := blockCollectionTags(t, fixture.sourceID, tags)
+ captureAutomationNotifications(t, tx, &messages)
+ if err := PerformTxSync(tx); err != nil {
+ t.Fatal(err)
+ }
+ }
+ if len(messages) != 2 || !strings.Contains(messages[0], "Blocks collected: 1") || strings.Contains(messages[0], "updated") || !strings.Contains(messages[1], "Entries removed: 1") {
+ t.Fatalf("unexpected collection notifications: %v", messages)
+ }
+ view = readAttributeViewItemsTest(t, view.ID)
+ notify := false
+ view.Automations.Rules[0].NotifyOnSuccess = &notify
+ if err := av.SaveAttributeView(view); err != nil {
+ t.Fatal(err)
+ }
+ for _, tags := range []string{"todo", ""} {
+ tx := blockCollectionTags(t, fixture.sourceID, tags)
+ captureAutomationNotifications(t, tx, &messages)
+ if err := PerformTxSync(tx); err != nil {
+ t.Fatal(err)
+ }
+ }
+ if len(messages) != 2 {
+ t.Fatal("muted collection or removal sent a notification")
+ }
+ view = readAttributeViewItemsTest(t, view.ID)
+ rule := view.Automations.Rules[0]
+ rule.Enabled, rule.NotifyOnSuccess = false, nil
+ if err := av.SaveAttributeView(view); err != nil {
+ t.Fatal(err)
+ }
+ if err := PerformTxSync(blockCollectionTags(t, fixture.sourceID, "todo")); err != nil {
+ t.Fatal(err)
+ }
+ rule.Enabled = true
+ if err := av.SaveAttributeView(view); err != nil {
+ t.Fatal(err)
+ }
+ op := &Operation{Action: "collectAttrViewBlocks", AvID: view.ID, Data: map[string]any{"ruleID": rule.ID, "blockIDs": []string{fixture.sourceID}}}
+ tx := &Transaction{fromAPI: true, DoOperations: []*Operation{op}, UndoOperations: []*Operation{op}}
+ captureAutomationNotifications(t, tx, &messages)
+ if err := PerformTxSync(tx); err != nil {
+ t.Fatal(err)
+ }
+ if len(messages) != 2 || readAttributeViewItemsTest(t, view.ID).GetBlockValueByBoundID(fixture.sourceID) == nil {
+ t.Fatal("explicit collection notified or failed to collect")
+ }
+}
diff --git a/kernel/model/attribute_view_collection.go b/kernel/model/attribute_view_collection.go
index abb3c89709..931f7e2cdb 100644
--- a/kernel/model/attribute_view_collection.go
+++ b/kernel/model/attribute_view_collection.go
@@ -326,6 +326,7 @@ func (tx *Transaction) runAttributeViewCollections() error {
type collectionChange struct {
viewID, boxID, blockID, itemID string
rule *av.AutomationRule
+ notifyRule *av.AutomationRule
}
var changes []collectionChange
beforeNodes, afterNodes := map[string]*ast.Node{}, map[string]*ast.Node{}
@@ -391,6 +392,7 @@ func (tx *Transaction) runAttributeViewCollections() error {
}
var entering *av.AutomationRule
matching, previouslyMatching, ownerEnabled := false, false, false
+ var ownerRule *av.AutomationRule
row := view.GetBlockValueByBoundID(blockID)
for _, rule := range rules {
before := collectionBlockMatches(rule.BlockSource, beforeNodes[blockID], beforeTrees[blockID])
@@ -402,12 +404,13 @@ func (tx *Transaction) runAttributeViewCollections() error {
}
if row != nil && row.Block.CollectionRuleID == rule.ID {
ownerEnabled = true
+ ownerRule = rule
}
}
// 手动条目不接管、不覆盖;仍有其他规则匹配时保留自动条目及用户字段。
if row != nil {
if !matching && previouslyMatching && ownerEnabled {
- changes = append(changes, collectionChange{viewID: id, boxID: boxID, itemID: row.BlockID})
+ changes = append(changes, collectionChange{viewID: id, boxID: boxID, itemID: row.BlockID, notifyRule: ownerRule})
}
continue
}
@@ -430,10 +433,14 @@ func (tx *Transaction) runAttributeViewCollections() error {
if err = tx.addCollectedItem(view, change.rule, change.blockID, change.boxID); err != nil {
return err
}
+ if !slices.Contains(state.requested[change.viewID][change.rule.ID], change.blockID) {
+ tx.automationResult(change.boxID, change.viewID, change.rule).record("collected", change.viewID, change.blockID)
+ }
} else if row := view.GetBlockValue(change.itemID); row != nil {
if err = tx.removeCollectedItem(view, row, change.boxID); err != nil {
return err
}
+ tx.automationResult(change.boxID, change.viewID, change.notifyRule).record("removed", change.viewID, change.itemID)
}
}
return nil
@@ -458,7 +465,7 @@ func (tx *Transaction) addCollectedItem(view *av.AttributeView, rule *av.Automat
return err
}
return tx.runAutomationAction(&attributeViewAutomationSource{before: view, boxID: boxID}, current, id,
- &av.AutomationAction{Type: "edit", Target: "current", Fields: rule.Actions[0].Fields}, rule.TimeZone)
+ &av.AutomationAction{Type: "edit", Target: "current", Fields: rule.Actions[0].Fields}, rule.TimeZone, nil)
}
func (tx *Transaction) removeCollectedItem(view *av.AttributeView, row *av.Value, _ string) error {
diff --git a/kernel/model/attribute_view_transaction.go b/kernel/model/attribute_view_transaction.go
index 3e97df1387..c86957c2a6 100644
--- a/kernel/model/attribute_view_transaction.go
+++ b/kernel/model/attribute_view_transaction.go
@@ -129,6 +129,15 @@ func (tx *Transaction) finishAttributeViewMutation(rollback bool) {
for _, paused := range automation.paused {
util.PushMsg(paused.message(), 7000)
}
+ if !tx.isReplay && tx.state.Load() == 2 {
+ if message := automation.successMessage(); message != "" {
+ notify := tx.pushAutomationMessage
+ if notify == nil {
+ notify = util.PushMsg
+ }
+ notify(message, 5000)
+ }
+ }
}
for avID := range tx.invalidatedAvHistory {
GlobalUndoLog.ClearAttributeView(avID)
diff --git a/kernel/model/transaction.go b/kernel/model/transaction.go
index d646e5b99b..86e1040c71 100644
--- a/kernel/model/transaction.go
+++ b/kernel/model/transaction.go
@@ -2763,6 +2763,7 @@ type Transaction struct {
blockSwapOriginalTrees []*parse.Tree
attributeViewRollback *attributeViewRollback
attributeViewAutomations *attributeViewAutomationState
+ pushAutomationMessage func(string, int) string
attributeViewCollections *attributeViewCollectionState
attributeViewItemCreation bool
invalidatedAvHistory map[string]bool
@@ -3095,6 +3096,7 @@ func (tx *Transaction) releaseCommittedResources() {
tx.removeCreatedDoc, tx.writeTransactionTree = nil, nil
tx.luteEngine = nil
tx.attributeViewAutomations = nil
+ tx.pushAutomationMessage = nil
tx.attributeViewCollections = nil
tx.attributeViewItemCreation = false
}