419
startEvent *historypb.HistoryEvent,
420
bypassTaskGeneration bool,
422
>
// below handles the following cases:
423
>
// 1. if not continue as new & if workflow has no parent
424
>
// -> schedule workflow task & schedule delayed workflow task
425
>
// 2. if not continue as new & if workflow has parent
426
>
// -> this function should not be called during workflow start, but should be called as
427
>
// part of schedule workflow task in 2 phase commit
428
>
//
429
>
// if continue as new
430
>
// 1. whether has parent workflow or not
431
>
// -> schedule workflow task & schedule delayed workflow task
432
>
433
>
startAttr := startEvent.GetWorkflowExecutionStartedEventAttributes()
434
>
workflowTaskBackoffDuration := timestamp.DurationValue(startAttr.GetFirstWorkflowTaskBackoff())
435
>
436
>
if workflowTaskBackoffDuration != 0 {
437
err := m.ms.taskGenerator.GenerateDelayedWorkflowTasks(
438
startEvent,
439
)
440
return 0, err
442
info, err := m.AddWorkflowTaskScheduledEvent(
443
bypassTaskGeneration,