in TeamCity.ServiceMessages/Write/Special/Impl/Writer/TeamCityFlowWriter.cs [31:57]
public TCloseBlock OpenFlow()
{
AssertNoChildOpened();
var processor = myTarget.ForNewFlow();
var block = _closeBlock(
new DisposableDelegate(() => CloseBlock(processor)),
processor
);
//##teamcity[flowStarted flowId='%lt;new flow id>' parent='current flow id']
var flowStartedMessage = new ServiceMessage("flowStarted");
if (myTarget.FlowId != null)
{
flowStartedMessage.Add("parent", myTarget.FlowId);
}
processor.AddServiceMessage(flowStartedMessage);
if (!_openChildFlowIds.Add(processor.FlowId))
{
var parentFlowMessagePart = myTarget.FlowId != null ? $" in parent flow '{myTarget.FlowId}'" : "";
throw new InvalidOperationException($"Cannot open a new child flow with id '{processor.FlowId}'" +
$"{parentFlowMessagePart} because a child flow with the same id is already open");
}
return block;
}