packages feed

keiro-dsl-0.17.0.0: test/fixtures/process-reactions-minimal.keiro

language keiro-dsl 6
context process-reactions-minimal

id IncidentId prefix=inc

process IncidentReaction
  name "incident-reaction"
  reactions version 1
  input IncidentReported { incidentId:IncidentId }
  correlate input.incidentId via idText
  saga IncidentSaga category "incidentSaga"
  target Incident
  projections [ ]
  on IncidentReported
    advance RecordIncident { incidentId }
      accepted
        dispatch Incident@input.incidentId EscalateIncident { incidentId }
          on-appended AckOk ; on-duplicate AckOk ; on-failed Retry
      silent no-action
  dispatch-id strategy=uuidv5 from=(name, correlationId, sourceEventId, targetStreamName, occurrence)
  rejected => halt
  poison => halt

aggregate IncidentSaga
  regs
  states Open
  command RecordIncident { incidentId }
  event IncidentRecorded = fields(RecordIncident)
  Open -- RecordIncident --> emit IncidentRecorded ; goto Open

aggregate Incident
  regs
  states Open
  command EscalateIncident { incidentId }
  event IncidentEscalated = fields(EscalateIncident)
  Open -- EscalateIncident --> emit IncidentEscalated ; goto Open