289
}
290
291
>
func (d CanceledEventDefinition) Apply(ctx chasm.MutableContext, wf *Workflow, event *historypb.HistoryEvent) error {
nexus_events.go
292
>
attrs := event.GetNexusOperationCanceledEventAttributes()
293
>
field, ok := wf.Operations[attrs.GetScheduledEventId()]
294
>
if !ok {
295
return serviceerror.NewNotFoundf("nexus operation not found for scheduled event ID %d", attrs.GetScheduledEventId())
296
}
298
>
299
>
completeTime := event.GetEventTime().AsTime()
300
>
if err := nexusoperation.TransitionCanceled.Apply(op, ctx, nexusoperation.EventCanceled{
301
>
CompleteTime: &completeTime,
302
>
Failure: attrs.GetFailure().GetCause(),
303
>
}); err != nil {
304
return err
305
}
307
>
return nil
308
}
309