Issue Description

When a workflow on a SharePoint List is redeployed, and that workflow referenced an out-of-context SmartObject (a SmartObject from a different List), when it is packaged and deployed from one environment to another deployment fails and an error occurs.

Error Message
Error Message:
System.IndexOutOfRangeException: Index was outside the bounds of the array.
at SourceCode.WebDesigner.Authoring.Forms.GenerateProcess.DoSPWrapping(Activity newActivity, XmlDocument inputData, String[] ConfigValues, String dynamicTypeForDestinationItem, K2Field currentField, SmartObjectFieldPart soFieldPart)
at SourceCode.WebDesigner.Authoring.Forms.GenerateProcess.CreateDestinations(XmlNode activity, Activity newActivity, XmlDocument xmlProcess, Process newProcess)
at SourceCode.WebDesigner.Authoring.Forms.GenerateProcess.CreateActivies(XmlDocument xmlInputData, XmlDocument xmlProcess, DefaultProcess& newProcess, String UserName)
at SourceCode.WebDesigner.Authoring.Forms.GenerateProcess.Generate(String LocalHostConnection, String UserName, Int32 ProcessID, String InputData, String ProcessXML, String SqlConnectionString, String HostServerConnectionString)

Image

Cause
The packaged workflow had an ‘initialize data’ setting on the client event which consists of a concatenated string value that contains pipe “|” characters. This string value contains empty elements, Package and Deployment ignored the empty elements and compiled a faulty initialize string value for the workflow activity.

Resolution

  1. Ensure you have K2 4.7 installed.
  2. Install the K2 4.7 February 2017 Cumulative Update.
  3. Get the K2 4.7 February 2017 Cumulative Update FP6 from Regional Support.
  4. Install the K2 4.7 February 2017 Cumulative Update FP6 to apply the fix.
  5. Clear the Browser cache.