メインコンテンツまでスキップ
バージョン: 21 R5 BETA

ProcessResult

The ProcessResult class is the return value of every batch entry point of Process (process, processEntity, processEntitySelection). It accumulates statistics, per-error breakdowns, and wall-clock duration.

The orchestrator never throws out of its public batch API — failures are recorded here and the job continues. The caller decides what to do with them.

Properties​

Property NameTypeDescription
definitionsProcessedIntegerNumber of Definition entries processed.
entitiesConsideredIntegerNumber of entities that passed the "needs recompute" filter.
entitiesUpdatedIntegerNumber of entities whose vector was successfully written and saved.
entitiesSkippedIntegerNumber of entities that could not be processed: individual embed or save errors, or whole-chunk API failures (those entities are left unchanged for the next run).
apiCallsIntegerNumber of embeddings API calls made.
promptTokensIntegerTotal prompt tokens consumed across all API calls in this run.
totalTokensIntegerTotal tokens consumed across all API calls in this run.
durationIntegerTotal duration of the job in milliseconds.
errorsCollectionList of ProcessError entries recorded during the run.

Computed properties​

PropertyTypeDescription
successBooleanTrue when no "error" or "fatal" entry was recorded. "warning" entries do not fail the run.
hasFatalBooleanTrue when at least one "fatal" entry was recorded (e.g. a model became unavailable).

Error entries​

Each item in errors is a ProcessError with scope, severity, code, ref, message, and retryable. See ProcessError for the field meanings and ProcessErrorCode for the code catalogue.

Functions​

errorsByScope()​

errorsByScope( $scope : Text ) : Collection

Errors filtered by scope ("pipeline", "definition", "chunk", "entity").

errorsByCode()​

errorsByCode( $code : Integer ) : Collection

Errors filtered by machine-readable code — see ProcessErrorCode.

retryableErrors()​

retryableErrors() : Collection

Errors flagged retryable — re-running the operation could plausibly succeed.

toObject()​

toObject() : Object

Returns a plain object suitable for logging or JSON serialization.

ArgumentTypeDescription
Function resultObjectA JSON-friendly snapshot of the report.
var $r:=$p.process()
LOG EVENT(Into 4D log file; JSON Stringify($r.toObject()))

Example​

var $r:=$p.processEntitySelection(ds.Students.all(); $def)

If ($r.success)
ALERT("Updated "+String($r.entitiesUpdated)+" students in "+String($r.duration)+" ms")
Else
var $err : Object
For each ($err; $r.errors)
ALERT("[" + $err.scope + "] " + String($err.ref) + " — " + $err.message)
End for each
End if

See also​