This example illustrates how to use the ReElDor utility to identify the INSERT statement and replaces the insertable attribute that has the same name as the insertable class.
Consider the following model structure:
AModel ASegment Insertable IGLG Main Move "X" _DA1:Assign value X to incoming parameter Move "Y" _DA2:Assign value Y to incoming parameter Report R1 InsAttr (inherited from IGLG) Main Insert InsAttr
In this example, when you validate R1.Main method, a validation error appears:
error 2214: The operand InsAttr cannot be inserted. INSERT statement can only insert an Insertable class.
The command line to be used is:
C:\Program Files\Unisys\NGEN\bin>ReEldor -CIAC -M AModel -S ASegment -L CIAC.log
After its execution, the following summary is displayed in the command line:
Found 1 Elements in Segment ASegment Validate R1.Main ******* Error in Validation of R1.Main *********** ======== Fix Start ======== Line:1: replace "InsAttr" with "IGLG" in logic "Insert InsAttr" of Method R1.Main ======== Fix end ======== Total Refactor Time: 10.7 seconds Validate R1.Main Validation Time: 0.4 seconds Total Elapsed Time: 11.2 seconds
Then, the model structure changes to:
AModel ASegment Insertable IGLG Main Move "X" _DA1:Assign value X to incoming parameter Move "Y" _DA2:Assign value Y to incoming parameter Report R1 InsAttr (inherited from IGLG) IGLG (inherited from InsAttr) Main Insert IGLG
The resulting refactored logic is:
R1.Main Insert IGLG