/// <summary> /// Сериализует процесс /// </summary> /// <param name="bw">Писатель в поток</param> protected virtual void SerializeInternal(CustomBinaryWriter bw) { bw.Write(this.CompleteExecution); bw.Write(this.Id); bw.Write(this.PopulateExceptions); bw.Write((byte)this.Stage); bw.WriteNullable(this.StartedOnServer); bw.Write((byte)this._status); bw.Write((byte)this.TrackMode); bw.Write(this.StartTime); bw.Write(this.FinishTime); bw.Write(this._contextData != null); if (this._contextData != null) { this._contextData.SerializeInternal(bw); } lock (this.Parameters) { bw.Write7BitEncodedInt(this.Parameters.Count); foreach (string key in this.Parameters.Keys) { bw.Write(key); } foreach (object value in this.Parameters.Values) { bw.WriteObject(value); } } //bw.WriteObject(this.Progress); //bw.WriteObject(this.Result); bw.Write(this.Progress != null); if (this.Progress != null) { ((ICustomSerializable)this.Progress).SerializeInternal(bw); } bw.Write(this.Result != null); if (this.Result != null) { ((ICustomSerializable)this.Result).SerializeInternal(bw); } lock (this.ChildProcesses) { bw.Write7BitEncodedInt(this.ChildProcesses.Count); foreach (BizProcess process in this.ChildProcesses) { this.WriteChildProcess(bw, process); } } bw.Write((byte)this.Node.NodeType); bw.Write(this.Node.NodeName); }
/// <summary/> protected void WriteChildProcess(CustomBinaryWriter bw, BizProcess childProcess) { if (BizProcessHolder.Instance.GetType(childProcess.ProcessTypeId) != null) { bw.Write(true); bw.Write(childProcess.ProcessTypeId); childProcess.SerializeInternal(bw); } else { bw.Write(false); bw.WriteObject(childProcess); } }