I'm trying to use the WorklistCriteria object to sort my worklists by values in a ProcessInstance XMLField. I've looked at the sample code in K2ROM.chm, but I can't seem to get the syntax right for drilling down in the XMLFields.
My WorklistItem has a ProcessInstance XMLField named "Entity" that stores an XML representation of the entity associated with that WorklistItem, and I need to be able sort the worklist based on different attributes of the entity's XML representation.
For example, if my XMLField named "Entity" looks like:
<Entity id="123"><Type id="234"/><Name>entity_name_value</Name></Entity>
What would be the appropriate values to pass to AddSortField in order to sort based on Entity Type ID, or Entity Name? I've been trying a number of variations on the code below, but can't seem to find anything that works the way that I want.
oWorklistCriteria.AddSortField(SourceCode.K2ROM.WCField.ProcessXml, "/Entity/@Id", SourceCode.K2ROM.WCSortOrder.Ascending)
Can the SubField parameter to AddSortField take an XPATH query string, or is there another way that I can do this?
Thank you in advance for your help.