public static ComponentProcessMessage CreateClientMessage(this ComponentProcessMessage thisMessage,
                                                           Guid batchId, Guid groupId, Guid jobId, string message)
 {
     return(new ComponentProcessMessage()
     {
         MessageSource = MessageSource.Client,
         BatchId = batchId,
         GroupId = groupId,
         JobId = jobId,
         Message = message
     });
 }
        public static ComponentProcessMessage CreateServerMessage(this ComponentProcessMessage thisMessage,
                                                                  Guid batchId, Guid groupId, Guid jobId, string message)
        {
            var source = MessageSource.ServerJobLevel;

            if (jobId == new Guid() && groupId == new Guid())
            {
                source = MessageSource.ServerBatchLevel;
            }
            else if (jobId == new Guid())
            {
                source = MessageSource.ServerGroupLevel;
            }
            return(new ComponentProcessMessage()
            {
                MessageSource = source,
                BatchId = batchId,
                GroupId = groupId,
                JobId = jobId,
                Message = message
            });
        }