spec: the glue event axis - process-step events and inbound message/file arrivals - #21
Open
delchev wants to merge 1 commit into
Open
spec: the glue event axis - process-step events and inbound message/file arrivals#21delchev wants to merge 1 commit into
delchev wants to merge 1 commit into
Conversation
…ile arrivals
A reacting glue entry (notifications, integrations) could only bind to an entity
lifecycle event, and `inbound` could only be a webhook. Two things every real
application needs were therefore inexpressible: reacting to a moment IN a process
("when this task becomes available, tell the assignee's manager"), and ingesting a
record that arrives on a queue/topic or as a dropped file.
Both are added without a second action vocabulary:
- `onStepReached` / `onStepCompleted: { process, step }` join the event axis. A step
event is an event about the record the process runs on - its trigger entity - so
every recipient path, placeholder, guard and forwarded body reads exactly as it does
for a lifecycle event. Normative: the process and step must be declared, the step
must be one that occupies an observable moment (a task), the process must have a
trigger, a completed step must be observed after its writes are persisted, and one
moment publishes once however many entries observe it.
- `inbound` declares exactly one arrival: `path` (HTTP), `source: { queue | topic }`,
or `source: { folder, cron }`. All three save through the entity's ordinary write
path - the arrival is a transport, not a second data path. A folder is polled, not
watched, and a read file leaves the drop folder so nothing is ingested twice.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem
A reacting glue entry (
notifications,integrations) could bind only to an entity lifecycle event, andinboundcould only be an HTTP webhook. Two things every real application needs were therefore inexpressible:Proposed shape
Both extend an existing axis rather than adding a vocabulary.
Expected behaviour (normative, platform-neutral)
Step events. A step event is an event about the record the process runs on — the process's
triggerentity — so every action parameter (recipient rule,{placeholder}interpolation,when:guard, forwarded body) resolves exactly as for a lifecycle event; no action needs to know which axis fired it. A conforming generator rejects a binding whose process or step is not declared, whose step is not one that occupies an observable moment (a task, not a decision/wait/end), or whose process has notrigger(there is then no record to be about).onStepReachedis observable before the step's own work begins;onStepCompletedafter it finished and after that step's writes are persisted, so an observer never sees a stale record. One moment publishes once, however many entries observe it; a jump back into an observed step re-fires itsonStepReachedobservers.Inbound arrivals. Exactly one arrival per entry:
path, or asourcenaming exactly one ofqueue/topic/folder. All three save through the entity's ordinary write path — the arrival is a transport, not a second data path, so validations, translations and the create event behave identically. A folder is polled, not watched (hence the mandatorycron, which is an error on the other sources); a file holds one record or an array of them, is not read while still being written, and leaves the drop folder once read — ingested and rejected files kept apart — so nothing is ingested twice and a rejection stays inspectable.Conversation-shaped transports (acknowledgements, retries with backoff, certificates) stay beyond the scope boundary, as they are today.
Prior art
Handled today by hand-written listener/job code alongside the generated application: a process listener that fetches the record and mails, a queue consumer that parses and saves, a scheduled folder scan. Each is mechanical, and each re-implements the recipient/interpolation rules the format already defines.