604
childWorkflowInitialFail := NewHistoryEventVertex(enumspb.EVENT_TYPE_START_CHILD_WORKFLOW_EXECUTION_FAILED.String())
605
childWorkflowInitialFail.SetDataFunc(func(input ...any) any {
607
>
lastGeneratedEvent := input[1].(*historypb.HistoryEvent)
608
>
eventID := lastGeneratedEvent.GetEventId() + 1
609
>
version := input[2].(int64)
610
>
historyEvent := getDefaultHistoryEvent(eventID, version)
611
>
historyEvent.EventType = enumspb.EVENT_TYPE_START_CHILD_WORKFLOW_EXECUTION_FAILED
612
>
historyEvent.Attributes = &historypb.HistoryEvent_StartChildWorkflowExecutionFailedEventAttributes{StartChildWorkflowExecutionFailedEventAttributes: &historypb.StartChildWorkflowExecutionFailedEventAttributes{
613
>
Namespace: nsName.String(),
614
>
NamespaceId: nsID.String(),
615
>
WorkflowId: childWorkflowID,
616
>
WorkflowType: &commonpb.WorkflowType{Name: childWorkflowPrefix + workflowType},
617
>
Cause: enumspb.START_CHILD_WORKFLOW_EXECUTION_FAILED_CAUSE_WORKFLOW_ALREADY_EXISTS,
618
>
InitiatedEventId: lastEvent.EventId,
619
>
WorkflowTaskCompletedEventId: lastEvent.GetStartChildWorkflowExecutionInitiatedEventAttributes().WorkflowTaskCompletedEventId,
620
>
}}
621
>
return historyEvent
622
>
})
623
childWorkflowStart := NewHistoryEventVertex(enumspb.EVENT_TYPE_CHILD_WORKFLOW_EXECUTION_STARTED.String())
624
childWorkflowStart.SetDataFunc(func(input ...any) any {