213
}
214
215
>
func (d CompletedEventDefinition) Apply(ctx chasm.MutableContext, wf *Workflow, event *historypb.HistoryEvent) error {
nexus_events.go
216
>
attrs := event.GetNexusOperationCompletedEventAttributes()
217
>
field, ok := wf.Operations[attrs.GetScheduledEventId()]
218
>
if !ok {
219
return serviceerror.NewNotFoundf("nexus operation not found for scheduled event ID %d", attrs.GetScheduledEventId())
220
}
222
>
223
>
completeTime := event.GetEventTime().AsTime()
224
>
if err := nexusoperation.TransitionSucceeded.Apply(op, ctx, nexusoperation.EventSucceeded{
225
>
CompleteTime: &completeTime,
226
>
Result: attrs.GetResult(),
227
>
}); err != nil {
228
return err
229
}
231
>
return nil
232
}
233