public async Task ValidateAndExecute()
        {
            var ExecutionstepID = new Guid("D84DCB17-AE7D-EA11-82A8-A78CC897533A");

            TransocdeService transocdeService = new TransocdeService();
            var executionStep = await transocdeService.Execute(ExecutionstepID);

            Assert.AreEqual(executionStep.ExecutionStepStatusTypeId, new Guid("D1BD4AC3-FB5B-4F10-85AE-29BECA79E92F"));
        }
示例#2
0
        public override async Task <bool> ProcessRunAsync(SQSAttribute message, string messageKey, TraceContext traceContext)
        {
            string methodName = MethodInfo.GetCurrentMethod().ReflectedType.FullName + "." + MethodInfo.GetCurrentMethod().Name;

            try
            {
                _traceService.Write(traceContext, TraceLevel.Error, methodName, string.Format(TraceHelp.TraceMessageFormat, TraceHelp.Info, "Begin of Transcode Service in Worker for Executionstep: ", message.ExecutionStepID));

                TransocdeService transcode = new TransocdeService();
                switch (message.ProcessType)
                {
                case "Launch":
                    _traceService.Write(traceContext, TraceLevel.Error, methodName, string.Format(TraceHelp.TraceMessageFormat, TraceHelp.Info, "Transcode Service as Launcher for Executionstep: ", message.ExecutionStepID));
                    await transcode.ValidateAndExecute(message.ExecutionStepID);

                    break;

                case "GetStatus":
                    _traceService.Write(traceContext, TraceLevel.Error, methodName, string.Format(TraceHelp.TraceMessageFormat, TraceHelp.Info, "Transcode Service as GetStatus for Executionstep: ", message.ExecutionStepID));
                    await transcode.GetStatus(message.ExecutionStepID);

                    break;

                case "ReceiveStatus":
                    _traceService.Write(traceContext, TraceLevel.Error, methodName, string.Format(TraceHelp.TraceMessageFormat, TraceHelp.Info, "Transcode Service as ReceiveStatus for Executionstep: ", message.ExecutionStepID));
                    //await transcode.ReceiveStatus(JsonConvert.DeserializeObject<ExternalStatus>(message.message));
                    break;

                case "PostStatus":
                    _traceService.Write(traceContext, TraceLevel.Error, methodName, string.Format(TraceHelp.TraceMessageFormat, TraceHelp.Info, "Transcode Service as PostStatus for Executionstep: ", message.ExecutionStepID));
                    await transcode.PostStatus(message.ExecutionStepID);

                    break;

                case "ExceptionStatus":
                    _traceService.Write(traceContext, TraceLevel.Error, methodName, string.Format(TraceHelp.TraceMessageFormat, TraceHelp.Info, "Transcode Service as GetStatus for Executionstep: ", message.ExecutionStepID));
                    await transcode.ProcessException(message.ExecutionStepID);

                    break;

                default:
                    break;
                }

                _traceService.Write(traceContext, TraceLevel.Error, methodName, string.Format(TraceHelp.TraceMessageFormat, TraceHelp.Info, "Begin of Transcode Service in Worker for Executionstep: ", message.ExecutionStepID));
            }
            catch (Exception ex)
            {
                _traceService.Write(traceContext, TraceLevel.Error, methodName, ex);
            }
            return(true);
        }
示例#3
0
        public override async Task <bool> ProcessRunAsync(SQSAttribute message, string messageKey, TraceContext traceContext)
        {
            string methodName = MethodInfo.GetCurrentMethod().ReflectedType.FullName + "." + MethodInfo.GetCurrentMethod().Name;

            try
            {
                TransocdeService transcode = new TransocdeService();
                _traceService.Write(traceContext, TraceLevel.Error, methodName, string.Format(TraceHelp.TraceMessageFormat, TraceHelp.Info, "Transocde Service as GetStatus for Executionstep: ", message.ExecutionStepID));
                await transcode.GetStatus(message.ExecutionStepID);
            }
            catch (Exception ex)
            {
                _traceService.Write(traceContext, TraceLevel.Error, methodName, ex);
            }
            return(true);
        }