Serialized Delivery of Workspace
Delivery of workspaces can be serialized from Siebel Application Manager using a few steps and scripts. This will allow serial delivery of more than one workspace concurrently submitted for delivery, not requiring manual submission of each delivery or wait for the ongoing deliveries.
To set up asynchronous serialized workspace delivery, perform the following procedure.
To set up asynchronous serialized workspace delivery
Set up a delivery schedule.
Query for approval requests by Profile ID and Status. For example:
Profile ID: “All requests in Release 19.10”
Status: “Pending Delivery”
Call the following API that is in-built to query the list of requests and the associated workspaces.
http://<sam server:port number>/sam/api/approvals/
This is a POST end point.
You can POST the query criteria in JSON format. Use the following steps to find the values for the query.
Make a sample request in SAM using a SAM profile and take the approval process request to the desired status of delivery.
To retrieve the row ID, make a POST call to the API in Step 2 using the sample Request Id as ‘row_id’ value as in the following JSON:
{ "row_id":"88-5E29P" }
Tip: You can find the Request Id from the browser address bar by drilling down in your sample request, for example, http://<sam server:port number>/sam/api/approvals/88-5E29P.Make a note of the Profile ID that the JSON output brings up on successful POST made in step 4b. For example:
{ "message": "", "data": [ { "approvalId": "88-5E29P", "seedIssue": "Y", "profileId": "88-5E1NS", "defaultActionId": null, "closeStatus": null, "fieldsAndData": [ . . . ], "buttons": null, "scmSystems": [ ], "approvalAuditTrail": [ ] } ] }
To retrieve the list of statuses and their Ids, make a GET call to http://<sam server:port number>/sam/status/ for the status of your sample request. For example:
{ "statusId": "88@30993086", "statusName": "Ready for delivery", "active": "Y", "lastUpdated": 1484249924000 },
Construct a final POST query JSON for the main API, http://<sam server:port number>/sam/api/approvals/ with the following values:
{ "PROFILE_ID":"88-5E1NS ", "APPROVAL_STATUS_ID":"88@30993086" }
This will return an array of JSON data, as follows:
{ "message": "", "data": [ { "approvalId": "88-5E29P", "seedIssue": "Y", "profileId": "88-5E1NS", "defaultActionId": null, "closeStatus": null, "fieldsAndData": [ . . . ], "buttons": null, "scmSystems": [ { "sdId": "88-5E7NM", "approvalId": "88-5E29P ", "systemId": "88@30993101", "systemName": "Workspace", "source": "\"dev_test_1\"", "valid": "Y", "validMsg": null, "deliveryStatus": null, "deliveryMsg": null }, { "sdId": "88-5E7NM", "approvalId": "88-5E29P ", "systemId": "88@30993101", "systemName": "Workspace", "source": "\"dev_test_2\"", "valid": "Y", "validMsg": null, "deliveryStatus": null, "deliveryMsg": null } ], "approvalAuditTrail": [ ] }, { (2nd array element of JSON representing the second request.) }, { (3rd array element of JSON representing the third request.) } ] }
Iterate through each of the requests for workspace information.
Locate the element
scmSystems
and copy thesource-value
in the array of JSON for requests queued up for delivery. ThescmSystems
element might have multiple workspaces in JSON array, if your request has multiple workspaces such as dev_test_1 and dev_test_2 in the sample JSON data in step 4.For each node of requests (a node has multiple calls within each request with more than one workspace in the same request) make POST calls to http://<workspace delivery API hosted server:port number>/workspacedelivery/workspace/ and pass the following JSON:
{ "wsname": "workspace name found from ‘source: value’ in previous step", "requestid": "approvalid found from the previous step" }
For example:
{ "wsname": "dev_test_1", "requestid": "88-5E29P" }