Exemplo n.º 1
0
 /// <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());
 }
Exemplo n.º 2
0
 /// <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);
 }
Exemplo n.º 3
0
 /// <summary>
 ///
 /// </summary>
 /// <param name="context"></param>
 protected abstract void Execute(IExtendedWorkflowContext context);
Exemplo n.º 4
0
 /// <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));
 }
Exemplo n.º 5
0
 /// <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));
 }
Exemplo n.º 6
0
 /// <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>());
 }
Exemplo n.º 7
0
 /// <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>());
 }
Exemplo n.º 8
0
 public override void ExecuteWorkflowActivity(IExtendedWorkflowContext context)
 {
     // Workflow activity logic
 }
Exemplo n.º 9
0
 public static T Get <T>(this InOutArgument <T> arg, IExtendedWorkflowContext context)
 {
     return(arg.Get(context.CodeActivityContext));
 }
Exemplo n.º 10
0
 /// <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);
 }
Exemplo n.º 11
0
 /// <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);
 }
Exemplo n.º 12
0
 /// <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);
 }
Exemplo n.º 13
0
 /// <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);
 }
Exemplo n.º 14
0
 /// <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));
 }
Exemplo n.º 15
0
 /// <summary>
 /// Method that gets called after the Execute
 /// </summary>
 /// <param name="context">The context.</param>
 protected virtual void PostExecute(IExtendedWorkflowContext context)
 {
 }
Exemplo n.º 16
0
 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);
 }