UmweltDocs
Reference/Commands/holding.adjustBatch
holding.adjustBatchcommandsince 0.1

Changes the confidence, accessibility or attitude of many Holdings at once, such as a night of forgetting.

Request
umwelt call story.umw holding.adjustBatch '{
  "projectId": "ball",
  "attemptId": "doubt",
  "position": { "tick": 6 },
  "adjustments": [
    {
      "recordId": "butler-found",
      "attitude": "suspects",
      "confidence": 0.4,
      "newRecordId": "butler-unsure"
    }
  ]
}'
Request
const result = await client.holdingAdjustBatch({
  projectId: 'ball',
  attemptId: 'doubt',
  position: { tick: 6 },
  adjustments: [
    {
      recordId: 'butler-found',
      attitude: 'suspects',
      confidence: 0.4,
      newRecordId: 'butler-unsure',
    },
  ],
});
Request
var result = engine.HoldingAdjustBatch(new AdjustHoldingsInput
{
    ProjectId = "ball",
    AttemptId = "doubt",
    Position = new Position { Tick = 6 },
    Adjustments = new()
    {
        new HoldingAdjustment
        {
            RecordId = "butler-found",
            Attitude = Attitude.Suspects,
            Confidence = 0.4,
            NewRecordId = "butler-unsure",
        },
    },
});
Response
{
  "eventId": "01a1cbd8-63f2-7392-ade9-ed363154d2ec",
  "recordIds": ["butler-unsure"],
  "transitionIds": ["01a1cbd8-63f2-7392-ade9-ed4f6d41987f"],
  "version": 10,
  "warnings": []
}

Payload

FieldTypeDescription
projectIdrequiredstringThe project to write to.
attemptIdrequiredstringMakes a retry safe: the same request with the same attempt id is applied once.
positionrequiredPositionWhere the generated event stands on the main axis: { "tick": n }.
adjustmentsrequiredHoldingAdjustment[]One per Holding: the recordId, and a new confidence, accessibility and/or attitude. newRecordId names the copy.
onobjectPositions of the generated event on additional axes, such as { "reading": 12 }.
provenanceProvenanceWho or what made the change: a person, a model, the system or an import.
timelineIdstringdefault "main"The timeline to write to.
expectedVersionintegerFails the write with VERSION_CONFLICT unless the timeline’s head is still this version.

Result

FieldTypeDescription
eventIdalwaysstringThe event written, with the id given or generated.
recordIdsalwaysstring[]The records written, in order.
transitionIdsalwaysstring[]The transitions written, in order.
versionalwaysintegerThe version this commit received. Reads at an earlier asOfVersion do not see it.
warningsWarning[]UNKNOWN_PREDICATE (open vocabulary) or SECRET_BREACH. Warnings never block a write.

Rules

History stays readable. Each Holding is superseded by a copy carrying the new values. A read before the batch sees the old ones.

One commit. With one engine event of type umwelt:adjust, kept out of full-text search.

Errors

VALIDATION_FAILEDA record is not an active Holding at position, is adjusted twice, or an adjustment changes nothing.
NOT_FOUNDThe project, a record 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?