Is is possible to programmatically create process data?

  • 13 April 2005
  • 1 reply
  • 1 view

Badge
I have a process that is listening for events in a document library, particularly the update event. The columns in the specified document library are predefined. Other programs are going to want to use this process, but they are going to have different columns set in their document library. I need K2 to store the information contained in the document library. So I'd like to create process data corresponding to each column in the document library on the fly so that I don't have to initially set up the process with this process data. I understand that I'm going to need a process for each project since that process will need to listen to a different document library, but I want to reuse as much code as possible.

Example:
Loop through all columns in document library:
1) create process data for that column -
create K2.ProcessInstance.DataFields["Document Library Column Name"]
2) set process data with value of column -
set K2.ProcessInstance.DataFields["Document Library Column Name"].Value = Document Library Column Name.Value

Does anyone have sample code on how to do at least #1?

1 reply

Badge +8
I am not aware of any way to create process data fields on the fly. I think for each process you will have to setup the datafields manually.

Once you have the data fields set up you can use the SharePoint 2003 Document Event to retrieve the meta data for a document and link the values to your data fields.

Reply