ISCPersistenceUnit::ReverseEngineerScript
Here is the signature for the ReverseEngineerScript function:
HRESULT ReverseEngineerScript ([in]ISCPropertyBag * PropertyBag, VARIANT Locator, VARIANT Disposition);
The following table contains the valid arguments for the ReverseEngineerScript function:
|
Parameter |
Valid Type/Value |
Description |
|---|---|---|
|
PropertyBag |
ISCPropertyBag * - Pointer to a Property Bag object. |
Contains options for reverse engineering. |
|
Locator |
VT_BSTR - Full path to a storage location. |
Provides the path to the reverse engineering script file. Use the Schema option to reverse engineer a model from a JSON schema. This option is only available for JSON. |
|
Disposition |
VT_BSTR - List of keywords parameters. |
Specifies a schema or a blank value as an option for RES. |
The following table contains the valid arguments for the PropertyBag parameter.
|
Parameter |
Valid Type/Value |
Description |
|---|---|---|
|
Synch_Table_Filter_By_Name |
VT_BSTR Default: Null |
Reverse engineers the tables that contain the input filter strings. Multiple filter strings are specified as comma separated values. |
|
Case_Option |
25090:None 25091:lower 25092:Upper Default: None |
Specifies the case conversion option for physical names. |
|
Logical_Case_Option |
25045: None 25046: UPPER 25047: lower 25048:Mixed Default: None |
Specifies the case conversion option for logical names. |
|
Infer_Primary_Keys |
VT_BOOL-- True or False. Default: None |
Infers primary key columns for the tables that are based on defined indexes. True: Primary Keys option is selected. False: Primary Keys option is not selected. |
|
Infer_Relations |
VT_BOOL-- True or False. Default: False |
Infers the relationships between tables that are based on either primary key column names or defined indexes. True: Relations Option is selected. False: Relations Option is not selected. |
|
Infer_Relations_Indexes |
VT_BOOL-- True or False. Set the value to Indexes or Names when Infer_Relations is set to Relations. Default: False. |
Infers the relationships from the table indexes. True: Indexes option is selected. False: Names option is selected. |
|
Remove_ERwin_Generated_Triggers |
VT_BOOL--True or False. Default: True. |
Removes erwin generated triggers. True: Remove Include Generated Triggers. False: Do not remove Include Generated Triggers. |
|
Force_Physical_Name_Option |
VT_BOOL--True or False. Default: Force |
Overrides the physical name property for all objects in logical/physical models automatically during reverse engineering. True: Force physical name option. False: Do not force physical name option. |
Use Scripts with API while Reverse Engineering:
Use a JSON or SQL scripts with API while reverse engineering.
Reverse Engineering Script Sample:
Dim oAPI
Set oAPI = CreateObject("ERwin9.SCAPI.9.0")
Dim oPropertyBag
Set oPropertyBag = CreateObject("ERwin9.SCAPI.PropertyBag.9.0")
'Create LP model with Database as MongoDB
Call oPropertyBag.Add("Model_Type", "Combined")
Call oPropertyBag.Add("Target_Server", 1075859196)
Call oPropertyBag.Add("Target_Server_Version", 4)
'Create Persistence Unit
Dim oPUnitCol
Set oPUnitCol = oApi.PersistenceUnits
'Create Propertybag
Dim oPersistenceUnit
Set oPersistenceUnit = oPUnitCol.Create(oPropertyBag)
'Clear all propertybag objects
oPropertyBag.ClearAll()
'Call oPropertyBag.Add("Synch_Table_Filter_By_Name", "listingsAndReviews")
Call oPropertyBag.Add("Case_Option", 25090)
Call oPropertyBag.Add("Logical_Case_Option", 25045)
Call oPropertyBag.Add("Infer_Primary_Keys", False)
Call oPropertyBag.Add("Infer_Relations", False)
Call oPropertyBag.Add("Infer_Relations_Indexes", False)
Call oPropertyBag.Add("Remove_ERwin_Generated_Triggers", False)
Call oPropertyBag.Add("Force_Physical_Name_Option", False)
'Reverse Engineer the MongoDB DB
The following example refers to JSON models when the option is Blank Value:
Call oPersistenceUnit.ReverseEngineerScript(oPropertyBag, "C:\ERWIN_PROJECT\Issue_Scripts\MongoDB_MCL\MongoDB_JSON2_4.json", "")
The following example refers to JSON models when the option is Schema:
'Call oPersistenceUnit.ReverseEngineerScript(oPropertyBag, "C:\ERWIN_PROJECT\Issue_Scripts\MongoDB_MCL\MongoDB_JSON2_4.json", "Schema"))
'Save the RE'd model
Call oPersistenceUnit.Save("C:\TEMP_JPMC\MongoModelREDB_RES.erwin", "OVF=Yes")
|
Copyright © 2023 Quest Software, Inc. |