Hello,
I'm having trouble to insert a value to an xml field from a webform.
Attachment 1 shows my XML Schema.
From my webform code, I do CreateProcessInstance.
Then I create the xmldocument.
Dim doc As New System.Xml.XmlDocument
doc.LoadXml(pi.XmlFields("Complaint").Schema)
doc.DocumentElement.RemoveAll()
Dim strRoot As XmlElement = doc.CreateElement("Root")
strRoot.Prefix = "mstns"
Dim strKlachten As XmlElement = doc.CreateElement("Klachten", "mstns")
strKlachten.Prefix = "mstns"
Dim strGegevens As XmlElement = doc.CreateElement("Gegevens", "mstns")
strGegevens.Prefix = "mstns"
Dim attFlowState As XmlAttribute = doc.CreateAttribute("FlowState")
attFlowState.Value = "Prior"
strGegevens.SetAttributeNode(attFlowState)
strKlachten.AppendChild(strGegevens)
strRoot.AppendChild(strKlachten)
doc.DocumentElement.AppendChild(strRoot)
pi.XmlFields("Complaint").Value = doc.InnerXml
k2conn.StartProcessInstance(pi)
pi.Update()
k2conn.Close()
In my Activity I created a Server Mail. In the body I insert: [{K2.ProcessInstance.XmlFields("Complaint/mstns:Root/mstns:Klachten/mstns:Gegevens/@FlowState").Value}]
When I run the process, something is written to the error log (error item name: server mail): XPath : "mstns:Root/mstns:Klachten/mstns:Gegevens/@FlowState" could not be resolved on this document.
Any Suggestions:
XML value woes
Enter your E-mail address. We'll send you an e-mail with instructions to reset your password.