Workflow Soluiton

 View Only
Expand all | Collapse all

Filtering Groups

  • 1.  Filtering Groups

    Posted Dec 14, 2010 03:20 PM

    Could someone please walk me through filtering groups from a list select component?  What I would like to accomplish is removing the All Users group and Support I and Support II groups from the ticket reassignment workflow.  We do not use these groups and I don't want tickets sitting in  un-monitored groups.   Step by step guide would be most useful.

     

    Another example would be the SD.Feeder.TechnicianIncident workflow in the assignments section of the "Create Incident" form



  • 2.  RE: Filtering Groups

    Posted Dec 14, 2010 04:09 PM

    1. Copy Data Element to New Location to copy the collection hooked up to the dropdown

    2. Remove Items From Collection on the copy to remove the groups/items above.

    3. Hook up the dropdown to the copy created in step 1.

    The copy is more so we don't break anything up ahead in the flow. These steps can be done before the form itself or in a dynamic model hooked up to the List Select's Items property.

    Another option is to use the Configurable Collection Filter. Your array variable would be the existing collection hooked up to the dropdown. The Model would be a couple of Text Equals rules where they would "Filter Out Value" if they matched on your group names you listed, and a Keep Value on all the rest. I'd copy it into a new variable, and hook up the dropdown to the copy.

    Hope this helps



  • 3.  RE: Filtering Groups

    Posted Dec 14, 2010 04:34 PM

    How do I configure the Remove Items From Collection component?  If i do constant value it looks like it only allows me to type in one group.

     

    Thanks for the quick reply



  • 4.  RE: Filtering Groups

    Posted Dec 14, 2010 04:44 PM

    You should be able to do multiples. If you can't (maybe this didn't appear in earlier versions) just chain a series of them together)

     



  • 5.  RE: Filtering Groups

    Posted Dec 14, 2010 05:21 PM
      |   view attached

    I have attached a doc with all of the screenshots that i hope will explain what i have done that didn't work.

    My example is only attempting to  filter the All Users group but didn't work.  Im pretty decent with

    workflow so this simple task is pretty frustrating.  Can you take a look and see if im missing something

    Attachment(s)

    docx
    Screenshots.docx   351 KB 1 version


  • 6.  RE: Filtering Groups

    Posted Dec 15, 2010 01:03 PM

    OK now I see the issue: the complex Group data type might be causing the 'problem'.

    What I would do now is my option #2: Configurable Collection Filter. Your array variable would be the existing collection hooked up to the dropdown. The Model would be a couple of Text Equals rules where they would "Filter Out Value" if they matched on your group names you listed, and a Keep Value on all the rest. I'd copy it into a new variable, and hook up the dropdown to the copy.



  • 7.  RE: Filtering Groups

    Posted Dec 16, 2010 02:19 PM

    Reecardo

    I believe i have figured out how to accomplish this but a new issue has popped up.  What i did was use a configurable collection filter and set the filter model up as so:

     

    For each element in collection: the next element path goes into a text equals component set up to filter out "All Users" with the equal path going to the filter out value stop component and the not equals path going back to the for each loop.  the finished path of the loop going to the keep value stop component.  

    The New issue is, it filters out "all users" group but also filters out every other value after that so my 55 groups is cut to 27 instead of 54.  

     



  • 8.  RE: Filtering Groups

    Posted Dec 16, 2010 02:49 PM

    I'm late to the game but i would also just loop thru and filter manually with a text match.  I'm about to do the same, but on a bit more complex scale where it also determines what groups to filter based on what group(s) you are in.

    In the meantime i monitor ALL empty groups, and since there should never be an tickets for those groups its not that big of a deal. That said, i added some logic in the group email notices to just email me of the mistake, especially the All Users group. as one accidental assign would create 60000 emails.

    Also, watch what you do with Support  I, its embedded in a lot of flows for permissions and such.



  • 9.  RE: Filtering Groups

    Posted Dec 16, 2010 03:25 PM

    Hi Nurb4000, the more the merrier.  I am actually using a text match rule but its acting weird.

    For example, say I have 5 groups

    1: All User

    2: Administrators

    3: PC Support

    4: Enterprise

    5: Blah 

     

    If i use the text equals rule and filter out 1 then 1, 3, 5 are gone.

    If I filter out 2 then 2 and 4 are gone.  I'm about to through in the towel on this.  It makes no sense.  



  • 10.  RE: Filtering Groups

    Posted Dec 17, 2010 12:01 PM

    First off, are you trying to filter the membership of one collection by comparing it to the membership of another collection?  If so then you need to use a Configurable Collection Filter with an Item Is in Index inside that component's embedded model.  Use the Element variable to compare against MySecondCollection.Property.

    There are a couple of troubleshooting techniques you can use when the operation of a embedded component is unexpected.

    1.  In the debugger, in the bottom left pane, choose the settings tab, and check the box for "DebugInEmbeddedModels"  This will cause the debugger to show the inner workings of the filter collection component. 

    2.  Optional, you can also set a breakpoint by right-clicking on the component in the debugger (Or select it in Component Settings tab) and choosing "Set Breakpoint".    This will cause the debugger to stop at the specified component and you can then step through each matching attempt and easily view the values being compared.

     

    Another alternative is to use the Create Log Entry.  Set the error level to warning (or change the log viewer setting to informational) Put them inside the problem component's model and log the two item's values being compared, and then log the decision that was made.  Open the log viewer and run the debugger to see what's happening.



  • 11.  RE: Filtering Groups

    Posted Dec 17, 2010 02:14 PM

    Thanks for the input.  I had no idea you could debug the embedded models.  ill give that a try.



  • 12.  RE: Filtering Groups

    Posted Dec 17, 2010 02:26 PM

    I went and created what we are all talking about, using 'get all groups', sorting that and then sending that thru a "for each", then a "match rule". If it matches, its removed from the collection and the loop is started again.

    It seems to match OK and remove only the groups i added to the match rule. I have tried various combinations of groups to remove.

    So while it works for me, it doesn't help you much on the problem you are having since it seems like it should work ( unless we are doing something slightly different )

     

    EDIT: Actually it seems i lied, after some more testing it is acting in a similar way. If i remove the 'remove from collection' component the 'loop' works fine, put it back in and it doesn't behave the same.



  • 13.  RE: Filtering Groups

    Posted Dec 17, 2010 02:50 PM

    Instead of using a remove from collection component, can you try a configurable collection filter component with a loop and text equals rule inside the filter model and see if you get the same results?  I didn't notice it was removing more groups until i compared them in excel.  we use over 60 groups so i thought i was successful but now just frustrated.  



  • 14.  RE: Filtering Groups

    Posted Dec 18, 2010 04:38 PM

    After mentioning it to my developer ( real coding, not WF ) he said what was obvious but i wasn't seeing it for some reason:

    If you modify an array inside the loop it will make the array inconisstant and cause all sorts of problems.

    Since a collection is really just an array, i bet its the same problem.

    So i think this should be done without the loop, by just passing in list to a remove component and not try to loop thru each one, comparing then taking them out individually, or using the configurable collection filter and putting the logic in there as suggested by the symantec guy above.  But either way i think the key is getting it out of the loop. ( i cant try either at the moment, but will monday )



  • 15.  RE: Filtering Groups

    Posted Dec 19, 2010 12:36 PM

    I went in and removed the loop, used the more advanced "configurable collection filter" widget as the Symantec guy suggested then used a 'match rule' inside that instead of a bunch of 'text equals' and variables to keep it clean. Works great.

    This is of course with a static list, if its a dynamic list you will have to do it more like he suggested with using 'item is an index'.



  • 16.  RE: Filtering Groups

    Posted Dec 21, 2010 10:03 AM

    Can you provide a few screenshots of how you have yours setup?  I'm confused on how you did this without looping.  When I choose the "Compare to Variable", in the matches rule, as the group array my only option is first, last, count.  I can choose first and then choose GroupName under that but what if the group it is trying to compare is not the first one?



  • 17.  RE: Filtering Groups

    Posted May 10, 2011 10:55 AM

    I was inspired by the Vision conference to post my solution for group filtering.  These instructions enable you to remove the out-of-the-box groups such as All Users, Support I, and Support II from the various Assignments screens.

    STEP 1: Build the NoAssignGroups list in the ServiceDesk Application Properties

    1. Open the ServiceDesk portal and click Admin > Data > Application Properties
    2. Click the Lightning Bolt > Edit Profile Definition > Next
    3. Click Add Definition Value
         a. Name: NoAssignGroups
         b. Category: Custom
         c. Is Array: True (checkmark)
         d. Default Value: SD.IncidentManagement
    4. Save/Finish
    5. Click ServiceDeskSettings > Lightning Bolt > Edit > find the NoAssignGroups entry > click Add
    6. Add each of the group names that you want to filter
    7. Save/Finish
    7. Restart IIS and server extensions
    8. Open the SD.Feeder.TechnicianIncidentForms.Webforms and SD.IncidentEscalation.Webforms projects in Workflow Designer

    STEP 2: Create the NoAssignGroups Filter component.

    1. Add a Configurable Collection Filter from the toolbox (destinations are listed in step 3).  Name it NoAssignGroups Filter, set the Data Type to Group, and the Array Variable Name to AllGroups.  The Copy Result to New Variable value should be unchecked.  Configure the Filter Model as follows (also see screenshot):
    2. Configure a For Each Element in Collection component to take the [ProfileProperties].service_desk_settings_no_assign_groups  variable and name the output variable vUnusedGroup
    3. Configure a Text Equals Rule component to compare the Element.GroupName and vUnusedGroup variables.  Wire the equals result to the Filter Out Value end component and the not equals result to the Keep Value end component.

    STEP 3: Add your NoAssignGroups Filter  component to the Assignments screens.

    1. SD.Feeder.TechnicianIncidentForms.Webforms project:
         A. Open the Create Incident webform from the Primary model.
         B. Double-click the magnifying glass (SubDialogComponent) component near the Assignments list.
         C. Click the User Interaction tab.
         D. Open the Form Model ellipses button.
         E. Open the Set Up Data and Cache Embedded Model component.
         F. Wire the NoAssignGroups Filter  component between the GetAllGroups and GetAllOrganizationUnits components.
        G. Save and Publish the project

    2. SD.IncidentEscalation.Webforms project (two places):
         A. In the Primary model, locate the two Search Groups Embedded Model components.
         B. Wire the NoAssignGroups Filter  component between the GetAllGroups and All Groups Exist? components. 

    STEP 4: Disable the Add Groups to Selection List action.

    1. In the SD.IncidentEscalation.Webforms project, open the Declarations embedded component.
    2. Disable the Get SupportX and Add Groups components (see screenshot)
    3. Save and Publish the project