6 Replies Latest reply on Jun 29, 2016 5:52 PM by skwan

    AFSDK FindElementsByPath returns no element for real path

    calmandrysdale

      Hola all,

       

      We have an application using the AFSDK which users pass in a path to an AF Element and then displays information about that element to the user.

      The way this is achieved is via the following steps:

      • User supplies path to element in AF Tree in predefined format.
      • The path is used to create a path list array containing just the one path.
      • AFElement.FindElementsByPath(path_list, None) is used to retrieve the element specified by the path.
      • the GUID is then retrieved from the AF Element using the af element object: obj.ID.ToString()
      • element details are then retrieved using the GUID for any future references.

       

      The AFElement.FindElementsByPath function is returning no element for element paths that have previously worked and definitely exist.

       

      Things we have tried to get it to re'find' the element:

      • Using af database.refresh() calls to ensure we have up to date AF cache.
      • Stopping/starting our application to reset the connection.

       

       

      The only thing that has successfully worked to re'find' the element is to copy the element, paste it in a new location of the AF Tree. Check in. Delete the original element. Check in. Copy the element back to its original location. Check in. Delete the copy. Check in.

      Then our application code can successfully find the AF Element again. Note that NO changes are made whatsoever to the application code to achieve this.

       

      Can anyone give us information on:

      What causes this to happen - afsdk no longer finding valid element paths?

      How we can fix it for bulk elements?

       

      This has happened to a large number of elements in our tree and I need a better solution than to copy / paste so many of them.

       

      Any comments, thoughts or suggestions always appreciated.

       

      Cheers,

       

      Calman