protected override void Execute(CodeActivityContext executionContext)
        {
            Context = new WorkflowContext(executionContext);

            #region Log All Inputs

            var properties = GetType().GetProperties(BindingFlags.Instance | BindingFlags.Public);

            properties.ToList().ForEach(p =>
            {
                if (p.PropertyType.IsSubclassOf(typeof(InArgument)) ||
                    p.PropertyType.IsSubclassOf(typeof(InOutArgument)))
                {
                    var propertyLabel = ((InputAttribute)p.GetCustomAttribute(typeof(InputAttribute))).Name;

                    var logText = $"Value of '{propertyLabel}' attribute equals to ";

                    var property      = (Argument)p.GetValue(this);
                    var propertyValue = property.Get(executionContext);

                    if (propertyValue == null)
                    {
                        logText += "empty";
                    }
                    else if (propertyValue is string ||
                             propertyValue is decimal ||
                             propertyValue is int ||
                             propertyValue is bool)
                    {
                        logText += propertyValue.ToString();
                    }
                    else if (propertyValue is DateTime)
                    {
                        logText += ((DateTime)propertyValue).ToString("yyyy-MM-dd HH:mm:ss \"GMT\"zzz");
                    }
                    else if (propertyValue is EntityReference)
                    {
                        var er   = (EntityReference)propertyValue;
                        logText += $"Id: {er.Id}, LogicalName: {er.LogicalName}";
                    }
                    else if (propertyValue is OptionSetValue)
                    {
                        logText += ((OptionSetValue)propertyValue).Value;
                    }
                    else if (propertyValue is Money)
                    {
                        logText += ((Money)propertyValue).Value.ToString(CultureInfo.InvariantCulture);
                    }
                    else
                    {
                        logText += $"undefined type - {p.GetType().FullName}";
                    }

                    Context.TracingService.Trace(logText);
                }
            });

            #endregion Log All Inputs

            try
            {
                ExecuteWorkflowLogic();

                IsExceptionOccured.Set(executionContext, false);
            }
            catch (Exception e)
            {
                if (IsThrowException.Get(Context.ExecutionContext) || Context.IsSyncMode)
                {
                    throw;
                }

                IsExceptionOccured.Set(executionContext, true);
                ErrorMessage.Set(executionContext, e.Message);
            }
        }
        /// <summary>
        /// Executes the specified execution context.
        /// </summary>
        /// <param name="executionContext">The execution context.</param>
        /// <exception cref="ArgumentNullException">ExecutionContext is null</exception>
        /// <exception cref="InvalidPluginExecutionException"></exception>
        /// <exception cref="InvalidPluginExecutionException"></exception>
        /// <exception cref="InvalidPluginExecutionException"></exception>
        /// <exception cref="System.ArgumentNullException">ExecutionContext is null</exception>
        /// <exception cref="Microsoft.Xrm.Sdk.InvalidPluginExecutionException"></exception>
        protected override void Execute(CodeActivityContext executionContext)
        {
            var watch = Stopwatch.StartNew();

            try
            {
                if (executionContext == null)
                {
                    throw new ArgumentNullException("ExecutionContext is null");
                }

                // Obtain the tracing service from the service provider.
                cubeBase.LogSystem = new DetailedLog()
                {
                    TraceService = executionContext.GetExtension <ITracingService>()
                };

                cubeBase.LogSystem.CreateLog(string.Format(CultureInfo.InvariantCulture, "Entered the Main Execute() method : {0}", this.GetType().ToString()));

                // Obtain the execution context from the service provider.
                cubeBase.Context = executionContext.GetExtension <IWorkflowContext>();

                // Use the factory to generate the Organization Service.
                IOrganizationServiceFactory ServiceFactory = executionContext.GetExtension <IOrganizationServiceFactory>();
                cubeBase.XrmService = ServiceFactory.CreateOrganizationService(((IWorkflowContext)cubeBase.Context).UserId);

                cubeBase.BaseSystemObject = executionContext;

                cubeBase.LogSystem.CreateLog(string.Format("Entered the Execute() method"));
                Execute(cubeBase);
                cubeBase.LogSystem.CreateLog(string.Format("Exited the Execute() method"));
            }
            catch (FaultException <Microsoft.Xrm.Sdk.OrganizationServiceFault> ex)
            {
                cubeBase.LogSystem.CreateLog("The application terminated with an Organization Service Fault error.");
                cubeBase.LogSystem.CreateLog(string.Format("Timestamp: {0}", ex.Detail.Timestamp));
                cubeBase.LogSystem.CreateLog(string.Format("Code: {0}", ex.Detail.ErrorCode));
                cubeBase.LogSystem.CreateLog(string.Format("Message: {0}", ex.Detail.Message));
                cubeBase.LogSystem.CreateLog(string.Format("Inner Fault: {0}",
                                                           null == ex.Detail.InnerFault ? "No Inner Fault" : "Has Inner Fault"));

                IsExceptionOccured.Set(executionContext, true);
                ExceptionMessage.Set(executionContext, ex.Message);

                if (ThrowException.Get <bool>(executionContext))
                {
                    throw new InvalidPluginExecutionException(ex.Message, ex);
                }
            }
            catch (System.TimeoutException ex)
            {
                cubeBase.LogSystem.CreateLog("The application terminated with an timeout error.");
                cubeBase.LogSystem.CreateLog(string.Format("Message: {0}", ex.Message));
                cubeBase.LogSystem.CreateLog(string.Format("Stack Trace: {0}", ex.StackTrace));
                cubeBase.LogSystem.CreateLog(string.Format("Inner Fault: {0}",
                                                           null == ex.InnerException.Message ? "No Inner Fault" : ex.InnerException.Message));

                IsExceptionOccured.Set(executionContext, true);
                ExceptionMessage.Set(executionContext, ex.Message);

                if (ThrowException.Get <bool>(executionContext))
                {
                    throw new InvalidPluginExecutionException(ex.Message, ex);
                }
            }
            catch (System.Exception ex)
            {
                cubeBase.LogSystem.CreateLog(string.Format(CultureInfo.InvariantCulture, "General Exception with message: {0}", ex.Message));
                if (ex.InnerException != null)
                {
                    cubeBase.LogSystem.CreateLog("Inner Exception Message:" + ex.InnerException.Message);

                    FaultException <Microsoft.Xrm.Sdk.OrganizationServiceFault> fe = ex.InnerException
                                                                                     as FaultException <Microsoft.Xrm.Sdk.OrganizationServiceFault>;
                    if (fe != null)
                    {
                        cubeBase.LogSystem.CreateLog(string.Format("Fault Exception Timestamp: {0}", fe.Detail.Timestamp));
                        cubeBase.LogSystem.CreateLog(string.Format("Fault Exception Code: {0}", fe.Detail.ErrorCode));
                        cubeBase.LogSystem.CreateLog(string.Format("Fault Exception Message: {0}", fe.Detail.Message));
                        cubeBase.LogSystem.CreateLog(string.Format("Fault Exception Trace: {0}", fe.Detail.TraceText));
                        cubeBase.LogSystem.CreateLog(string.Format("Inner Fault: {0}", null == fe.Detail.InnerFault ? "No Inner Fault" : "Has Inner Fault"));
                    }
                }

                IsExceptionOccured.Set(executionContext, true);
                ExceptionMessage.Set(executionContext, ex.Message);

                if (ThrowException.Get <bool>(executionContext))
                {
                    throw new InvalidPluginExecutionException(ex.Message, ex);
                }
            }
            finally
            {
                if (DetailedException.Get <bool>(executionContext))
                {
                    cubeBase.LogSystem.CreateLog(ContextWriter.Write((IWorkflowContext)cubeBase.Context));
                }

                watch.Stop();
                cubeBase.LogSystem.CreateLog(string.Format(CultureInfo.InvariantCulture, "Finished the Execute() method : {0}", this.GetType().ToString()));
                cubeBase.LogSystem.CreateLog(string.Format(CultureInfo.InvariantCulture, "Internal execution time: {0} ms", watch.ElapsedMilliseconds));
            }
        }