Updating a Group with Resource Update

 8 Replies
 0 Subscribed to this topic
 52 Subscribed to this forum
Sort:
Author
Messages
kdcoate
Veteran Member
Posts: 44
Veteran Member
    I created a ProcessFlow which uses the Resource Query node to loop through the assigned groups, writing each one to a string variable- stripping out the extra spaces and line breaks.  I then delete one of the groups from the string variable and use a Resource Update node to try and replace the group.  Every time I get to the Update node, I receive the following error:   

    com.lawson.lawsec.external.ExternalException:Attribute is invalid. Attributes - Group="EmpGroup,SABeta"
    ("EmpGroup,SABeta" being the two groups that I still want the user assigned to).  Any suggestions?  I've also tried without the quotes and with single quotes and get the same error.

    BarbR
    Veteran Member
    Posts: 306
    Veteran Member
      I'm sure you've done this, but it never hurts to be sure. Have you added the new group through the RM Administrator - and is it exactly the same name, upper/lower case and all? Are you able to add the same group to an individual through the SA client?
      kdcoate
      Veteran Member
      Posts: 44
      Veteran Member
        Thanks for the reply! The group names are being read from the existing groups assigned to the employee and they are exactly the same as what's defined in RM admin. The goal really is just to remove one of the groups - but since that can't really be done, I'm reading the existing ones, stripping out the one I want to remove and then replacing the whole string. Adding/Deleting all work fine through Sec Admin.
        BarbR
        Veteran Member
        Posts: 306
        Veteran Member
          Ah, I see. I do this daily - maintaining Groups and Roles and adding new users, etc. - but I do it from a batch file that the ProcessFlow picks up and uses as input to a command node that runs the loadusers command. The batch userloadfile.xml is created by an Access application that reads nightly extract files from Lawson HR, Lawson SA, and our company LDAP - analyzes for changes or new users or users that should be inactivated - and builds the userloadfile.xml. Not as clean and neat as direct update - but works great - and I don't mess with success.
          SP
          Veteran Member
          Posts: 122
          Veteran Member
            Have you verified that you are using the actual Group "ID" and not the
            display name? Sometimes there is a subtle difference between the two.

            On Thu, Mar 8, 2012 at 10:36 AM, wrote:

            > [image: LawsonGuru.com Logo] <https://www.lawsonguru.com/> Lawson
            > ProcessFlow Forum Notification A message was posted to a thread you are
            > tracking. *RE: Updating a Group with Resource Update* Posted by: *
            > kdcoate*
            > 03/08/2012 10:32 AM Thanks for the reply! The group names are being
            > read from the existing groups assigned to the employee and they are exactly
            > the same as what's defined in RM admin. The goal really is just to remove
            > one of the groups - but since that can't really be done, I'm reading the
            > existing ones, stripping out the one I want to remove and then replacing
            > the whole string. Adding/Deleting all work fine through Sec Admin.
            > ------------------------------
            >
            > To view the complete thread and reply via your browser, please visit:
            >
            > https://www.lawsonguru.co...ith-resource-update/
            >
            > You were sent this email because you opted to receive email notifications
            > when someone posted and/or responded to a message on this forum.
            > To unsubscribe to this thread please visit your user profile page and
            > change your subscription options.
            >
            > Thank you,
            > LawsonGuru.com
            >

            John Henley
            Posts: 3353
              Try blanking it out first.
              Thanks for using the LawsonGuru.com forums!
              John
              kdcoate
              Veteran Member
              Posts: 44
              Veteran Member
                Thanks for all the suggestions. I did try to blank out the Group first and that node worked - but the update node to add back in the new groups is still not working. I also tried using both append and replace but got the same error. I even tried creating a flow with only the Resource Update node and typing in a literal value that matched the one I was building - but I got the same error.
                Finally - what did work was appending the values back one at a time - so I couldn't use the string separated by commas - had to add them individually.
                jamesraceson
                Veteran Member
                Posts: 52
                Veteran Member
                  kdcoate,

                  I have had this exact problem in the past as well. I tried everything from string formatting, javascript, and variable replacement. Nothing seemed to work for me as well. For what ever reason PFI does not like to process more than one Group ID per line in a resource update node. What I ended up doing, so I did not have to run consecutive resource updates, is do the logic work prior to the resource update node. Depending on how many groups you have, this could take up a lot "space" on the designer screen. What I would do is get the Group IDs, delete the one that want, set boolean flags for the existing ones, then run it a logic branch for the flags. Depending on the values of the flags I would then route the flow to different resource updates nodes that would match the values of the Group IDs for each true flag. This process works great depending on your Group set up as well. If you have a large number of Groups with wide range of permutations of Group assignments, this will be a very large flow and might not be a usable solution.

                  Another solution would be to loop through each of the existing Group IDs (after your deletion process) and then run the resource update for each one (replacinga group variable inside the node for each pass through). I don't know if that is how you are currently adding them in individually, but that would work as well. The only problem that you might come across with that is if you have a large number of groups, hitting your specific LDAP with consecutive resource updates that quickly might not work so well either. Hope some this helps you out.
                  kdcoate
                  Veteran Member
                  Posts: 44
                  Veteran Member
                    Thanks jamesraceson - all good advice...
                    This process runs for people who have just completed their new hire benefit enrollment so they usually only have 1 or 2 groups assigned. What I did was write the group string to a csv file and then use the data iterator to loop through the file and add the groups one at a time. I probably could have done something more elegant - but time is of the essence and this works...
                    Thanks again.