1 2 Previous Next 25 Replies Latest reply: Jul 4, 2011 8:46 AM by Philip Stoyanov-Oracle Go to original post RSS
      • 15. Re: Switch from v3EA4 to v3.0.0.4 production - Corrupted models?
        Philip Stoyanov-Oracle
        I'm sorry I wanted to get two actions in one step, it's better to split them:
        1) the first script is for logical model
        outFile = new java.io.File("d:/print_logical.txt");
        outstr = new java.io.FileOutputStream(outFile);
        out = new java.io.PrintStream(outstr,true);
        java.lang.System.setOut(out); 
        java.lang.System.setErr(out);
        contr = model.getDesign().getLogicalDesign().getMainView().getController();
        try{
         contr.getFwdEngineer().doActionPerformed(null);
        }
        catch(err){
         if(err.javaException!=null){
          err.javaException.printStackTrace();
         }
        }
        2) the second script is for relational model
        outFile = new java.io.File("d:/print_rel.txt");
        outstr = new java.io.FileOutputStream(outFile);
        out = new java.io.PrintStream(outstr,true);
        java.lang.System.setOut(out); 
        java.lang.System.setErr(out);
        contr = model.getDesign().getRelationalDesign().getMainView().getController();
        try{
         contr.getRevEngineer().doActionPerformed(null);
        }
        catch(err){
         if(err.javaException!=null){
          err.javaException.printStackTrace();
         }
        }
        Philip
        • 16. Re: Switch from v3EA4 to v3.0.0.4 production - Corrupted models?
          mgornicki
          Hi Philip

          the relational script output was empty, however the output of the logical one is below:

          java.lang.NullPointerException
               at oracle.dbtools.crest.model.design.engineering.RE_RelationalToLogical.addColumn(Unknown Source)
               at oracle.dbtools.crest.model.design.engineering.RE_RelationalToLogical.addTableDetails(Unknown Source)
               at oracle.dbtools.crest.model.design.engineering.RE_RelationalToLogical.addTable(Unknown Source)
               at oracle.dbtools.crest.model.design.engineering.RE_RelationalToLogical.addFromRelationalModel(Unknown Source)
               at oracle.dbtools.crest.model.design.engineering.RE_RelationalToLogical.<init>(Unknown Source)
               at oracle.dbtools.crest.swingui.engineeringcompare.EngineeringCompareDialog.<init>(Unknown Source)
               at oracle.dbtools.crest.swingui.logical.ControllerLogical$FWDEngineer.doActionPerformed(Unknown Source)
               at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
               at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
               at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
               at java.lang.reflect.Method.invoke(Method.java:597)
               at sun.reflect.misc.Trampoline.invoke(MethodUtil.java:36)
               at sun.reflect.GeneratedMethodAccessor19.invoke(Unknown Source)
               at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
               at java.lang.reflect.Method.invoke(Method.java:597)
               at sun.reflect.misc.MethodUtil.invoke(MethodUtil.java:243)
               at sun.org.mozilla.javascript.internal.MemberBox.invoke(MemberBox.java:132)
               at sun.org.mozilla.javascript.internal.NativeJavaMethod.call(NativeJavaMethod.java:190)
               at sun.org.mozilla.javascript.internal.Interpreter.interpretLoop(Interpreter.java:3073)
               at sun.org.mozilla.javascript.internal.Interpreter.interpret(Interpreter.java:2239)
               at sun.org.mozilla.javascript.internal.InterpretedFunction.call(InterpretedFunction.java:138)
               at sun.org.mozilla.javascript.internal.ContextFactory.doTopCall(ContextFactory.java:323)
               at sun.org.mozilla.javascript.internal.ScriptRuntime.doTopCall(ScriptRuntime.java:2747)
               at sun.org.mozilla.javascript.internal.InterpretedFunction.exec(InterpretedFunction.java:149)
               at com.sun.script.javascript.RhinoCompiledScript.eval(RhinoCompiledScript.java:37)
               at javax.script.CompiledScript.eval(CompiledScript.java:89)
               at oracle.dbtools.crest.model.designrules.DRCustomScript.doCheck(Unknown Source)
               at oracle.dbtools.crest.swingui.transformations.ApplyCustomTransformation.runTransformation(Unknown Source)
               at oracle.dbtools.crest.swingui.designrules.CustomTransformationsManager$ApplyAction.actionPerformed(Unknown Source)
               at javax.swing.AbstractButton.fireActionPerformed(AbstractButton.java:1995)
               at javax.swing.AbstractButton$Handler.actionPerformed(AbstractButton.java:2318)
               at javax.swing.DefaultButtonModel.fireActionPerformed(DefaultButtonModel.java:387)
               at javax.swing.DefaultButtonModel.setPressed(DefaultButtonModel.java:242)
               at javax.swing.plaf.basic.BasicButtonListener.mouseReleased(BasicButtonListener.java:236)
               at java.awt.AWTEventMulticaster.mouseReleased(AWTEventMulticaster.java:272)
               at java.awt.Component.processMouseEvent(Component.java:6134)
               at javax.swing.JComponent.processMouseEvent(JComponent.java:3265)
               at java.awt.Component.processEvent(Component.java:5899)
               at java.awt.Container.processEvent(Container.java:2023)
               at java.awt.Component.dispatchEventImpl(Component.java:4501)
               at java.awt.Container.dispatchEventImpl(Container.java:2081)
               at java.awt.Component.dispatchEvent(Component.java:4331)
               at java.awt.LightweightDispatcher.retargetMouseEvent(Container.java:4301)
               at java.awt.LightweightDispatcher.processMouseEvent(Container.java:3965)
               at java.awt.LightweightDispatcher.dispatchEvent(Container.java:3895)
               at java.awt.Container.dispatchEventImpl(Container.java:2067)
               at java.awt.Window.dispatchEventImpl(Window.java:2458)
               at java.awt.Component.dispatchEvent(Component.java:4331)
               at java.awt.EventQueue.dispatchEvent(EventQueue.java:599)
               at java.awt.EventDispatchThread.pumpOneEventForFilters(EventDispatchThread.java:269)
               at java.awt.EventDispatchThread.pumpEventsForFilter(EventDispatchThread.java:184)
               at java.awt.EventDispatchThread.pumpEventsForFilter(EventDispatchThread.java:178)
               at java.awt.Dialog$1.run(Dialog.java:1047)
               at java.awt.Dialog$3.run(Dialog.java:1099)
               at java.security.AccessController.doPrivileged(Native Method)
               at java.awt.Dialog.show(Dialog.java:1097)
               at java.awt.Component.show(Component.java:1447)
               at java.awt.Component.setVisible(Component.java:1400)
               at java.awt.Window.setVisible(Window.java:824)
               at java.awt.Dialog.setVisible(Dialog.java:987)
               at oracle.dbtools.crest.swingui.ApplicationView.setTransformationsManagerVisible(Unknown Source)
               at oracle.dbtools.crest.swingui.ControllerApplication$ShowTransformationsManager.doActionPerformed(Unknown Source)
               at oracle.dbtools.crest.swingui.MDBAction$ActionInvoker.run(Unknown Source)
               at java.awt.event.InvocationEvent.dispatch(InvocationEvent.java:209)
               at java.awt.EventQueue.dispatchEvent(EventQueue.java:597)
               at java.awt.EventDispatchThread.pumpOneEventForFilters(EventDispatchThread.java:269)
               at java.awt.EventDispatchThread.pumpEventsForFilter(EventDispatchThread.java:184)
               at java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:174)
               at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:169)
               at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:161)
               at java.awt.EventDispatchThread.run(EventDispatchThread.java:122)
          • 17. Re: Switch from v3EA4 to v3.0.0.4 production - Corrupted models?
            836039
            How do I run these scripts? I am interested in providing information using the script.

            Thanks
            Tiji
            • 18. Re: Switch from v3EA4 to v3.0.0.4 production - Corrupted models?
              836039
              I am getting an error on this script. However, this is the result from the previous script's execution.

              -----------------------------------------
              attribute;Usage Interval ID;07F479B4-A72B-C2D7-A1E5-91F703E2984F ::: column;USG_INTERVAL_ID;1CBAB705-ADE5-7ED5-4BDB-E9DB0F478086
              key;PK Bundle Tier Revenue Fact Key;08EABB65-FA49-CA13-BF8F-AD08A7D3C74F ::: index;PK_BUNDLE_TIER_REVENUE_FACT_KEY;6759A8D0-666F-C2B5-7722-514EA9831F32
              attribute;Total Tiers Applied;1C7BCA07-EFBA-5F25-31FF-129F7D7D9007 ::: column;TOTAL_TIERS_APPLIED;0A8CF65C-E5D2-022A-324E-E7EDBB8A5ADD
              attribute;Participant Session ID;4FED0A09-37E6-03E6-EE90-689EF9A93A81 ::: column;SESSION_ID;3149633A-1837-18B8-3A32-811A889134B6
              key;PK Bundle Definition Key;6C99A696-919E-91E3-D73A-53532FBADE99 ::: index;PK_BUNDLE_DEFINITION_KEY;FE22A5AC-4CED-5FD3-16F2-DAB729ED20CB
              attribute;Product Wise Split Percent;72FF9EBA-53BD-C89E-DDE5-CA9FE972EB8A ::: column;SERVICE_SPLIT_PCT;CAE8DD39-F497-F21A-5ADD-DFBEDF6A4CE9
              attribute;Bundle Subscription Fact Key;754E64F2-9D65-DFE3-C9CB-79337CB9DE40 ::: column;BNDL_SUBSCRIPTION_FACT_KEY;D014C10B-C265-6C36-FC89-D1515E4C1113
              key;PK Bundle Subscription Fact Key;ABF45E11-CF9B-402B-4DCB-52C9311F30B5 ::: index;PK_BUNDLE_SUBSCRIPTION_FACT_KEY;2B35B9A3-FFD1-9F57-0683-3B6A9FB7631E
              attribute;Product Offer_Product Offer Key1;D4B3BFF3-56D3-4F37-775C-6F117FCA2C64 ::: column;PRODUCT_OFFER_PRODUCT_OFFER_KEY1;9B628400-96A3-F863-D94D-42BE9064D11E
              attribute;Participant Session Usage Units;F9032215-6A98-7CF3-70FD-AF2197D1825F ::: column;TIER_USG_UNITS;D7573879-16E3-0EA7-3B2E-D9696C4B56D0
              attribute;Bundle Tier Revenue Fact Key;FFB66275-D636-7F6C-1EC6-AA090FD3922A ::: column;BNDL_TIER_REV_FACT_KEY;A73B8498-3D74-A373-9634-D0F1EFA748B6
              attribute;Bundle Definition Key;FFE7E2EC-4DFD-EB77-C747-BDEFCA1FD689 ::: column;BNDL_DEFINITION_FACT_KEY;E666AC9F-AAA5-FCCC-041A-CBD9132502D0
              ------------------------
              • 19. Re: Switch from v3EA4 to v3.0.0.4 production - Corrupted models?
                Philip Stoyanov-Oracle
                Hi Tiji,

                then you can run following script to remedy the problem:
                mappings = model.getDesign().getExtendedMap().getMappings().values().toArray();
                for (var i = 0; i < mappings.length; i++) {
                  mapping = mappings;
                if(mapping.getOwnerDesignPartID()==null || mapping.getTargetDesignPartID()==null){
                model.getDesign().getExtendedMap().removeMapping(mapping);
                }
                }
                And you should save your design.
                
                Philip                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                
                • 20. Re: Switch from v3EA4 to v3.0.0.4 production - Corrupted models?
                  836039
                  Hi Phillip

                  The invalid links removal worked. Now, if this repair magic is part of the menu, that would be more helpful than me passing this code to my team. :-)

                  Where do I find the reference to object model to access all the methods and its properties in a package. I wanted to pass it on to some java developers here so that they can write the necessary code if needed.

                  Thank you!

                  Regards
                  Tiji

                  Edited by: Tiji on Jun 14, 2011 8:22 AM
                  • 21. Re: Switch from v3EA4 to v3.0.0.4 production - Corrupted models?
                    872255
                    I have de same problem, I can't engineer from a relational model to the logical model. When I execute the previous script for the relational model I get the next log:

                    java.lang.NullPointerException
                         at oracle.dbtools.crest.model.placeholder.DesignPartViewPlaceHolder.getEngEntSubView(Unknown Source)
                         at oracle.dbtools.crest.model.design.engineering.RE_RelationalToLogical.addTableSubView(Unknown Source)
                         at oracle.dbtools.crest.model.design.engineering.RE_RelationalToLogical.addFromRelationalModel(Unknown Source)
                         at oracle.dbtools.crest.model.design.engineering.RE_RelationalToLogical.<init>(Unknown Source)
                         at oracle.dbtools.crest.swingui.engineeringcompare.EngineeringCompareDialog.<init>(Unknown Source)
                         at oracle.dbtools.crest.swingui.relational.ControllerRelational$RevEngineer.doActionPerformed(Unknown Source)
                         at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
                         at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
                         at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
                         at java.lang.reflect.Method.invoke(Method.java:597)
                         at sun.reflect.misc.Trampoline.invoke(MethodUtil.java:36)
                         at sun.reflect.GeneratedMethodAccessor19.invoke(Unknown Source)
                         at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
                         at java.lang.reflect.Method.invoke(Method.java:597)
                         at sun.reflect.misc.MethodUtil.invoke(MethodUtil.java:243)
                         at sun.org.mozilla.javascript.internal.MemberBox.invoke(MemberBox.java:132)
                         at sun.org.mozilla.javascript.internal.NativeJavaMethod.call(NativeJavaMethod.java:190)
                         at sun.org.mozilla.javascript.internal.Interpreter.interpretLoop(Interpreter.java:3073)
                         at sun.org.mozilla.javascript.internal.Interpreter.interpret(Interpreter.java:2239)
                         at sun.org.mozilla.javascript.internal.InterpretedFunction.call(InterpretedFunction.java:138)
                         at sun.org.mozilla.javascript.internal.ContextFactory.doTopCall(ContextFactory.java:323)
                         at sun.org.mozilla.javascript.internal.ScriptRuntime.doTopCall(ScriptRuntime.java:2747)
                         at sun.org.mozilla.javascript.internal.InterpretedFunction.exec(InterpretedFunction.java:149)
                         at com.sun.script.javascript.RhinoCompiledScript.eval(RhinoCompiledScript.java:37)
                         at javax.script.CompiledScript.eval(CompiledScript.java:89)
                         at oracle.dbtools.crest.model.designrules.DRCustomScript.doCheck(Unknown Source)
                         at oracle.dbtools.crest.swingui.transformations.ApplyCustomTransformation.runTransformation(Unknown Source)
                         at oracle.dbtools.crest.swingui.designrules.CustomTransformationsManager$ApplyAction.actionPerformed(Unknown Source)
                         at javax.swing.AbstractButton.fireActionPerformed(AbstractButton.java:1995)
                         at javax.swing.AbstractButton$Handler.actionPerformed(AbstractButton.java:2318)
                         at javax.swing.DefaultButtonModel.fireActionPerformed(DefaultButtonModel.java:387)
                         at javax.swing.DefaultButtonModel.setPressed(DefaultButtonModel.java:242)
                         at javax.swing.plaf.basic.BasicButtonListener.mouseReleased(BasicButtonListener.java:236)
                         at java.awt.AWTEventMulticaster.mouseReleased(AWTEventMulticaster.java:272)
                         at java.awt.Component.processMouseEvent(Component.java:6134)
                         at javax.swing.JComponent.processMouseEvent(JComponent.java:3265)
                         at java.awt.Component.processEvent(Component.java:5899)
                         at java.awt.Container.processEvent(Container.java:2023)
                         at java.awt.Component.dispatchEventImpl(Component.java:4501)
                         at java.awt.Container.dispatchEventImpl(Container.java:2081)
                         at java.awt.Component.dispatchEvent(Component.java:4331)
                         at java.awt.LightweightDispatcher.retargetMouseEvent(Container.java:4301)
                         at java.awt.LightweightDispatcher.processMouseEvent(Container.java:3965)
                         at java.awt.LightweightDispatcher.dispatchEvent(Container.java:3895)
                         at java.awt.Container.dispatchEventImpl(Container.java:2067)
                         at java.awt.Window.dispatchEventImpl(Window.java:2458)
                         at java.awt.Component.dispatchEvent(Component.java:4331)
                         at java.awt.EventQueue.dispatchEvent(EventQueue.java:599)
                         at java.awt.EventDispatchThread.pumpOneEventForFilters(EventDispatchThread.java:269)
                         at java.awt.EventDispatchThread.pumpEventsForFilter(EventDispatchThread.java:184)
                         at java.awt.EventDispatchThread.pumpEventsForFilter(EventDispatchThread.java:178)
                         at java.awt.Dialog$1.run(Dialog.java:1047)
                         at java.awt.Dialog$3.run(Dialog.java:1099)
                         at java.security.AccessController.doPrivileged(Native Method)
                         at java.awt.Dialog.show(Dialog.java:1097)
                         at java.awt.Component.show(Component.java:1447)
                         at java.awt.Component.setVisible(Component.java:1400)
                         at java.awt.Window.setVisible(Window.java:824)
                         at java.awt.Dialog.setVisible(Dialog.java:987)
                         at oracle.dbtools.crest.swingui.ApplicationView.setTransformationsManagerVisible(Unknown Source)
                         at oracle.dbtools.crest.swingui.ControllerApplication$ShowTransformationsManager.doActionPerformed(Unknown Source)
                         at oracle.dbtools.crest.swingui.MDBAction$ActionInvoker.run(Unknown Source)
                         at java.awt.event.InvocationEvent.dispatch(InvocationEvent.java:209)
                         at java.awt.EventQueue.dispatchEvent(EventQueue.java:597)
                         at java.awt.EventDispatchThread.pumpOneEventForFilters(EventDispatchThread.java:269)
                         at java.awt.EventDispatchThread.pumpEventsForFilter(EventDispatchThread.java:184)
                         at java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:174)
                         at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:169)
                         at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:161)
                         at java.awt.EventDispatchThread.run(EventDispatchThread.java:122)

                    ¿Can you give me any script that solves the problem?
                    • 22. Re: Switch from v3EA4 to v3.0.0.4 production - Corrupted models?
                      836039
                      Phillip's post above was the solution for my problem.

                      mappings = model.getDesign().getExtendedMap().getMappings().values().toArray();
                      for (var i = 0; i < mappings.length; i++) {
                      mapping = mappings;
                      if(mapping.getOwnerDesignPartID()==null || mapping.getTargetDesignPartID()==null){
                      model.getDesign().getExtendedMap().removeMapping(mapping);
                      }
                      }

                      Run this on both logical and Relational just to be absolutely sure.

                      The other scripts in this thread are used to create log files to review the possible problems. Please read the entire thread to use the appropriate script.

                      Thanks
                      Tiji
                      • 23. Re: Switch from v3EA4 to v3.0.0.4 production - Corrupted models?
                        872255
                        I have executed the script, but it didn't solve the problem.

                        I have deleted all subviews in the logical model and then the engineer works fine. I supose that some relationship between the relational subviews and the logical subviews was lost.
                        • 24. Re: Switch from v3EA4 to v3.0.0.4 production - Corrupted models?
                          836039
                          You will have to use multiple scripts to identify the problems. When you delete a component from Logical area the link to the relational one is broken as well. Hope this helps but Phillip is the expert that would be able to help beyond my consolidated response.

                          Glad that deleting the subview helped.

                          Regards
                          Tiji
                          • 25. Re: Switch from v3EA4 to v3.0.0.4 production - Corrupted models?
                            Philip Stoyanov-Oracle
                            Thanks for feedback.
                            I have deleted all subviews in the logical model and then the engineer works fine
                            It's not good solution.
                            You can try following script:
                            mappings = model.getDesign().getExtendedMap().getMappings().values().toArray();
                            xmap = model.getDesign().getExtendedMap();
                            for (var i = 0; i < mappings.length; i++) {
                              mapping = mappings;
                            if(mapping.getOwnerDesignPartID()==null || mapping.getTargetDesignPartID()==null){
                            xmap.removeMapping(mapping);
                            }else{
                            if(mapping.getTargetType()==10){
                            owner = mapping.getOwnerObject();
                            target = mapping.getTargetObject();
                            broken = owner==null || target==null;
                            if(broken){
                            if(mapping.getOwnerDesignPart()!=null && owner==null){
                            owner = mapping.getOwnerDesignPart().getSubViewByID(mapping.getOwnerID());
                            }
                            if(mapping.getTargetDesignPart()!=null && target==null){
                            target = mapping.getTargetDesignPart().getSubViewByID(mapping.getTargetID());
                            }
                            xmap.removeMapping(mapping);
                            if(owner!=null && target!=null){
                            xmap.createMapping(owner.getPlaceHolder(), target.getPlaceHolder());
                            }
                            }
                            }
                            }
                            }
                            You need to execute it once before first engineering.
                            
                            Philip                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            
                            1 2 Previous Next