This project is read-only.
2
Vote

The API ‘RmResourceChanges.GetChanges()’ not working as expected.

description

Hi,

Consider the below use case:
a) On FIM portal I have created new Person ‘Jsmith’
Person ‘Jsmith’ has DisplayName attribute value is ‘Jsmith’    
b) Now using FIM 2010 Resource Management Client 1.0.0 I want to again update the Person ‘Jsmith’
DisplayName attribute to ‘Jsmith’
To achieve I use below code
{
   DefaultClient client = new DefaultClient();
   client.ClientCredential = Credential.GetAdminCredential();
   client.RefreshSchema();
   string objType = "Person";
   string objName = "Jsmith";
   RmPerson Rmper = null;
   bool _rcUpdate;
   foreach (RmResource fimResource in client.Enumerate("/" + m_objType + "[AccountName='" + objName + "']"))
        {
            Rmper = fimResource as RmPerson;
        }
   RmResourceChanges transaction = new RmResourceChanges(Rmper);
   transaction.BeginChanges();

   Rmper.DisplayName = “Jsmith”;

   var attrChangeList = transaction.GetChanges();
   if (attrChangeList.Count > 0)
      {
          _rcUpdate = client.Put(transaction);
      }
    transaction.AcceptChanges();
}

c) In above test case the method ‘transaction.GetChanges()’ unexpectedly returns one list of change made and that results in unnecessary update. In above example, since there is no change in DisplayName the method ‘transaction.GetChanges()’ should not return any change list.

Any comment on this problem would be appreciated.

Thanks,
Rahul

comments