332
},
333
activitypb.ACTIVITY_EXECUTION_STATUS_CANCELED,
334
>
func(a *Activity, ctx chasm.MutableContext, event cancelEvent) error {
statemachine.go
335
>
return a.StoreOrSelf(ctx).RecordCompleted(ctx, func(ctx chasm.MutableContext) error {
336
>
outcome := a.Outcome.Get(ctx)
337
>
failure := &failurepb.Failure{
338
>
Message: "Activity canceled",
339
>
FailureInfo: &failurepb.Failure_CanceledFailureInfo{
340
>
CanceledFailureInfo: &failurepb.CanceledFailureInfo{
341
>
Details: event.details,
342
>
Identity: a.GetCancelState().GetIdentity(),
343
>
},
344
>
},
345
>
}
346
>
outcome.Variant = &activitypb.ActivityOutcome_Failed_{
347
>
Failed: &activitypb.ActivityOutcome_Failed{
348
>
Failure: failure,
349
>
},
350
>
}
351
>
352
>
a.emitOnCanceledMetrics(ctx, event.metricsHandler, event.fromStatus)
353
>
354
>
return nil
355
>
})
356
},
357
)