cancel
Showing results for 
Search instead for 
Did you mean: 
Read only

Connect Postman with Cloud ALM to create Project using RestAPI

SJohari
Explorer
0 Likes
1,820

Hi All Experts , 

This post is to seek your guidance ( step by step ) on connecting my Postman with my SAP Cloud ALM environment.

I don't have any SAP BTP configured.

I have servicekey details from my SAP Cloud ALM environment which has all details as below :

1) Endpoint : API
2) uaa : tenantmode
3) uaa : sburl
4) uaa : subaccountid
5) uaa : credential-type
6) uaa : clientid
7) uaa : clientsecret
😎 uaa : url
9) uaa : uaadomain
10) uaa : verificationkey
11) uaa : apiurl
12) uaa : identityzone
13) uaa : identityzoneid
14) uaa : tenantid
15) uaa : zoneid

Please guide me with steps that I need to follow to achieve this Goal of creating projects in my Cloud ALM Environment please.

Thanks

Sandeep

View Entire Topic
john_p_grimes
Product and Topic Expert
Product and Topic Expert

Hi Sandeep,

You have mentioned the request "/solutionProcessFlows/{solutionProcessFlowId}/solutionProcessFlowDiagrams/bpmn". This is documented in the Solution Process Flow - Solution Process Flow Diagram section of the API Reference for the SAP Cloud ALM Custom Processes API on the SAP Business Accelerator Hub. Reading this documentation we find that the POST request requires you to include JSON matching the "SolutionProcessFlowDiagramCreateBpmn" schema. Here is an image that describes the schema, taken from the Schema page of the same API.

john_p_grimes_0-1741713141054.png

So this brings us to an important conclusion: there is no ability or concept of uploading the actual BPMN file when using the API. Rather, the "raw" BPMN data must be supplied to the API as plain text as JSON Body content in the Request. This is the only mechanism that the API permits to upload BPMN content to the SAP Cloud ALM tenant. 

If you have a BMPN file representing a process, you must first open it and copy the file contents (which should be plain text using an XML format). Paste the contents into a new text editor file. Then you must edit the pasted contents so that any special characters that can be interpreted by JSON are "escaped". E.G. If there are any double quote characters (") in the BPMN content, they must be replaced with an escaped double quote character (backslash and double quote, like this: \"). Then finally the edited file contents must be entered as the value of the property "bpmn" in the "SolutionProcessFlowDiagramCreateBpmn" schema. 

As an example, here is some dummy JSON matching the shape of the "SolutionProcessFlowDiagramCreateBpmn" schema. I haven't used real BPMN data, just placeholder data to illustrate the character escaping etc. I've also separated the lines of the BPMN contents for better readability, but they can all be kept on one line without any issues. 

    {
        "name": "My First Diagram",
        "bpmn":
            "<definitions xmlns=....
                 <process id=\"Process_1\">
                     ...
                 </process>
                 <bpmndi: BPMNDiagram id=\"BpmnDiagram_1\">
                     ...
                 </bpmndi:BPMNDiagram>
             </definitions>"
    }

The size of the BPMN content is limited to 10MB. If the BPMN file containing the BPMN text is larger than 10MB, then the content cannot be uploaded via the API. You will either need to reduce the size of the process diagram in another editor, or re-create the process manually in the SAP Cloud ALM apps.

The API request also requires you to provide a "solutionProcessFlowId" value as a parameter in the Request URL. You will need to execute a series (or chain) of various other GET queries from the Custom Processes API to find the correct ID value for this purpose. For example, you can work in this direction to get to identify the relevant "solutionProcessFlowId" value:

  1. Solution Process: GET /solutionProcesses => Equips you with a list of "solutionProcessId" values. Select the relevant one for the next request.
  2. Solution Process - Solution Process Flow : GET /solutionProcesses/{solutionProcessId}/solutionProcessFlows =>Equips you with a list of "solutionProcessFlowId" values. Select the relevant one for the next request.
  3. Solution Process Flow - Solution Process Flow Diagram: POST /solutionProcessFlows/{solutionProcessFlowId}solutionProcessFlowDiagrams/bpmn

Because of the various API chaining required to use this API, it can be quite complicated to use this API to create/update processes when compared to other SAP Cloud ALM APIs. You must really study the API reference and the Schema view to fully understand how to use this API. A certain amount of trial and error will allow you to build up the necessary knowledge and experience necessary to fully utilize this API to its full effect.

I hope that this information is useful to you. If you have specific issues, please elaborate on them and provide screen shots where necessary and I'll try to help further. 

Thanks and regards, 
John

paula_augedahl
Product and Topic Expert
Product and Topic Expert
0 Likes
Dear Sandeep, since an answer was provided to your question, and there has been no other activity on the topic, we have accepted the answer as a solution on your behalf. You can unaccept it anytime if the answer provided was not helpful enough or if you have further questions. Thank you for bringing this question to SAP Community! Best regards, Paula