Refactoring Association
There are two refactoring
Refactor to Based ACC
Refactor to Derived ACC
Refactor to Based ACC
Example:
Move an association in the Production Order Line Base. Details to any of the ACC it is based on.
Production Order Line Base. Details - Lv. 4
Status Line Base. Details (*) - Lv. 3
Line Base. Details (o) - Lv. 2
Line Identification Base. Details (o) - Lv. 1
Real Case
In 10.7.2, @Michael Figura wanted to add “Name. Name” BCCP to “Document Reference Base. Details”, but the “Online Document Reference Base. Details” already has the “Name. Name” BCCP. The “Online Document Reference Base. Details” is based on “Document Reference Base. Details”.
In fact, we discussed about moving the “Name. Name” BCCP to the “Document Identification Base. Details”. “Document Reference Base. Details” is based on “Document Identification Base. Details”.
Workflow:
Click an association in an ACC to show the context menu “Refactor to a Based ACC”.
Display the list of possible based ACCs to move to.
The user select one of the based ACCs listed.
Check for duplicate associations/properties on all ACCs derived from the based ACC. Can use the “Where Used” function to find all the ACCs that need to be checked. Report the troubling ACCs to the user.
There are two cases to check for duplicate.
The property exist directly under the ACC within in the derivation hierarchy of the selected based ACC.
The property exist in a Group ACC used within the the derivation hierarchy of the selected based ACC.
In case of 5b, the application indicates to the user that the refactor cannot be done. We talked about adding the degrouping function to allow the user to manually resolve the situation which would then allow the refactoring. This will be added as an issue for future enhancement.
In case of 5a, the application asks the user to confirm deletion of the duplicates from derived ACCs in the inheritance hierarchy. If the user confirm, affected ACCs has to be revised and put in WIP state b/f deletion.
History Record
Let’s say there is a situation below. Name needs to be moved to from Online Document Reference to Document Identification.
After successful refactoring.
Online Document Reference will have a new revision that has no Name BCCP. Older revisions still has Name BCCP.
Document Identification has a new revision that has the Name BCCP. Older revisions has no name BCCP.
PO Document will have a new revision that has no Name BCCP. Older revisions still has Name BCCP.
Sales Order Document will have a new revision that has no Name BCCP. Older revisions still has Name BCCP.
History Log
Using the same example above, after successful refactoring.
The Online Document Reference, PO Document, and Sales Order Document ACC will have a Commit entry with the action Refactored From. All of them must also have at least a Revised commit and may be also some Modified commits before the Refactored From commit.
The Document Identification will have a Commit entry with the action Refactored To. It must also have at least a Revised commit and may be also some Modified commits before the Refactored To commit.