Symantec IGA

  • 1.  Get Relationship object from BLTHContext object

    Posted Nov 25, 2015 09:04 AM

    Hi,

     

    IDM version 12.6 SP05 GA release.

     

    For a specific use case, we created a copy of 'Modify user' task and used 'Relationship' tab to manage user groups. The relationship attribute used is 'Group Members'. This works fine currently.

     

    However, we have a new use case to implement where in some validation is to be done for a particular type of group. We have attempted at writing a BLTH and use handleValidation() to perform this operation. The idea is to get the 'Relationship' object and then call 'getAdded()' and 'getRemoved()' to fetch the relevant vector objects and do processing post that.

     

    We could not navigate through IDM API to get hold of a 'Relationship' object from a BLTHContext object. While we could get a 'RelationshipProvider' object, but we are clueless as to how do we retrieve a 'Relationship' object from the provider object.

     

    Any ideas / thoughts to achieve this use case would be very helpful.

     

    Thanks,



  • 2.  Re: Get Relationship object from BLTHContext object

    Broadcom Employee
    Posted Dec 01, 2015 08:18 AM

    Kumar,

     

    I think the relationship is possible for physical attributes only.



  • 3.  Re: Get Relationship object from BLTHContext object

    Posted Dec 01, 2015 08:22 AM

    Nino,

     

    Thanks for the help provided.

     

    I am not sure I understand your point here. Relationships are never defined on physical attributes , they exist as members of 'group/admin role/access role/prov role'.

     

    Could you please help elaborate on your point?

     

    Many thanks,

    Leela



  • 4.  Re: Get Relationship object from BLTHContext object

    Broadcom Employee
    Posted Dec 01, 2015 09:51 AM

    I probably did not understand your question.



  • 5.  Re: Get Relationship object from BLTHContext object

    Broadcom Employee
    Posted Dec 02, 2015 11:53 AM

    //here is a sample of code I wrote and tested with success:

     

    public void handleSubmission(BLTHContext blthContext) throws Exception {

    blthContext.logWarningMessage("GUIPH01 BLTHRelationShip 1 Starting to handle submission.", false);

     

    ManagedObject managedObject = blthContext.getSubject();

     

    if (managedObject != null) {

      blthContext.logWarningMessage("GUIPH01 BLTHRelationShip 2 managedObject not null.", false);

               ImsManagedObjectDefinition moDefinition = managedObject.getProvider().getManagedObjectDefinition();

               Vector moAttrDefinitions = moDefinition.getAttributeDefinitions();

               Iterator attrDefIter = moAttrDefinitions.iterator();

               while (attrDefIter.hasNext()) {

                   ImsManagedObjectAttrDefinition moAttrDefinition = (ImsManagedObjectAttrDefinition) attrDefIter.next();

                   if (moAttrDefinition.isRelationshipAttribute()) {

                    blthContext.logWarningMessage("GUIPH01 BLTHRelationShip 3 Relationship Attribute found.", false);

                       if (managedObject.containsKey(moAttrDefinition.getPhysicalName())) {

                           Relationship relationship = (Relationship) managedObject.getExtendedAttribute(moAttrDefinition.getPhysicalName());

                           blthContext.logWarningMessage("GUIPH01 BLTHRelationShip 4, " + relationship.getAttributeDefinition().getPhysicalName() + " is found.", false);

                          

                           for (Iterator iterator = relationship.getAdded().iterator(); iterator.hasNext();)

                           {

                               ManagedObject relatedObject = (ManagedObject)iterator.next();

                               blthContext.logWarningMessage("GUIPH01 BLTHRelationShip 5, " + relatedObject.getFriendlyName() + " is found.", false);

                           }

                        }

                   }

               }

         }

    }



  • 6.  Re: Get Relationship object from BLTHContext object

    Posted Jan 18, 2016 03:46 AM

    Hello Philippe,

     

    Thank you very much for providing this code. I've tried this in my lab and could successfully retrieve relationships that are being 'added'. However, when I try and retrieve relationships that are being 'removed' using the below code, I could not get any details.

     

    Any tips/thoughts about this?

     

    for (Iterator iterator1 = relationship.getRemoved().iterator(); iterator1.hasNext();)

                                         {

                                             ManagedObject relatedObject1 = (ManagedObject)iterator1.next();

                                             blthContext.logWarningMessage("GUIPH01 BLTHRelationShip 5 - removed , " + relatedObject1.getFriendlyName() + " is found.", false);

     

    Many thanks,

    Leela