Wednesday 14 December 2016

SOA Service Client : Set Release status

How to Set Release Status on objects ?

private static void setReleaseStatus(ModelObject[] modObjArr, String sReleaseStatus) throws ServiceException
{
  //com.teamcenter.services.strong.workflow.WorkflowService

 WorkflowService workflowService = WorkflowService.getService(connection);
 ReleaseStatusOption[] releaseStatusOptions = new ReleaseStatusOption[1];
 releaseStatusOptions[0] = new ReleaseStatusOption();
 releaseStatusOptions[0].newReleaseStatusTypeName = sReleaseStatus;// "Released";
 releaseStatusOptions[0].operation = "Append";// "Append";

 WorkspaceObject[] objectsToRelease = new WorkspaceObject[modObjArr.length];
 for (int i = 0; i < modObjArr.length; i++)
 {
 objectsToRelease[i] = (WorkspaceObject) modObjArr[i];
 }


 ReleaseStatusInput ip = new ReleaseStatusInput();
 ip.operations = releaseStatusOptions;
 ip.objects = objectsToRelease;

 ReleaseStatusInput[] releaseStatusInput = new ReleaseStatusInput[1];
 releaseStatusInput[0] = ip;
 SetReleaseStatusResponse releaseResponse;
 releaseResponse = workflowService.setReleaseStatus(releaseStatusInput);
}

2 comments:

  1. Can I set "Item" release status by this method?
    If I can, I only know item UF_UGMGR_tag_t.
    How could I convert UF_UGMGR_tag_t to ModelObject?

    ReplyDelete
  2. I saw many sample set newReleaseStatusTypeName as "Released", "TCM Released"...etc
    Could you explain what difference between them?

    ReplyDelete