Wednesday 14 December 2016

SOA Service Client : SETPROPERTIES / CHECKOUT / CHECKIN / REFRESH

How to check out objects in Teamcenter ?
   private static void checkout(ModelObject[] modObjArr)
    {
       //com.teamcenter.services.strong.core.ReservationService
        ReservationService resServ = ReservationService.getService(connection);
        ServiceData data = resServ.checkout(modObjArr, "", "");
       //Checkin method is also available on ReservationService
    }

 
How to Set Properties on Object ?
private static void setProperties(ModelObject[] modObjArr,HashMap<String, VecStruct> mapAttributes)
    {
      System.out.println("Inside setProperties method");
      //com.teamcenter.services.strong.core.DataManagementService

      DataManagementService dmService = DataManagementService.getService(connection);
      ServiceData data =dmService.setProperties(modObjArr, mapAttributes);
    }
How to refresh objects ?
private static void refreshObjects(ModelObject[] modelObjectArr)
{
   com.teamcenter.services.strong.core.DataManagementService dmService = com.teamcenter.services.strong.core.DataManagementService.getService(connection);
   ServiceData data = dmService.refreshObjects(modelObjectArr);
}

1 comment: