Symptoms
User was receiving the following error when calling a subworkflow:
72902167","2016-12-12 11:49:33","Error","General","28083","ExtenderExecuteError","ProcessInstance.HandleException","28083 ServerEvent: Object reference not set to an instance of an object.
Server stack trace:
at SourceCode.Workflow.Runtime.Extenders.CodeExtender.OnExecute(Object context, XmlElement data, ResolverManager resolverManager)
at SourceCode.Workflow.Runtime.Extenders.ResolverExtenderBase.Execute(Object context, String data)
at System.Runtime.Remoting.Messaging.StackBuilderSink._PrivateProcessMessage(IntPtr md, Objectt] args, Object server, Objectt]and outArgs)
at System.Runtime.Remoting.Messaging.StackBuilderSink.SyncProcessMessage(IMessage msg)
Diagnoses
When trying to call a child process that updates a list item K2 does not understand that the process is started from a list and so you have set the "Update List Item" event a specific way.
Resolution
If you look here ate the documentation:
http://help.k2.com/onlinehelp/k2appit/userguide/1.5/default.htm#thin_client_wizards/list_items_wizards/update_list_item/update_list_item.htm
It states:
List Item >> Use this option if a reference was created earlier in this workflow for the List Item.
K2 does not create that reference in the subworkflow so you just have to go with the other option and establish the reference from the site collection on down.