Previous Topic: What's NewNext Topic: Report Designer Enhancements


Enhancement to the Notes Feature

A new tab by name Extended Notes is added to all the model objects. This tab is in addition to the existing Notes tab. The existing Notes tab lets you only view the notes that are entered in this tab. The Extended Notes tab is a model object, and you can perform the following tasks:

You can transfer the notes from the Notes tab to the Extended Notes tab. In the Extended Notes tab, you can associate a level of importance and can add a status to each note. You can also transfer a note from the Extended Notes tab to the Notes tab.

When you transfer a note from the Extended Notes tab to the Notes tab, the following changes occur:

To search for an extended note, follow these steps:

  1. Press Ctrl + F in the Model Explorer and enter a word from the note that you want to find, in the Find What field.
  2. Click Find Next until you find the required object.

    The extended note object that contains the keyword is displayed as <note name> under the Extended Notes node. When you find the matching extended note object, use the Locate in Model Explorer icon to go to the object.

To compare the extended notes using Complete Compare, follow these steps:

  1. Select the left and right models.
  2. In the Type Selection page, select Extended Notes under the object for which you want to compare extended notes. For example, select Extended Notes under the entity and attribute nodes for a Logical model. For a Physical model, select Extended Notes under the table and column nodes. Select any other options that you want to compare.
  3. Click Compare.

    The differences in the extended notes are displayed in the Resolve Differences window under the Extended Notes node for each object.

To edit multiple extended notes using Bulk Editor, follow these steps:

  1. Invoke the Bulk Editor Wizard.
  2. In the Object Types page, select Extended Notes.
  3. In the Property Type page, select the properties that you want to view or change.
  4. In the Object Instances page, expand User Note and select the objects for which you want edit the extended notes.
  5. Click Edit.

    For more information about how to use the Bulk Editor, see the Changing the Properties of Multiple Objects scenario.

Use the following example to create an extended note through API:

Note: Before you execute this code, help ensure that EAL.dll is registered.

Sub updateAttribute()

  ' This Creates an Instance of SCApplication
  Set SCApp = CreateObject("AllfusionERwin.SCAPI")
 
   'Declare a variable as a FileDialog object.
  Dim fd As FileDialog
  'Create a FileDialog object as a File Picker dialog box.
  Set fd = Application.FileDialog(msoFileDialogFilePicker)

  fd.AllowMultiSelect = False
  fd.Filters.Clear
  fd.Filters.Add "Erwin File", "*.erwin", 1
  If (fd.Show = -1) Then
      strFileName = fd.SelectedItems.Item(1)
  Else
      Exit Sub
  End If
  'Set the object variable to Nothing.
  Set fd = Nothing

 'strFileName = "C:\models\test03.erwin"
 
   '  This is the name of the ER1 Model that needs to be updated
  Set SCPUnit = SCApp.PersistenceUnits.Add("erwin://" & strFileName)
  Set SCSession = SCApp.Sessions.Add
  SCSession.Open (SCPUnit)
  Set SCRootObj = SCSession.ModelObjects.Root
  Set SCEntObjCol = SCSession.ModelObjects.Collect(SCRootObj, "Entity")
Dim nTransId
nTransId = SCSession.BeginNamedTransaction("Test")

    For Each oEntObject In SCEntObjCol
      On Error Resume Next
      Set oEntCol = SCSession.ModelObjects.Collect(oEntObject, "Attribute")
        For Each oAttObject In oEntCol
            Set oUserNote = SCSession.ModelObjects.Collect(oAttObject).Add("Extended_Notes")
            oUserNote.Properties("Comment").Value = "Test note1"
            oUserNote.Properties("Note_Importance").Value = "0"     'enum {0|1|2|3|4|5}
            oUserNote.Properties("Status").Value = "1"              'enum {1|2|3}
        Next oAttObject
      
    Next oEntObject
SCSession.CommitTransaction (nTransId)
SCSession.Close

' Save the model
Call SCPUnit.Save("erwin://" & strFileName)
MsgBox "Incremental-Save successfully"
SCApp.Sessions.Remove (SCSession)

SCApp.PersistenceUnits.Clear

SCPUnit = Null

SCSession = Null

End Sub