AggregateId

The property of a command that holds the id of the aggregate the command acts on, its target: a String the command's class declares, or an interface it implements does, stored or computed from other properties. The compiler generates its read, and the Manifest names it (idProperty), so:

  • the command's routes name no id (POST /{context}/{aggregate}/{command}): the request names its aggregate in its body, and one that names it elsewhere as well (a ref beside the body) names the same one, or is malformed;

  • a saga, a client or another context sends it without an id, which the command gives;

  • a command that creates its aggregate may leave it null: the aggregate's id is then generated, as for any creation that names none; a blank id is malformed.

Wow reads the id from the command's body as a node writes it and, a computed one, from the command as Wow's JSON writes it, so the property is not @JsonIgnored. A stored id is in every body a sender writes, and so is a write-only one (@JsonProperty(access = WRITE_ONLY)), which every node reads from the body, no read answers, and a schedule refuses, as it refuses any write-only value. A computed one is left out of the body a node writes (a forward, the command topic, a schedule's stored command, the Kotlin client), which holds what the class reads, as a form or a console may leave it out: the command's ref carries it, and a service that reads such a body computes it from the command. One property of a command is its aggregate id; an aggregate whose id is its owner's (@AggregateRoot(idSource = OWNER)) takes none, and neither does an @Unaddressed or a mounted command, whose transformer finds the aggregate.

A Java command marks its field, which its public getter reads, or, a record, its component (record Rename(@AggregateId String id, String name)): javac carries the mark to the component's accessor, which is what the FUNCTION target is for. On any other function the mark is a compile error.