Skip to main content

Hello,


I am very new to K2 and Sharepoint and am working through how to develop some business processes that create data based on actions taking place in Sharepoint.


So far I seem to understand the concept of Sharepoint Workflow Integration and Events Wizards to initiate workflows based on something taking place in Sharepoint.  However I am a bit lost as to what is the best way to work with the data.  For example, in the instance I am working with I am starting a workflow based on a specific content type document being added to Sharepoint.  Once added I am associating the incoming Content type data to a Process XML field that has a distinct XML tag for all of the metadata.  From there I am able to access the parent list that is associated to the content type (content type contains the Parent GUID), which I also store in another Process field. The parent list is basically the wrapper to all of the documents pertaining to a specific incident or case.  The parent list contains a lookup field that may contain one or more offices involved on the case.


From there I would like to launch 1 or more child processes based on the number of offices involved on the case.  What is the best way to do this?  Also would it be better to store all of this information in a SmartObject?


I've done this in other BPM tools but they had loop functionality.

Hi,


Maybe you can have a look at the following blog post: http://www.k2underground.com/blogs/pitchblack/archive/2008/08/26/looping-through-an-activity-for-each-item-returned-from-a-smartobject-list.aspx


It explains how to loop through an activity with a result of a smartobject list. The same concept works also with a repeating xml node.


I hope it helps.


There is also a similar article here that focuses on the use of an XML field:


http://www.k2underground.com/blogs/fromthebench/archive/2008/10/22/using-a-repeating-xml-node-to-start-child-ipcs.aspx


 


Thanks for the responses.  I'm just starting to wrap my head around all of this so I appreciate the help.


Ok I think I have isolated the issue.  I had been following all of the posts included in order to loop when I realized that the XML field that K2 is generating is not building a multivalue node.  For example I have a Sharepoint list with a Multi-Lookup field and the XML that is generated looks as if it only supports holding one value.  So in my list I have a field called Offices where in Sharepoint the user can select 1 or more offices.  Based on that I would think the XML that gets generated when associating a new process field to the field would create a multi value node (ie. <Offices><Office></Office>....</Offices>, but instead it just creates <Office></Office>. 


When I try and add the mult-value tags around elements that have a multi-lookup field and then associate that XML I get an error saying the XML I created does not match.


Does anyone have any idea why this would take place?


The problem was due to the fact that I was using the Sharepoint generated XML.  Instead I created my own XML field with repeating nodes where applicable.  Now the problem seems resolved.


Reply