175
parentInitiatedID := request.ParentInitiatedId
176
if ci.StartedEventId == common.EmptyEventID {
177
>
initiatedEvent, err := mutableState.GetChildExecutionInitiatedEvent(ctx, parentInitiatedID)
api.go
178
>
if err != nil {
179
return consts.ErrChildExecutionNotFound
180
}
181
>
initiatedAttr := initiatedEvent.GetStartChildWorkflowExecutionInitiatedEventAttributes()
api.go
182
>
execution := &commonpb.WorkflowExecution{
183
>
WorkflowId: request.GetChildExecution().GetWorkflowId(),
184
>
RunId: request.GetChildExecution().GetRunId(),
185
>
}
186
>
if request.GetChildFirstExecutionRunId() != "" {
187
execution.RunId = request.GetChildFirstExecutionRunId()
188
}
189
// note values used here should not matter because the child info will be deleted
190
// when the response is recorded, so it should be fine e.g. that ci.Clock is nil
191
>
_, err = mutableState.AddChildWorkflowExecutionStartedEvent(
api.go
192
>
execution,
193
>
initiatedAttr.WorkflowType,
194
>
initiatedEvent.EventId,
195
>
initiatedAttr.Header,
196
>
ci.Clock,
197
>
)
198
>
if err != nil {
199
return err
200
}