Skip to content

intent: notifications/integrations/outbound event.when never resolves a seeded status name and degrades an unparsable guard to true #7289

Description

@delchev

Describe the bug

Surfaced while checking #7251 / PR #7269 for other where-shaped sites. The event.when guard of notifications[], integrations[] and outbound[] is a status-guard site that neither resolves a seeded status name nor checks the guard's shape:

  • StatusSymbolResolver.resolve (parser/StatusSymbolResolver.java:82-89) rewrites entities, transitions, processes, postings, generates, schedules, resolves and reports - nothing for the three glue lists.
  • IntentParser.validateEventBinding (:2666-2722) / validateNotifications (:2632-2665) contain no when handling at all.
  • The renderer, NotificationSupport.guard + literalToJava (generator/NotificationSupport.java:296-342): an unquoted word that is not a number/boolean falls through to return quote(rhs);.

So the most natural authoring of the construct

notifications:
  - name: issued-mail
    event: { onUpdate: SalesInvoice, when: "Status == ISSUED" }

generates if (!(java.util.Objects.equals(entity.Status, "ISSUED"))) return; - a Long compared with a String - and the mail never goes out, with parse, generation, compile and publish all green. Every other guard in the DSL (transitions, abortOn.status, wait when, resolves event.when, posting event.when, requiredWhen, generates event.when, reports filter, and since #7269 schedules[].where) accepts the seeded name; #6645's summary in intent-layer.md ("every site that names a status additionally accepts the seeded name") does not hold for this axis.

Second half of the same gap: guard() returns "true" for anything that does not match its one regex, so a guard with a typo (Status = ISSUED, status == 'ISSUED' and ...) silently disables itself and the notification fires on every update - the degradation #7094 (requiredWhen) explicitly refused to accept for its own when.

Expected

  • event.when on notifications/integrations/outbound is rewritten by StatusSymbolResolver on the event entity's nomenclature, as resolves.event.when and posting event.when already are.
  • A when that does not parse is a parse-time refusal, not true (the requiredWhen grammar and its typed-literal check are the model).

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions