disposition.setBatchcommandsince 0.1
Sets many Dispositions at once: how holders stand toward others, along named dimensions.
Request
umwelt call story.umw disposition.setBatch '{
"projectId": "ball",
"attemptId": "feelings",
"position": { "tick": 5 },
"dispositions": [
{
"holder": "duchess",
"target": "bob",
"dimension": "trust",
"value": 0.9
},
{ "holder": "ana", "target": "bob", "dimension": "fear", "value": 0.6 }
]
}'Request
const result = await client.dispositionSetBatch({
projectId: 'ball',
attemptId: 'feelings',
position: { tick: 5 },
dispositions: [
{ holder: 'duchess', target: 'bob', dimension: 'trust', value: 0.9 },
{ holder: 'ana', target: 'bob', dimension: 'fear', value: 0.6 },
],
});Request
var result = engine.DispositionSetBatch(new SetDispositionsInput
{
ProjectId = "ball",
AttemptId = "feelings",
Position = new Position { Tick = 5 },
Dispositions = new()
{
new DispositionSetting
{
Holder = "duchess",
Target = "bob",
Dimension = "trust",
Value = JsonSerializer.SerializeToElement(0.9),
},
new DispositionSetting
{
Holder = "ana",
Target = "bob",
Dimension = "fear",
Value = JsonSerializer.SerializeToElement(0.6),
},
},
});Response
{
"eventId": "01a1cbd8-63eb-7582-b85c-f6d27a940591",
"recordIds": [
"01a1cbd8-63eb-7582-b85c-f6eb411602a1",
"01a1cbd8-63eb-7582-b85c-f6ff9c0dbb87"
],
"transitionIds": [],
"version": 8,
"warnings": []
}Payload
| Field | Type | Description |
|---|---|---|
projectIdrequired | string | The project to write to. |
attemptIdrequired | string | Makes a retry safe: the same request with the same attempt id is applied once. |
positionrequired | Position | Where the generated event stands on the main axis: { "tick": n }. |
dispositionsrequired | DispositionSetting[] | One per setting: holder, target, dimension (trust, fear, affection) and value. |
on | object | Positions of the generated event on additional axes, such as { "reading": 12 }. |
provenance | Provenance | Who or what made the change: a person, a model, the system or an import. |
timelineId | stringdefault "main" | The timeline to write to. |
expectedVersion | integer | Fails the write with VERSION_CONFLICT unless the timeline’s head is still this version. |
Result
| Field | Type | Description |
|---|---|---|
eventIdalways | string | The event written, with the id given or generated. |
recordIdsalways | string[] | The records written, in order. |
transitionIdsalways | string[] | The transitions written, in order. |
versionalways | integer | The version this commit received. Reads at an earlier asOfVersion do not see it. |
warnings | Warning[] | UNKNOWN_PREDICATE (open vocabulary) or SECRET_BREACH. Warnings never block a write. |
Rules
The newest one is current. Per holder, target and dimension, the latest Disposition is the one that counts.
Dispositions are directional. What Ana feels toward Bob says nothing about what Bob feels toward Ana.
One commit. With one engine event of type umwelt:disposition, kept out of full-text search.
Errors
VALIDATION_FAILEDThe payload is malformed, or a holder cannot hold.NOT_FOUNDThe project, an entity or the timeline does not exist.VERSION_CONFLICTexpectedVersion is no longer the head of the timeline.CONFLICTThe attemptId was already used with a different request.INVALID_STATEThe timeline is a draft that was promoted or discarded, and accepts no more writes.HANDSHAKE_REQUIREDOver the protocol, hello was not sent first.Every code is listed in Errors.
See also
Was this page helpful?