XMLField and Destination Users

  • 22 April 2008
  • 1 reply
  • 0 views

Badge

If I have a Process XmlField["Implementors"] in which I store something like
<Implementors><Implementor>K2:DEVUser1</Implementor><Implementor>K2:DEVUser2</Implementor></Implementors> where I can have 1 to n Implementor nodes, is it possible to use these data as my destination users for one of my activity?



Can you do this without resorting to code? Or do I need to go into Destination Rules Code and hack it there like so:



            XmlDocument doc = new XmlDocument();
doc.LoadXml(K2.ProcessInstance.XmlFields["Implementors"].Value);
XmlNodeList implementors = doc.SelectNodes("//Implementors/Implementor");

foreach (XmlNode implementor in implementors)
{
K2.Destinations.Add(DestinationType.User, implementor.InnerText);
}

1 reply

Badge +6

Hi there,


No need to go into code to achive that. All you need to do is select the <Implementor> node from your xml in the destination rule wizard, and the K2 resolving framework will automatically assign destinations to all your xml nodes. Cool, isn't it!! :)


 

Reply