packages feed

keiro-dsl-0.15.0.0: test/fixtures/process-bad-timer.keiro

language keiro-dsl 4
context repro

process Demo
  name "demo"
  input DemoInput { thingId observedAt:Time }
  correlate input.thingId via idText
  saga Saga category "demo"
  target Target
  projections [ ]

  on DemoInput
    advance AdvanceSaga { thingId }
    dispatch Target@input.thingId ActivateTarget { notAField }
      on-appended AckOk ; on-duplicate Retry ; on-failed Retry
    schedule demoTimer

  dispatch-id strategy=uuidv5 from=(name, correlationId, sourceEventId, emitIndex)
  rejected => halt
  poison => halt

  timer demoTimer
    id uuidv5 "demo-timer:" <> correlationId
    fireAt input.observedAt + 5m
    payload { kind="demo" }
    fire dispatch Saga@correlationId FireSaga { thingId }
      fired-event-id uuidv5 "demo-fired:" <> correlationId
      on-ok Fired ; on-reject Retry ; on-ambiguous Retry ; on-error Retry ; not-mine Retry
    decode unknown-status => Cancelled
    max-attempts 0 dead-letter "ceiling"

aggregate Saga
  regs
  states Idle

  command AdvanceSaga { thingId }
  command FireSaga { thingId }

aggregate Target
  regs
  states Ready

  command ActivateTarget { thingId }