Skip to main content

Hi


Im using a XML repeating table in InfoPath & in K2 looping through running a sub process on each line (a PO req form).


I have followed this article (http://help.k2.com/en/KB000685.aspx)  using the XML method which works great however now I have all the data I need in structured XML I need to make it available to the sub process but however I try to make the Acitivity Data available I always get the error 'root element is missing'.


I have tried mapping the data in the IPC event & also using the DataEvent but always get 'Root Element Is Missing' - any ideas how I can make specific Activity Data in the parent process available to child process?


 


Thanks

Made progress using the K2 Helper Classes in a server event so now I can pass a value & retrieve a value ie


 


 
strXml = SourceCode.Workflow.Common.Utilities.XMLFieldMod.SetXMLValue(strXml, strXPath, "NEED ACTIVITY DATA FIELD HERE");


 


So this passes the string "NEED ACTIVITY DATA FIELD HERE" to an XML field called say 'TestXMLField' which I can now use to reference that in my process etc.  I need to set TestXMLField to the value of an activity data field however in whatever context I use I always get the error:


 


28031 Xmlfield RequestSection/XmlDocument/RequestDetailsRepeat/ReqBudgetCode not found


 


The field Im trying to pass the value of is located:  K2 Object Browser -> XML Fields -> Activities -> 'Activity Name' -> RequestSection -> XMLDocument -> RequestDetailsRepeat -> ReqBudgetCode



Ive tried stuff like:



strXml = SourceCode.Workflow.Common.Utilities.XMLFieldMod.SetXMLValue(strXml, strXPath, K2.ProcessInstance.DataFieldsa"XmlDocument/RequestDetailsRepeat/ReqBudgetCode"]);


etc.....


 



Whats the correct context to pass the activity value ?


 


Thanks in advance.


 


Don't know if this helps or is relevant but read this in the K2 Open Issues registry:


InfoPath and IPCs -- cannot map entire InfoPath XML to child processes: If you map from the root node of the InfoPath document in the parent process, you will find that actions are not available in the child processes.
Workaround:
As an InfoPath/K2 best practice, map only the nodes you need to the separate form template in the child processes, and do not map the _K2 field. InfoPath tags each form to a specific form template, and the _K2 node is maintained per activity, so copying values over from the root level nodes


Reply