/// <summary>
        /// This method implements the managed stored procedure which drives the execution of the Job Server tasks.
        /// </summary>
        /// <param name="MessageType">Type of the message that must be processed</param>
        /// <param name="Message">Message body from the payload</param>
        /// <param name="ConversationHandle">The handle of the current conversation</param>
        public static void ProcessBatchJobTasks(SqlXml Message, string MessageType, Guid ConversationHandle)
        {
            SqlConnection cnn = new SqlConnection("context connection=true;");

            try
            {
                cnn.Open();

                if (MessageType == "http://schemas.microsoft.com/SQL/ServiceBroker/EndDialog")
                {
                    new ServiceBroker("context connection=true;").EndDialog(ConversationHandle);
                    return;
                }

                if (Message.IsNull)
                {
                    SqlContext.Pipe.Send("No message was supplied for processing.");
                    new ServiceBroker(cnn).EndDialog(ConversationHandle);
                    return;
                }

                XmlDocument doc = new System.Xml.XmlDocument();
                doc.LoadXml(Message.Value);

                // Execute the requested task
                IBatchJob task = BatchJobFactory.GetBatchJobTask(
                    doc.DocumentElement.Attributes["BatchJobType"].Value, cnn);

                task.Execute(Message, ConversationHandle, cnn);
            }
            finally
            {
                cnn.Close();
            }
        }
Пример #2
0

        
Пример #3
0
 public string Serialize(IBatchJob batchjob)
 {
     return(Serializer.Serialize(batchjob));
 }
Пример #4
0
 public string Serialize(IBatchJob batchjob)
 {
     throw new NotImplementedException();
 }