195
},
196
activitypb.ACTIVITY_EXECUTION_STATUS_COMPLETED,
197
>
func(a *Activity, ctx chasm.MutableContext, event completeEvent) error {
statemachine.go
198
>
return a.StoreOrSelf(ctx).RecordCompleted(ctx, func(ctx chasm.MutableContext) error {
199
>
req := event.req.GetCompleteRequest()
200
>
201
>
attempt := a.LastAttempt.Get(ctx)
202
>
attempt.CompleteTime = timestamppb.New(ctx.Now(a))
203
>
attempt.LastWorkerIdentity = req.GetIdentity()
204
>
outcome := a.Outcome.Get(ctx)
205
>
outcome.Variant = &activitypb.ActivityOutcome_Successful_{
206
>
Successful: &activitypb.ActivityOutcome_Successful{
207
>
Output: req.GetResult(),
208
>
},
209
>
}
210
>
211
>
a.emitOnCompletedMetrics(ctx, event.metricsHandler)
212
>
213
>
return nil
214
>
})
215
},
216
)