writeLog
Writes the message to the App log. Can be used to write App variables into the log.
AI Generated
writeLog()
Purpose
Adds a custom message to the application log. This stage allows for dynamic message generation using state values, facilitating debugging and tracking of pipeline execution.
Location
src/app/services/genericStages/generic-stages.service.ts
Signature
writeLog(
pipelineConfig: PipelineStageConfig
): OperatorFunction<StatusObject, Observable<boolean>>
Parameters
| Parameter | Type | Description |
|---|---|---|
pipelineConfig |
PipelineStageConfig |
Contains logParameters and the pushToLog function. |
Command Configuration
The stage uses values from:
pipelineConfig.stageConfig.logParameters
Supported Parameters
| Parameter | Description |
|---|---|
message |
The log message template. Supports placeholders (e.g., ${key}) replaced by values from the application state. |
Example Configuration
{
"logParameters": {
"message": "Measurement completed for user: ${persistentValues.user_id}"
},
"eventTargets": {
"onSuccess": "NEXT_STAGE"
}
}
Workflow
- Read
messagefromlogParameters. - If
messageis empty, executeonFail. - Interpolate state values into the message template using
${}syntax. - Call
pipelineConfig.pushToLog()with the processed message. - Execute
onSuccess.
Behavior
- Success: The log entry is created, and the
onSuccesstarget is triggered. - Failure: If no message is provided, the
onFailtarget is triggered. - Interpolation: Uses
fillString()to inject values frompipelineConfig.state. Path access is supported (e.g.,${group.key}).
