Introduction

 

When configuring an E-mail Event's Escalation setting, the method used to validate the context parts was considered insufficient for the various environments in which these events are being used and could result in a casting error. The E-mail Event validation methodology has been enhanced to ensure that the validation methods used no longer contain any limitations.

Error Scenario

Note: The circumstances described in this article are one scenario under which this issue may, or is known to occur. The description is intended to be specific to the scenario described and does not take into account all possible scenarios or circumstances.

To reproduce this error, do the following:

  1. Build a process which contains K2 E-mail Event(s)
  2. Configure the E-mail Event(s) as follows:
  3. Populate the To and From fields using details from the context browser for example, Activity Instance Destination user email, or Originator email in K2 Designer for SharePoint
  4. Add Process/Event/Activity email escalations configured in the same way
  5. Create different planning options and destinations for the Email Events
  6. Deploy the process. The following results can be expected:
    1. If the planning option is set to Plan Just Once an exception is thrown
    2. If no destination user is set (e.g. for a process level email escalation) an exception should be thrown (no destination user for the activity instance destination user email to reference)

Error Message

The following error message has been known to occur, and an example of an expected error message is shown below:

Exception has been thrown by the target of an invocation.
at System.RuntimeMethodHandle._InvokeMethodFast(Object target, Object[] arguments, SignatureStruct& sig, MethodAttributes methodAttributes, RuntimeTypeHandle typeOwner)
at System.Reflection.RuntimeMethodInfo.Invoke(Object obj, BindingFlags invokeAttr, Binder binder, Object[] parameters, CultureInfo culture, Boolean skipVisibilityChecks)
at System.Reflection.RuntimeMethodInfo.Invoke(Object obj, BindingFlags invokeAttr, Binder binder, Object[] parameters, CultureInfo culture)
at System.Reflection.RuntimePropertyInfo.GetValue(Object obj, Object[] index)
at SourceCode.Workflow.Design.DesignHelper.ActivityInstanceDestUserWorkflowContextInK2Fields(PersistableObject persistableObj, Boolean userOnly)
at SourceCode.Workflow.Design.Mail.MailEventItem.Validate()
at SourceCode.Framework.PersistableObject.SourceCode.Framework.IValidationContainer.Validate()
at SourceCode.Workflow.Authoring.Event.Validate()
at SourceCode.Framework.PersistableObject.SourceCode.Framework.IValidationContainer.Validate()
at SourceCode.Framework.PersistableObject.Validate()
at SourceCode.Workflow.Authoring.Activity.Validate()
at SourceCode.Framework.PersistableObject.SourceCode.Framework.IValidationContainer.Validate()
at SourceCode.Framework.PersistableObject.Validate()
at SourceCode.Workflow.Authoring.Process.Validate()
at SourceCode.Framework.PersistableObject.SourceCode.Framework.IValidationContainer.Validate()
at SourceCode.DeploymentTasks.Compiler.WorkflowCompiler.Execute()


 

Error Resolution

This Hotfix is contained within the latest K2 Update. Install the update package to resolve the error.