Workflow and ServiceDesk Community

 View Only
Expand all | Collapse all

Simple Collection Sort Component doe snot work with enumerations

  • 1.  Simple Collection Sort Component doe snot work with enumerations

    Posted Oct 28, 2011 08:17 AM

    Dear All,

    I am having issues with the Simple Collection Sort component.

    When I select a Data Type in the SCS and select a Data Type enumeration as the array/collection, the collection does not get sorted. In some respects, that is kind of reasonable, because I guess that the enumeration from the Data Type (which I got from a Web Service) might be hardcoded to have the given list of items in a certain (if annoying) order.

    However, to get around this, I have also tried copying the Data Type enumeration into another array and then using the Simple Collection Sort on that array, but that does not work, either.

    What might I be doing wrong?

    Kindest regards,

     

    QuietLeni



  • 2.  RE: Simple Collection Sort Component doe snot work with enumerations

    Posted Oct 28, 2011 10:28 AM
      |   view attached

    Enumerations just associate integer values with a more readable "name" field. More than likely, simple collection sort is sorting by the integer value.

    To get around this, I'd loop through the enumeration array and copy each element into a string array, then do a simple collection sort on the string array. This works in the attached .package (uploaded as .zip, just rename to .package). Ignore any build warnings as I'm building in a trunk build.

    Attachment(s)

    zip
    DecisionProject1_0.zip   1.27 MB 1 version