I'm working on a custom web application that is using the K2 Workflow engine behind the scenes to drive the various steps, notifications, and escalations associated with a process in that application. The issue I am encountering is with setting the various activities' destination sets. What I am looking to do is set the destination set for an activity and it's client event based on a SQL query that given two parameters returns a list of active directory users.
Currently, I am doing this with a SmartObject method to populate the destination set. The activity is passing the two parameters to the SO method which is in turn making a call to a customer Service Broker/Service Object and passing those parameters. The Service Broker/Object is then connecting to the SQL database, performing the SQL query and then returning the results of the query.
Right now, if there is only one result and I return it as a string, the K2 Activity understands the result and assigns the activity / client even to that result. The problem is when there are more than one result. I cannot figure out what format the K2 Activity is expecting to be able to set a Destination Set given multiple active driectory accounts. I have tried returning a list of strings, an array of strings, and various delimited strings (using commas, semi-colons, etc.)
Has anyone tried to do this and how did you do it?
I have spoken with K2 and they suggested using an XML data field with a repeating node and I have done this with limited success. The problem I am seeing with it is that an activity with a SmartObject event to populate the XML data field must be set up prior to each activity that uses the data field. That isn't really a huge problem, but it seems "hacky", adds a lot of steps to the workflow, and will result in a workflow that doesn't look "pretty" (and our business users want to be able to see the workflow). The limited success portion that we have had is that, once again, if I am returning only one result, I can populate the repeating node of the XML data field. However, if I return more than one result, I am not sure how to populate the XML field.
Any help / advice appreciated.
Charles