/**
  * Deactivates the channel processing job
  *
  * @param string $json
  * @return string $json
  */
 public function RunWorkflow($json, $key)
 {
     //Setup the logger
     $logger = \Swiftriver\Core\Setup::GetLogger();
     $logger->log("Core::ServiceAPI::ChannelProcessingJobs::DeactivateChannelProcessingJob::RunWorkflow [Method invoked]", \PEAR_LOG_INFO);
     $logger->log("Core::ServiceAPI::ChannelProcessingJobs::DeactivateChannelProcessingJob::RunWorkflow [START: Parsing the JSON input]", \PEAR_LOG_DEBUG);
     //try to parse the id from the JSON
     try {
         //get the ID from the JSON
         $id = parent::ParseJSONToChannelId($json);
     } catch (\Exception $e) {
         //get the exception message
         $message = $e->getMessage();
         $logger->log("Core::ServiceAPI::ChannelProcessingJobs::DeactivateChannelProcessingJob::RunWorkflow [An exception was thrown]", \PEAR_LOG_DEBUG);
         $logger->log("Core::ServiceAPI::ChannelProcessingJobs::DeactivateChannelProcessingJob::RunWorkflow [{$message}]", \PEAR_LOG_ERR);
         $logger->log("Core::ServiceAPI::ChannelProcessingJobs::DeactivateChannelProcessingJob::RunWorkflow [Method finished]", \PEAR_LOG_INFO);
         return parent::FormatErrorMessage("An exception was thrown: {$message}");
     }
     $logger->log("Core::ServiceAPI::ChannelProcessingJobs::DeactivateChannelProcessingJob::RunWorkflow [END: Parsing the JSON input]", \PEAR_LOG_DEBUG);
     $logger->log("Core::ServiceAPI::ChannelProcessingJobs::DeactivateChannelProcessingJob::RunWorkflow [START: Constructing Repository]", \PEAR_LOG_DEBUG);
     try {
         //Construct a new repository
         $repository = new \Swiftriver\Core\DAL\Repositories\ChannelProcessingJobRepository();
     } catch (\Exception $e) {
         //get the exception message
         $message = $e->getMessage();
         $logger->log("Core::ServiceAPI::ChannelProcessingJobs::DeactivateChannelProcessingJob::RunWorkflow [An exception was thrown]", \PEAR_LOG_DEBUG);
         $logger->log("Core::ServiceAPI::ChannelProcessingJobs::DeactivateChannelProcessingJob::RunWorkflow [{$message}]", \PEAR_LOG_ERR);
         $logger->log("Core::ServiceAPI::ChannelProcessingJobs::DeactivateChannelProcessingJob::RunWorkflow [Method finished]", \PEAR_LOG_INFO);
         return parent::FormatErrorMessage("An exception was thrown: {$message}");
     }
     $logger->log("Core::ServiceAPI::ChannelProcessingJobs::DeactivateChannelProcessingJob::RunWorkflow [END: Constructing Repository]", \PEAR_LOG_DEBUG);
     $logger->log("Core::ServiceAPI::ChannelProcessingJobs::DeactivateChannelProcessingJob::RunWorkflow [START: Getting the channel from the repository]", \PEAR_LOG_DEBUG);
     try {
         //Get the channel from the repo
         $channel = $repository->GetChannelProcessingJobById($id);
     } catch (\Exception $e) {
         //get the exception message
         $message = $e->getMessage();
         $logger->log("Core::ServiceAPI::ChannelProcessingJobs::DeactivateChannelProcessingJob::RunWorkflow [An exception was thrown]", \PEAR_LOG_DEBUG);
         $logger->log("Core::ServiceAPI::ChannelProcessingJobs::DeactivateChannelProcessingJob::RunWorkflow [{$message}]", \PEAR_LOG_ERR);
         $logger->log("Core::ServiceAPI::ChannelProcessingJobs::DeactivateChannelProcessingJob::RunWorkflow [Method finished]", \PEAR_LOG_INFO);
         return parent::FormatErrorMessage("An exception was thrown: {$message}");
     }
     $logger->log("Core::ServiceAPI::ChannelProcessingJobs::DeactivateChannelProcessingJob::RunWorkflow [END: Getting the channel from the repository]", \PEAR_LOG_DEBUG);
     $logger->log("Core::ServiceAPI::ChannelProcessingJobs::DeactivateChannelProcessingJob::RunWorkflow [START: Marking channel processing job as inactive and saving to the repository]", \PEAR_LOG_DEBUG);
     try {
         //set the active flag to false
         $channel->active = false;
         //save the channel back to the repo
         $repository->SaveChannelProgessingJob($channel);
     } catch (\Exception $e) {
         //get the exception message
         $message = $e->getMessage();
         $logger->log("Core::ServiceAPI::ChannelProcessingJobs::DeactivateChannelProcessingJob::RunWorkflow [An exception was thrown]", \PEAR_LOG_DEBUG);
         $logger->log("Core::ServiceAPI::ChannelProcessingJobs::DeactivateChannelProcessingJob::RunWorkflow [{$message}]", \PEAR_LOG_ERR);
         $logger->log("Core::ServiceAPI::ChannelProcessingJobs::DeactivateChannelProcessingJob::RunWorkflow [Method finished]", \PEAR_LOG_INFO);
         return parent::FormatErrorMessage("An exception was thrown: {$message}");
     }
     $logger->log("Core::ServiceAPI::ChannelProcessingJobs::DeactivateChannelProcessingJob::RunWorkflow [END: Marking channel processing job as inactive and saving to the repository]", \PEAR_LOG_DEBUG);
     $logger->log("Core::ServiceAPI::ChannelProcessingJobs::DeactivateChannelProcessingJob::RunWorkflow [Method finished]", \PEAR_LOG_INFO);
     //return an OK messagae
     return parent::FormatMessage("OK");
 }