Wednesday 14 December 2016

SOA Service Client : Set Preference in Teamcenter

How to set preference ?

private static void setPreferences2(String sPrefName, String sPrefDesc, String sPrefValue)
{

 SetPreferences2In[] prefSetting = new SetPreferences2In[1];
 prefSetting[0] = new SetPreferences2In();
 prefSetting[0].preferenceName = sPrefName;
 prefSetting[0].values = new String[] { "" + sPrefValue };

 com.teamcenter.services.strong.administration.PreferenceManagementService prefMgmtService = com.teamcenter.services.strong.administration.PreferenceManagementService.getService(connection);
 ServiceData data = prefMgmtService.setPreferences2(prefSetting);

 if (data.sizeOfPartialErrors() > 0)
 {
  processServiceDataForPartialErrors(data);
 }
}

No comments:

Post a Comment