public static bool ControlledExecution(IJobActivity activity, TraceContext traceContext, Action <string> audit, IDictionary <string, string> parameters)
        {
            var success = false;

            try
            {
                traceContext.ActivityStart();
                var jobContext = new JobContext(traceContext, parameters);
                activity.Execute(jobContext);
                success = true;
                if (audit != null)
                {
                    audit(null);
                }
            }
            catch (Exception ex)
            {
                traceContext.Error(ex.ToString());
                if (audit != null)
                {
                    audit(ex.Message);
                }
            }
            finally
            {
                traceContext.ActivityFinish(success);
                traceContext.FlashTraceBuffer();
            }
            return(success);
        }
		public static bool ControlledExecution(IJobActivity activity, TraceContext traceContext, Action<string> audit, IDictionary<string,string> parameters)
		{
			var success = false;
			try
			{
				traceContext.ActivityStart();
                var jobContext = new JobContext(traceContext, parameters);
				activity.Execute(jobContext);
				success = true;
			    if (audit != null)
			    {
			        audit(null);
			    }
			}
			catch (Exception ex)
			{
				traceContext.Error(ex.ToString());
				if (audit != null)
					audit(ex.Message);
			}
			finally
			{
				traceContext.ActivityFinish(success);
				traceContext.FlashTraceBuffer();
			}
			return success;
		}