Skip to main content

Hello,

 

I´m playing with process xml data fields, to see if they can work for a particular scenario i´m working with - but I'm just not able to get them to work.

I´ve created a xml schema (see attachment) and in a server event I want to assign values to the xml fields Test1 and Test2

 

After doing some research I´ve written different code scenarios to try to assign the values but with no luck.

This is what I have done so far (and the results)

 

Method1

K2.ProcessInstance.XmlFieldsl"Test"].Value =
SourceCode.Workflow.Common.Utilities.XMLFieldMod.SetXMLValue(K2.ProcessInstance.XmlFieldsl"Test"].Value, "Test1", "Hello");

 

Result = process runs successfully, no error, but no value set.

 

Method2

K2.ProcessInstance.XmlFieldsX"Test"].Value = SourceCode.Workflow.Common.Utilities.XMLFieldMod.SetXMLValue(K2.ProcessInstance.XmlFieldsX"Test"].Value, "XmlDocument/Test1", "Hello");


Resultprocess runs successfully, no error, but no value set.

 

Method3

string xml = K2.ProcessInstance.XmlFieldse"Test"].Value.ToString();
XmlDocument doc = new XmlDocument();
doc.LoadXml(xml);

doc.SelectSingleNode("Test1").InnerText = "Hello";
K2.ProcessInstance.XmlFieldse0].Value = doc.OuterX

 

Result = process error ,,Root element is missing"

 

This must be very simple, right?? Any help would be appreciated.

 


14353iF2B4793765A5BA85.png

Anyone???

 


For those who ever have trouble with this scenario, this example helped alot!

 

http://www.techylib.com/en/view/baasopchoppy/example_how_to_work_with_k2.net_xml_fields

 

Got it to work. Ok. Bye.


Reply