Пример #1
0
        public void Serialize(ExecutionResult result, IFastJsonWriter writer, IWorkSession session)
        {
            writer.WriteStartObject();

            writer.WritePropertyStartArray("output");
            SerializeOutput(result.Output, writer);
            writer.WriteEndArray();

            writer.WritePropertyStartArray("flow");
            foreach (var step in result.Flow)
            {
                SerializeFlowStep(step, writer);
            }
            writer.WriteEndArray();

            if (session.GetContainerExperimentException() is {} exception&& !session.WasContainerExperimentExceptionReported())
            {
                writer.WriteProperty("containerExperimentException", exception.ToString());
                session.SetContainerExperimentExceptionReported(true);
            }

            writer.WriteEndObject();
        }