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).
Describe the bug
Surfaced while checking #7251 / PR #7269 for other
where-shaped sites. Theevent.whenguard ofnotifications[],integrations[]andoutbound[]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 nowhenhandling at all.NotificationSupport.guard+literalToJava(generator/NotificationSupport.java:296-342): an unquoted word that is not a number/boolean falls through toreturn quote(rhs);.So the most natural authoring of the construct
generates
if (!(java.util.Objects.equals(entity.Status, "ISSUED"))) return;- aLongcompared with aString- 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, postingevent.when,requiredWhen,generates event.when, reportsfilter, and since #7269schedules[].where) accepts the seeded name; #6645's summary inintent-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 ownwhen.Expected
event.whenonnotifications/integrations/outboundis rewritten byStatusSymbolResolveron the event entity's nomenclature, asresolves.event.whenand postingevent.whenalready are.whenthat does not parse is a parse-time refusal, nottrue(therequiredWhengrammar and its typed-literal check are the model).