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:
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:
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:
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
Copyright © 2015 CA Technologies.
All rights reserved.
|
|