Skip to content

A scheduled record-generation cadence

When you need this

"Create new records on a schedule." A quarterly audit, a monthly review, a follow-up task per due row. Zero Java — one entity_cadence_config row run by engine-entity.cadence-generator.

Standalone mode — one record per interval

metadata/seed-data/office-equipment-cadence-configs.json (real file):

json
{
  "entity": "entity_cadence_config",
  "keyFields": ["cadence_code"],
  "source": "office-equipment",
  "rows": [
    {
      "cadence_code": "equipment-audit-schedule",
      "target_entity": "oeq_audit",
      "interval_days": 90,
      "dedupe_target_field": "cadence_marker",
      "template_json": {
        "audit_number": "AUDIT-${date}-${ts}",
        "audit_name": "Scheduled Equipment Audit ${date}",
        "status": "DRAFT"
      },
      "active": true
    }
  ]
}

Every 90 days (tracked via last_generated_at) one oeq_audit row is created from template_json. String substitutions: ${date}, ${ts}, ${uuid}.

Source-driven mode — one record per due source row

Add:

json
"source_entity": "oeq_equipment",
"source_date_field": "warranty_expiry_date",
"due_within_days": 30,
"field_map_json": { "equipment_id": "id", "equipment_tag": "asset_tag" },
"dedupe_target_field": "equipment_id"

→ for every oeq_equipment whose warranty expires within 30 days and which doesn't already have a generated row (deduped on equipment_id), create one, copying the mapped fields. ${sourceId} is available in template_json.

Also ship

  • the target entity, the shared entity_cadence_config.json (additive), and
  • metadata/rules/ensure_cadence_generator_job_registered.json (AFTER_CREATEensureEntityCadenceGeneratorJobRegistered).