3489
taskAttributes TaskAttributes,
3490
taskInstance any,
3491
>
) (_ bool, retErr error) {
tree.go
3492
>
defer func() {
3493
>
if retErr == nil {
3494
>
// Mark this node dirty so CloseTransaction cleans up invalid tasks,
3495
>
// including the current one, even if the handler made no state mutations.
3496
>
n.markSubtreeDirty()
3497
>
}
3498
}()
3499
3500
>
registrableTask, ok := n.registry.taskFor(taskInstance)
tree.go
3501
>
if !ok {
3502
return false, fmt.Errorf("unknown task type for task instance goType '%s'", reflect.TypeOf(taskInstance).Name())
3503
}
3504
3505
>
if !registrableTask.isPureTask {
tree.go
3506
return false, fmt.Errorf("ExecutePureTask called on a SideEffect task '%s'", registrableTask.fqType())
3507
}
3508
3509
>
progressIntentCtx := newContextWithOperationIntent(baseCtx, OperationIntentProgress)
tree.go
3510
>
validationContext := NewContext(progressIntentCtx, n)
3511
>
3512
>
// Ensure this node's component value is hydrated before execution.
3513
>
if err := n.prepareComponentValue(validationContext); err != nil {
3514
return false, err
3515
}
3516
3517
// Run the task's registered value before execution.
3518
>
valid, err := n.validateTask(validationContext, TaskInvocation{TaskAttributes: taskAttributes}, taskInstance)
tree.go
3519
>
if err != nil {
3520
return false, err
3521
}
3523
return false, nil
3524
}