685
childWorkflowFail := NewHistoryEventVertex(enumspb.EVENT_TYPE_CHILD_WORKFLOW_EXECUTION_FAILED.String())
686
childWorkflowFail.SetDataFunc(func(input ...any) any {
688
>
lastGeneratedEvent := input[1].(*historypb.HistoryEvent)
689
>
eventID := lastGeneratedEvent.GetEventId() + 1
690
>
version := input[2].(int64)
691
>
historyEvent := getDefaultHistoryEvent(eventID, version)
692
>
historyEvent.EventType = enumspb.EVENT_TYPE_CHILD_WORKFLOW_EXECUTION_FAILED
693
>
historyEvent.Attributes = &historypb.HistoryEvent_ChildWorkflowExecutionFailedEventAttributes{ChildWorkflowExecutionFailedEventAttributes: &historypb.ChildWorkflowExecutionFailedEventAttributes{
694
>
Namespace: nsName.String(),
695
>
NamespaceId: nsID.String(),
696
>
WorkflowType: &commonpb.WorkflowType{Name: childWorkflowPrefix + workflowType},
697
>
InitiatedEventId: lastEvent.GetChildWorkflowExecutionStartedEventAttributes().InitiatedEventId,
698
>
WorkflowExecution: &commonpb.WorkflowExecution{
699
>
WorkflowId: childWorkflowID,
700
>
RunId: lastEvent.GetChildWorkflowExecutionStartedEventAttributes().GetWorkflowExecution().RunId,
701
>
},
702
>
StartedEventId: lastEvent.EventId,
703
>
}}
704
>
return historyEvent
705
>
})
706
childWorkflowTerminate := NewHistoryEventVertex(enumspb.EVENT_TYPE_CHILD_WORKFLOW_EXECUTION_TERMINATED.String())
707
childWorkflowTerminate.SetDataFunc(func(input ...any) any {
709
>
lastGeneratedEvent := input[1].(*historypb.HistoryEvent)
710
>
eventID := lastGeneratedEvent.GetEventId() + 1
711
>
version := input[2].(int64)
712
>
historyEvent := getDefaultHistoryEvent(eventID, version)
713
>
historyEvent.EventType = enumspb.EVENT_TYPE_CHILD_WORKFLOW_EXECUTION_TERMINATED
714
>
historyEvent.Attributes = &historypb.HistoryEvent_ChildWorkflowExecutionTerminatedEventAttributes{ChildWorkflowExecutionTerminatedEventAttributes: &historypb.ChildWorkflowExecutionTerminatedEventAttributes{
715
>
Namespace: nsName.String(),
716
>
NamespaceId: nsID.String(),
717
>
WorkflowType: &commonpb.WorkflowType{Name: childWorkflowPrefix + workflowType},
718
>
InitiatedEventId: lastEvent.GetChildWorkflowExecutionStartedEventAttributes().InitiatedEventId,
719
>
WorkflowExecution: &commonpb.WorkflowExecution{
720
>
WorkflowId: childWorkflowID,
721
>
RunId: lastEvent.GetChildWorkflowExecutionStartedEventAttributes().GetWorkflowExecution().RunId,
722
>
},
723
>
StartedEventId: lastEvent.EventId,
724
>
}}
725
>
return historyEvent
726
>
})
727
childWorkflowTimedOut := NewHistoryEventVertex(enumspb.EVENT_TYPE_CHILD_WORKFLOW_EXECUTION_TIMED_OUT.String())
728
childWorkflowTimedOut.SetDataFunc(func(input ...any) any {