Download How to upgrade your 7.x, 8.x API utility to work with 9.x

Survey
yes no Was this document useful for you?
   Thank you for your participation!

* Your assessment is very important for improving the workof artificial intelligence, which forms the content of this project

Document related concepts

Marginal utility wikipedia , lookup

Choice modelling wikipedia , lookup

Transcript
How to upgrade your 7.x, 8.x API utility to work with 9.x
There have been some erwin API based utilities that are available to do some automated functionality, e.g. ‘Populating
the Entity and Attribute definitions and, if not found, creating them’. A few others have also been provided to
manipulate other areas of the model. However, if this utility was created for an earlier version, it may not work with the
later version and this document is to explain what is involved and also, how to make it work in the later version.
In erwin, the SCAPI (Secure Computation Application Programming Interface) is routed via a file named EAL.DLL which is
installed with erwin. So, for any erwin based API to work, this EAL.DLL should be registered and this is version specific.
The API based utilities, often in VBA form using an Excel sheet, are dependent on the SCAPI (EAL.DLL) version which is
registered. So, if the EAL.DLL version registered is for 9.1, and it is trying to access a 9.64 model, it will not work, even
though you may have version 9.64 installed.
IMPORTANT POINTS to NOTE:
1. Bit-size compatibility: erwin 64-bit API will work with a 64-bit VBA application (e.g. if using Excel, it also needs to be
64-bit). erwin APIs are compatible only with .COM based applications and those also need to be same bit-size as
the version of the erwin model.
2. Version: When using the API based utilities, the utility will access and open the model in cache memory, so if the
version of the API registered is older than the version of the model, it will not be able to open it, just as you cannot
open a 9.64.x model in 9.6.1. Conversely, if you do have a later version of the API registered, and you open a model
from an older version, the model will be opened and saved as a later version. In that case, someone with an older
version of erwin will not be able to open the model. The following should help with checking the API version that is
registered or is being used.
Open the Excel sheet with the utility and click on the tab View – it will then show Macros in the very end.
Click on Macros and select ‘Edit’:
Clicking on Edit will take one to the Visual Basic Editor. In that editor, click on Tools and select References as follows:
Clicking on References will take you to the following – notice the ‘Location’ – it is pointing to the EAL.DLL in the path
where erwin 8.2.08 is installed (the screen shot is from a PC where erwin 8.2.08 was installed under C:\ERwin_8208\)
Deselect the one for 8.2.08 and select the one that has erwin 9.5.2 for the location:
(The following screen shot is from a PC where erwin 9.5.2 was installed under (c:\ERwin_952\)
Now, the same utility which was working for erwin 8.x will work with erwin 9.x (for 9.64 – 64-bit, the Excel sheet should
also be 64-bit).
PS: If you don’t find the EAL.DLL in the list, you can click Browse and select the EAL.DLL from the installed erwin version
– it is in the folder where erwin is installed.
When will a utility from an older version NOT work with a later version, even after making the changes above?
Besides the API version compatibility, the API code also uses specific references to the metadata tags to access or
manipulate the data, e.g. in a sample utility, an attribute, if not found is being created as follows:
If oAttObject Is Nothing Then
Set oAttObject = oEntAtts.Add("Attribute")
oAttObject.Properties("Name").Value = strAttName
oAttObject.Properties("Type").Value = 100
oAttObject.Properties("Logical_Data_Type").Value = strAttDataType
oAttObject.Properties("Null_Option_Type").Value = strAttNull
oAttObject.Properties("Definition").Value = strAttDef
oAttObject.Properties("Comment").Value = strColCmnt
In the sample above, metadata tags e.g. “Name”, “Logical_Data_Type” etc. are used to set the attribute properties. Not
very often, but sometimes these metadata tags are changed, e.g. “Logical_Data_Type” used to be “Logical_Datatype”
and was changed for consistency reasons. If the older utility has a metadata reference which is either changed or
deprecated, the code will fail as the needed information cannot be found. Also, there are other instances where some
other architectural changes may also have been made, e.g. NOTES and HISTORY used to be together but were separated
in later version.
The good part is that these changes are very minimal and most older utilities should work with just a simple change as
mentioned above. If there is still an issue, please contact the Technical Support team.