Skip to content

intent: a seeded status NAME in schedules[].where is not resolved - renders .eq("Status", "OVERDUE") and matches nothing, while items.where resolves it #7251

Description

@delchev

Summary

#7164 taught StatusSymbolResolver to resolve a seeded status NAME in a create-from's items: where: (rewriteGeneratesItemsWhere). The construct it was modelled on - schedules[].where, "the same { field, op, value } triples" per the PR and the docs - still has no rewrite: git show origin/master:.../parser/StatusSymbolResolver.java | grep -i schedule finds nothing, and the parser does not refuse a non-numeric value against a function: EntityStatus relation there either.

So

schedules:
  - name: dunning
    cron: "0 0 8 * * ?"
    source: SalesInvoice
    where:
      - { field: Status, op: eq, value: OVERDUE }

parses, generates .eq("Status", "OVERDUE") into the job and matches nothing forever - the exact silent failure #6645 removed for every other status site ("every site that names a status additionally accepts the seeded name"), and the one place a positional id is most tempting to replace with a name, because a schedule filter is where the status guard is written most often (dunning, staleness sweeps, month-end runs).

Fix

Add a rewriteSchedulesWhere beside rewriteGeneratesItemsWhere that resolves the value on the source's status relation (same-model only; a cross-model source keeps id-only and says so, like the header-level rule), and make the parser refuse a non-numeric literal on a status field that the resolver could not map. Document the symbol in the schedules[].where bullet of the engine-intent guide. A StatusSymbolResolverTest case plus one rendered-.glue check pins it.

Found reviewing #7164.

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