Does SAP PowerDesigner have an API?

倖福魔咒の 提交于 2020-03-03 03:05:31

问题


Does PowerDesigner have an Java/Python etc. API that can be called so that I can retrieve a physical table's columns and data types programmatically?
Googling did not help me locate a documentation and possibly a tutorial. Any directions would me extremely helpful. Best regards.


回答1:


The basic API for PowerDesigner uses OLE Automation.

This API is readily accessible from VBScript, .NET languages, PowerShell...

PowerDesigner comes with a helper jar named pdj2com*.jar.

You should have a JavaProxy.doc under the Java Samples sub-directory, with instructions to use this jar.

The code looks like this, from the example for the creation of an Object-Oriented Model:

import org.eclipse.swt.internal.ole.win32.COM;
import com.sybase.stf.powerdesigner.PdCommon.*;
import com.sybase.stf.powerdesigner.PdOOM.*;

int hr = COM.OleInitialize(0);
Application pdApp = Application.getInstance();
Model newModel = new Model(pdApp.CreateModel(PdOOM_Classes.cls_Model, "|Language=Java|Diagram=ClassDiagram"));
newModel.SetName("Customer Management");
newModel.SetCode("CustomerManagement");
com.sybase.stf.powerdesigner.PdOOM.Class newClass = new com.sybase.stf.powerdesigner.PdOOM.Class(newModel.GetClasses().CreateNew());
newClass.SetName("Customer");
newClass.SetCode("Customer");


来源:https://stackoverflow.com/questions/59138659/does-sap-powerdesigner-have-an-api

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!