/// <summary> /// Gets the context information. /// </summary> /// <returns></returns> public static string GetContextInfo(this IExtendedWorkflowContext context) { return ("**** Context Info ****" + Environment.NewLine + "Activity: " + context.CodeActivityTypeName + Environment.NewLine + context.ToStringDebug()); }
/// <summary> /// Method that gets called when an exception occurs in the Execute method. Return true if the exception should be rethrown. /// This prevents losing the stack trace by rethrowing the originally caught error. /// </summary> /// <param name="ex"></param> /// <param name="context"></param> /// <returns></returns> protected virtual bool ExecuteExceptionHandler(Exception ex, IExtendedWorkflowContext context) { context.LogException(ex); // Unexpected Exception occurred, log exception then wrap and throw new exception if (context.IsolationMode == (int)IsolationMode.Sandbox) { Sandbox.ExceptionHandler.AssertCanThrow(ex); } return(true); }
/// <summary> /// /// </summary> /// <param name="context"></param> protected abstract void Execute(IExtendedWorkflowContext context);
/// <summary>Gets the value of the specified <see cref="T:System.Activities.InArgument`1" />.</summary> /// <param name="context"></param> /// <param name="argument">The argument to inspect.</param> /// <typeparam name="T">The type of the argument.</typeparam> /// <returns>The value of the argument.</returns> public static T GetValue <T>(this IExtendedWorkflowContext context, InArgument <T> argument) { return(context.CodeActivityContext.GetValue(argument)); }
/// <summary>Gets the value at the specified <see cref="T:System.Activities.LocationReference" />.</summary> /// <param name="context"></param> /// <param name="locationReference">The referenced location to inspect.</param> /// <typeparam name="T">The type of the value.</typeparam> /// <returns>The value of the referenced location.</returns> public static T GetValue <T>(this IExtendedWorkflowContext context, LocationReference locationReference) { return(context.CodeActivityContext.GetValue <T>(locationReference)); }
/// <summary>Gets the execution property of the specified type.</summary> /// <typeparam name="THandle">The type of execution property.</typeparam> /// <returns>The execution property.</returns> public static THandle GetProperty <THandle>(this IExtendedWorkflowContext context) where THandle : Handle { return(context.CodeActivityContext.GetProperty <THandle>()); }
/// <summary>Returns an extension of the specified type.</summary> /// <typeparam name="T">The type of extension to retrieve.</typeparam> /// <returns>The extension of the specified type if present; otherwise, <see langword="null" />.</returns> public static T GetExtension <T>(this IExtendedWorkflowContext context) where T : class { return(context.CodeActivityContext.GetExtension <T>()); }
public override void ExecuteWorkflowActivity(IExtendedWorkflowContext context) { // Workflow activity logic }
public static T Get <T>(this InOutArgument <T> arg, IExtendedWorkflowContext context) { return(arg.Get(context.CodeActivityContext)); }
/// <summary>Assigns a value to the specified <see cref="T:System.Activities.Argument" />.</summary> /// <param name="context"></param> /// <param name="argument">The argument to receive the new value.</param> /// <param name="value">The new value of the argument.</param> public static void SetValue(this IExtendedWorkflowContext context, Argument argument, object value) { context.CodeActivityContext.SetValue(argument, value); }
/// <summary>Sends the specified custom tracking record to any registered tracking providers.</summary> /// <param name="context"></param> /// <param name="record">The data to be tracked.</param> public static void Track(this IExtendedWorkflowContext context, CustomTrackingRecord record) { context.CodeActivityContext.Track(record); }
/// <summary>Assigns a value to the specified <see cref="T:System.Activities.InArgument`1" />.</summary> /// <param name="context"></param> /// <param name="argument">The argument to receive the new value.</param> /// <param name="value">The new value of the argument.</param> /// <typeparam name="T">The type of the argument.</typeparam> public static void SetValue <T>(this IExtendedWorkflowContext context, InArgument <T> argument, T value) { context.CodeActivityContext.SetValue(argument, value); }
/// <summary>Assigns a value to the specified <see cref="T:System.Activities.LocationReference" />.</summary> /// <param name="context"></param> /// <param name="locationReference">The referenced location to receive the new value.</param> /// <param name="value">The new value of the referenced location.</param> /// <typeparam name="T">The type of the location.</typeparam> public static void SetValue <T>(this IExtendedWorkflowContext context, LocationReference locationReference, T value) { context.CodeActivityContext.SetValue(locationReference, value); }
/// <summary>Gets the value of the specified <see cref="T:System.Activities.RuntimeArgument" />.</summary> /// <param name="context"></param> /// <param name="runtimeArgument">The argument to inspect.</param> /// <returns>The value of the argument.</returns> public static object GetValue(this IExtendedWorkflowContext context, RuntimeArgument runtimeArgument) { return(context.CodeActivityContext.GetValue(runtimeArgument)); }
/// <summary> /// Method that gets called after the Execute /// </summary> /// <param name="context">The context.</param> protected virtual void PostExecute(IExtendedWorkflowContext context) { }
public static void Set <T>(this OutArgument <T> arg, IExtendedWorkflowContext context, T value) { arg.Set(context.CodeActivityContext, value); }
/// <summary> /// Execution method for the workflow activity /// </summary> /// <param name="localContext">Context for the current plug-in.</param> public abstract void ExecuteWorkflowActivity(IExtendedWorkflowContext context);
protected sealed override void Execute(IExtendedWorkflowContext context) { Execute((ExtendedWorkflowContext)context); }