Exemplo n.º 1
0
        public override void HandleExecute(ChainRequest request)
        {
            //1. Setup Step
            myRequest             = (ButlerProcessRequest)request;
            _MediaServicesContext = new CloudMediaContext(new MediaServicesCredentials(myRequest.MediaAccountName, myRequest.MediaAccountKey));
            myEncodigSupport      = new EncoderSupport(_MediaServicesContext);
            myBlobManager         = BlobManagerFactory.CreateBlobManager(myRequest.ProcessConfigConn);
            allPorcessData        = myBlobManager.GetProcessConfig(myRequest.ButlerRequest.ControlFileUri, myRequest.ProcessTypeId);

            //2. Create Jobs definition
            List <IJobConfiguration> myJobsDefinition = GetJobConfig(myRequest.ProcessInstanceId, myRequest.AssetId, "");

            //3. Execute
            myEncodigSupport.ExecuteMultiJobTaskEncode(myJobsDefinition, myRequest.ProcessInstanceId, MyEncodigSupport_OnJobError, MyEncodigSupport_JobUpdate);

            //4. Update context with output asset ID
            myRequest.AssetId = UpdateOutPut(myJobsDefinition, this.consolidateId);

            //5. Copy all asset files to Output asset and delete all temp Asset
            ConsolidateOutputs(myJobsDefinition, consolidateId);
        }