Teamcenter SOA开发源码: 打印对象信息
Teamcenter SOA开发源码: 打印对象信息
import com.teamcenter.clientx.AppXSession;
import com.teamcenter.services.strong.core.DataManagementService;
import com.teamcenter.soa.client.model.ServiceData;
import com.teamcenter.soa.client.model.ModelObject;
import com.teamcenter.soa.exceptions.NotLoadedException;
public void printObject_strings(ModelObject[] objects)
{
DataManagementServicedmService = DataManagementService.getService(AppXSession.getConnection());
if (objects.length == 0) return;
String[] attributes = {"object_string"};
dmService.getProperties(objects, attributes);
for (int i = 0; i < objects.length; i++)
{
String type = objects.getTypeObject().getName();
String objectString = "";
if (objects.getTypeObject().isInstanceOf("POM_object"))
{
try
{
objectString = wo.getPropertyObject("object_string").getStringValue();
}
catch (NotLoadedException e) {} // just ignore
}
System.out.println(" " + objectString + "(" + type + ")" );
}
}
页:
[1]