Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

Status
colourGreen
titleAvailable From 19.0

Migrating older models to use relative IRIs improves model refactoring. First, you need to add the macro. Second, you need to execute that macro. Lastly, you need to use that macro to migrate your older model to use relative IRIs.This can be done using the Macro Engine. The modeling tool comes with the macro file installed in the tool's directory. Instructions on how to find the file are described in step #4 of how to add the macro. 

To add the macro

...

  1. In your Concept Modeling Project, click click Tools >  > Macros >  > Organize Macros...or use the shortcut key key Ctrl+Alt+M.

    Image Modified
    Figure 1: Showing the steps to open the Organize Macros dialog.
  2. The
  3. The Organize Macros

  4. dialog
  5.  dialog opens. Click Add.

    Image Modified
  6.  Figure 2: Showing the Organize Macros that  holds the application's macros.
  7. Click Add. The The Macro Information dialog  dialog opens. Fill out the the Name, Macro Language, and  and File containing  containing the macro's description.
    Image Removed

    Figure 3: Showing the Macro Information dialog where you can insert the macro file.
    Info
    titleMacro Language
    The Macro Language is the macro's file extension. The modeling tool supports BeanShell, Groovy, JRuby, JavaScript, JavaScript Rhino, and Jython.

     
    Image Added

  8. To find the appropriate file, click on the three dots at the end

  9. of
  10. of File

  11. field
  12.  field. Your local directory opens. Find the application folder, and

  13. select
  14. select data

  15. >
  16.  > Concept Modeler

  17. >
  18.  > scripts

  19. >
  20.  > UpdateIRI.groovy.

    Image ModifiedFigure 4: Showing the steps to find
  21. the
  22. the .groovy
  23. file
  24.  file
  25. Now that you have selected the file, click click Ok. Now you You should now see the macro added in the Organize Macros dialog.
  26. Click Close.
Info
titleMacro Language

The Macro Language is the macro's file extension. The modeling tool supports BeanShell, Groovy, JRuby, JavaScript, JavaScript Rhino, and Jython.


To execute the macro

...

  1. Click

  2. on
  3. on Tools

  4. >
  5.  > Macros

  6. >
  7.  > Macro Name e.g. UpdateIRIMacro.

    Image Modified
  8. Figure 5: Showing the steps to execute the newly added macro.
  9. The The Notification Window will  will notify you when the macro was executed.

To use the macro for your older modelexisting project

...

  1. Right-click on

  2. your
  3. the model

  4. that
  5. on which you would like to update IRIs

  6. on as shown in Figure 6
  7. .

  8.  
  9. Image Modified
  10. Figure 6: Showing the option to make IRI relative to the model package.
    This prompts for you to select
  11. A dialog will open asking you where to save the results in .csv

  12. file generated from this option
  13.  format.

  14. After selecting the file, the progress bar shows the progress of the migration.

  15. The notification window notifies you when the migration is done, and where the results are stored. 

    Image Modified
  16. Find the Update IRI results in your designated location, and view the
  17. Excel document containing
  18. CSV file showing which elements were looked at and updated. The CSV file describes the "Element ID", "Old IRI","New IRI", and "Updated".


Note
titleIf you're working with a TWC project...
  • For Teamwork Cloud (TWC) projects, the script will try and lock an element before updating its IRI value. For any element that should be updated and cannot be locked, a message will be shown in the Notification Window: "Unable to lock and update IRI for '%s' due to an element being locked by another user".
  • For TWC projects, Property typed elements cannot be locked, so their owner will be locked instead.


Note
titleIf your element has no IRI...
  • If current element has no IRI value, then no IRI value will be created for it.