Enhance documentation and workflow management in EspoCRM
- Update README.md to include a table of contents and detailed sections on workflow management and custom scripts. - Remove deprecated 'runWorkflow' field from CVmhErstgespraech localization files. - Add 'runWorkflow' field to detail layout for CVmhErstgespraech. - Update workflow_manager.php to improve workflow listing and management functionality. - Adjust cache timestamps in config.php. - Create CUSTOM_DIRECTORY.md to outline the custom directory structure and best practices. - Add README.md for workflow definitions with usage examples and JSON format specifications. - Introduce new workflow definitions for 'vmh-erstberatung-abschließen' and its backup.
This commit is contained in:
122
custom/CUSTOM_DIRECTORY.md
Normal file
122
custom/CUSTOM_DIRECTORY.md
Normal file
@@ -0,0 +1,122 @@
|
||||
# EspoCRM Custom Directory - Übersicht
|
||||
|
||||
## Verzeichnisstruktur
|
||||
|
||||
```
|
||||
custom/
|
||||
├── Espo/
|
||||
│ ├── Custom/ # Custom Entitäten, Services, Controller etc.
|
||||
│ └── Modules/ # Custom Module
|
||||
├── scripts/ # Custom PHP Scripts für Wartung/Verwaltung
|
||||
│ ├── check_and_rebuild.sh
|
||||
│ └── workflow_manager.php
|
||||
└── workflows/ # Workflow-Definitionen als JSON
|
||||
├── README.md
|
||||
├── vmh-erstberatung-abschliessen.json
|
||||
└── vmh-erstberatung-abschliessen-backup.json
|
||||
```
|
||||
|
||||
## Zweck der Verzeichnisse
|
||||
|
||||
### custom/Espo/Custom/
|
||||
Hauptverzeichnis für EspoCRM-Customizations:
|
||||
- `Resources/metadata/` - Entity-, Field-, Client-Definitionen
|
||||
- `Resources/layouts/` - UI-Layout-Definitionen
|
||||
- `Resources/i18n/` - Übersetzungen
|
||||
- `Classes/` - Custom PHP-Klassen
|
||||
- `Controllers/` - Custom Controller
|
||||
- `Services/` - Custom Services
|
||||
- `Repositories/` - Custom Repositories
|
||||
|
||||
### custom/Espo/Modules/
|
||||
Zusätzliche Module (z.B. von Extensions):
|
||||
- Jedes Modul hat eigene `Resources/metadata/` Struktur
|
||||
- Module sind gekapselt und wiederverwendbar
|
||||
|
||||
### custom/scripts/
|
||||
**PHP Scripts für Wartung und Verwaltung:**
|
||||
|
||||
#### workflow_manager.php
|
||||
Zentrale Schnittstelle für Workflow-Verwaltung:
|
||||
- **list** - Alle Workflows (BPM + Simple) auflisten
|
||||
- **read** - Workflow-Details anzeigen
|
||||
- **import** - Workflow aus JSON importieren
|
||||
- **export** - Workflow nach JSON exportieren
|
||||
- **delete** - Workflow löschen
|
||||
|
||||
**Verwendung:**
|
||||
```bash
|
||||
docker exec espocrm php /var/www/html/custom/scripts/workflow_manager.php <action> [args]
|
||||
```
|
||||
|
||||
#### check_and_rebuild.sh
|
||||
Validierung und Rebuild:
|
||||
- JSON-Syntax-Prüfung
|
||||
- EspoCRM Rebuild
|
||||
- Cache-Bereinigung
|
||||
|
||||
### custom/workflows/
|
||||
**Workflow-Definitionen als JSON:**
|
||||
- Versionskontrolle für Workflows
|
||||
- Import/Export über workflow_manager.php
|
||||
- Sowohl Simple Workflows als auch BPM Flowcharts
|
||||
- Format-Dokumentation in `README.md`
|
||||
|
||||
**Workflow-Typen:**
|
||||
1. **Simple Workflows** - Regel-basierte Automationen
|
||||
- Trigger: afterRecordSaved, afterRecordCreated, scheduled, manual
|
||||
- Bedingungen: Feld-Vergleiche (equals, changed, contains, etc.)
|
||||
- Aktionen: sendEmail, createEntity, updateEntity, etc.
|
||||
|
||||
2. **BPM Flowcharts** - Komplexe BPMN 2.0-Workflows
|
||||
- Visuelle Designer im Admin-Interface
|
||||
- Start-Events, Gateways, Tasks, End-Events
|
||||
- Für mehrstufige Geschäftsprozesse
|
||||
|
||||
## Best Practices
|
||||
|
||||
### Workflow-Entwicklung
|
||||
1. Workflow als JSON in `custom/workflows/` erstellen
|
||||
2. Mit `workflow_manager.php import` einspielen
|
||||
3. Im Admin-Interface testen
|
||||
4. Bei Änderungen: Export → Anpassung → Import
|
||||
|
||||
### Versionskontrolle
|
||||
- Alle JSON-Dateien in Git committen
|
||||
- Beschreibende Dateinamen (z.B. `vmh-<entity>-<funktion>.json`)
|
||||
- Regelmäßig Backups per `export` erstellen
|
||||
|
||||
### Änderungen anwenden
|
||||
Nach Metadata-Änderungen immer:
|
||||
```bash
|
||||
docker exec espocrm php /var/www/html/command.php rebuild
|
||||
# oder
|
||||
./custom/scripts/check_and_rebuild.sh
|
||||
```
|
||||
|
||||
## Nützliche Befehle
|
||||
|
||||
```bash
|
||||
# Alle Workflows auflisten
|
||||
docker exec espocrm php /var/www/html/custom/scripts/workflow_manager.php list
|
||||
|
||||
# Workflow importieren
|
||||
docker exec espocrm php /var/www/html/custom/scripts/workflow_manager.php import \
|
||||
/var/www/html/custom/workflows/my-workflow.json
|
||||
|
||||
# Workflow exportieren (Backup)
|
||||
docker exec espocrm php /var/www/html/custom/scripts/workflow_manager.php export \
|
||||
<workflow-id> /var/www/html/custom/workflows/backup-workflow.json
|
||||
|
||||
# System rebuilden
|
||||
docker exec espocrm php /var/www/html/command.php rebuild
|
||||
|
||||
# Cache löschen
|
||||
docker exec espocrm rm -rf /var/www/html/data/cache/*
|
||||
```
|
||||
|
||||
## Dokumentation
|
||||
|
||||
- **Hauptdokumentation:** `/README.md` - Vollständige KI-Dokumentation für EspoCRM
|
||||
- **Workflow-Formate:** `/custom/workflows/README.md` - JSON-Format-Spezifikationen
|
||||
- **EspoCRM Docs:** https://docs.espocrm.com
|
||||
Reference in New Issue
Block a user