Code Fix: Unable to redeploy a workflow on a SharePoint List that uses a SmartObject from another List
KB001849
PRODUCT
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)
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
- Ensure you have K2 4.7 installed.
- Install the K2 4.7 February 2017 Cumulative Update.
- Get the K2 4.7 February 2017 Cumulative Update FP6 from Regional Support.
- Install the K2 4.7 February 2017 Cumulative Update FP6 to apply the fix.
- Clear the Browser cache.