Details

    • Type: Bug Fix
    • Status: Closed
    • Priority: Critical
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: 2.4
    • Component/s: Development
    • Security Level: Public (Public: Anyone can view)
    • Labels:
      None
    • Rice Module:
      KRAD
    • Sprint:
      2.4.0-rc1 Sprint 7
    • KAI Review Status:
      Not Required
    • KTI Review Status:
      Not Required
    • Code Review Status:
      Not Required
    • Include in Release Notes?:
      Yes

      Description

      KRAD Maintenance documents don't copy even though success is displayed

        Attachments

          Issue Links

            Activity

            Hide
            cniesen Claus Niesen added a comment -

            Tested on KRAD Demo's Travel Account maintenance document and KRMS' Context maintenance document.

            Show
            cniesen Claus Niesen added a comment - Tested on KRAD Demo's Travel Account maintenance document and KRMS' Context maintenance document.
            Hide
            sonam Sona Sona (Inactive) added a comment -

            Context,Term and Termspecification copy are broken. Travel Account works fine.

            // Since this will be a new object, we also need to blank out the object ID and version number fields
                            // (if they exist).  If the object uses a different locking key or unique ID field, the blanking of
                            // these will need to be done in the Maintainable.processAfterCopy() method.
                            if ( maintainable.getDataObject() instanceof DataObjectBase ) {
                                ((DataObjectBase) maintainable.getDataObject()).setObjectId(null);
                                ((DataObjectBase) maintainable.getDataObject()).setVersionNumber(null);
                            } else if ( maintainable.getDataObject() instanceof PersistableBusinessObject ) {
                                // Legacy KNS Support - since they don't use DataObjectBase
                                ((PersistableBusinessObject) maintainable.getDataObject()).setObjectId(null);
                                ((PersistableBusinessObject) maintainable.getDataObject()).setVersionNumber(null);
                            }
            

            On copy the version number and objectId are set to null since its a new object, but since none of the above objects extend DataObjectBase or PersistableBusinessObject this was not happening for them and so there was an OptimisticLockException being thrown in the background causing them to not go Final. Added a fix for that

            else {
                                // If neither then use reflection to see if the object has setVersionNumber and setObjectId methods
                               if(ObjectPropertyUtils.getWriteMethod(maintainable.getDataObject().getClass(), "versionNumber") != null) {
                                    ObjectPropertyUtils.setPropertyValue(maintainable.getDataObject(), "versionNumber", null);
                               }
            
                               if(ObjectPropertyUtils.getWriteMethod(maintainable.getDataObject().getClass(), "objectId") != null) {
                                    ObjectPropertyUtils.setPropertyValue(maintainable.getDataObject(), "objectId", null);
                               }
            
            Show
            sonam Sona Sona (Inactive) added a comment - Context,Term and Termspecification copy are broken. Travel Account works fine. // Since this will be a new object, we also need to blank out the object ID and version number fields // ( if they exist). If the object uses a different locking key or unique ID field, the blanking of // these will need to be done in the Maintainable.processAfterCopy() method. if ( maintainable.getDataObject() instanceof DataObjectBase ) { ((DataObjectBase) maintainable.getDataObject()).setObjectId( null ); ((DataObjectBase) maintainable.getDataObject()).setVersionNumber( null ); } else if ( maintainable.getDataObject() instanceof PersistableBusinessObject ) { // Legacy KNS Support - since they don't use DataObjectBase ((PersistableBusinessObject) maintainable.getDataObject()).setObjectId( null ); ((PersistableBusinessObject) maintainable.getDataObject()).setVersionNumber( null ); } On copy the version number and objectId are set to null since its a new object, but since none of the above objects extend DataObjectBase or PersistableBusinessObject this was not happening for them and so there was an OptimisticLockException being thrown in the background causing them to not go Final. Added a fix for that else { // If neither then use reflection to see if the object has setVersionNumber and setObjectId methods if (ObjectPropertyUtils.getWriteMethod(maintainable.getDataObject().getClass(), "versionNumber" ) != null ) { ObjectPropertyUtils.setPropertyValue(maintainable.getDataObject(), "versionNumber" , null ); } if (ObjectPropertyUtils.getWriteMethod(maintainable.getDataObject().getClass(), "objectId" ) != null ) { ObjectPropertyUtils.setPropertyValue(maintainable.getDataObject(), "objectId" , null ); }
            Hide
            sonam Sona Sona (Inactive) added a comment -

            Will reopen if there are changes from the review

            Show
            sonam Sona Sona (Inactive) added a comment - Will reopen if there are changes from the review

              People

              • Assignee:
                sonam Sona Sona (Inactive)
                Reporter:
                cniesen Claus Niesen
              • Votes:
                0 Vote for this issue
                Watchers:
                2 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved:

                  Time Tracking

                  Estimated:
                  Original Estimate - 1 day, 4 hours
                  1d 4h
                  Remaining:
                  Time Spent - 6 hours Remaining Estimate - 6 hours
                  6h
                  Logged:
                  Time Spent - 6 hours Remaining Estimate - 6 hours
                  6h