Technology Blog Posts by SAP
cancel
Showing results for 
Search instead for 
Did you mean: 
NaotoSakai
Product and Topic Expert
Product and Topic Expert
1,453

*This article is a continuation of Part 2. Here is part 1.

4.Creating the logic for the Execute Workflow button

Now that we have completed the logic to create a folder and upload files to DMS, we will create the logic to start the SAP Build Process Automation process from this SAP Build Apps application. It will start with the uploaded file (folder) information attached, so you will be able to reference this file on SAP Build Process Automation.

NaotoSakai_0-1738196565234.png

In SAP Build Apps, you can use the process created in Part 1 with SAP Build Library from Integrations.

NaotoSakai_2-1738197566405.png

If you can't see the deployed process in the list here, you've probably forgotten to Publish.

Create the logic for the Execute Workflow button. The logic is simple.

NaotoSakai_1-1738197445803.png

The important thing is the "Trigger Process". Select the process you made available from Integrations.

NaotoSakai_3-1738197724383.png

Select Object with Properties as Input Parameters and use Formula to set the values.

NaotoSakai_4-1738197825794.png

NaotoSakai_5-1738197870748.png

As explained in Part 1, the folder ID information must be passed in the format "spa-res:cmis:folderid:<folder ID on DMS>". The folder ID should have been assigned to Application Variables from the API return value when creating the folder. Concatenate the string "spa-res:cmis:folderid:" to that value.

The logic is now complete. Let's test it.

 

Test

Run the Build Apps application you created.

NaotoSakai_6-1738198248463.png

Clicking the File Upload button will open a file selection dialog, so this time we will upload a PDF document. I created a simple PDF document in Word for testing purposes.

NaotoSakai_8-1738198397303.png

NaotoSakai_9-1738198515130.png

The display depends on the settings in the dialog set after the file upload API, but it looks like the upload was successful. In debugging mode, it is better to check whether the folder is created and uploaded properly using ReuseUI or DMS API.
Next, click the Execute Workflow button to start the SAP Build Process Automation process.
This process (created in Part 1) is a structure that sends a form with a file attached to itself after being triggered by the API. Open My Inbox from SAP Build Lobby.

NaotoSakai_10-1738199105964.png

You should have received the form yourself. There seems to be an attached file as well. Let's check the contents.

NaotoSakai_11-1738199187207.png

You can confirm that it is a PDF file that you uploaded from SAP Build Apps.

In this way, you can upload files with SAP Build Apps and link them to the SAP Build Process Automation workflow. SAP Build Apps allows you to perform more application-like processing than SAP Build Process Automation. It is also possible to do things that are impossible with SAP Build Process Automation forms, such as narrowing down searches such as major classification -> medium classification -> minor classification -> product, and interactive collaboration with external systems. The recommended usage is to use SAP Build Apps on the application screen that triggers the workflow.

nother important point is that you can link files uploaded to DMS from other apps by passing the format "spa-res:cmis:folderid:" + folder ID when triggering a process. (Although it needs to be the same DMS repository used by SAP Build Process Automation)

From what we hear from customers about how they use it, it seems like a common pattern is to attach files to workflows. I think you can do a lot more with it, so please give it a try.

Regards,

4 Comments
0 Kudos

Thanks for the post.  I have the object ID of the folder which is a string and how do I bind it to the Document Type so that I can use it in the workflow for the approval form.  I constructed the string like this in java script : 

let objectId = "spa-res:cmis:folderid:" + folderId;
But this is not document folder type.  I am not sure how to set the document folder type variable with the object ID data that i have.  
My process is I took the document from the inbox of a mail box and it is not uploaded from a request form.  So for this how to set the document type variable using the object ID of the folder.  I have been looking for a solution on this as I need to show the document sent to the DMS via automation on the Approval form for the end user.
 
NaotoSakai
Product and Topic Expert
Product and Topic Expert
0 Kudos

Hi padma,

Please try ... (I'm not tested)
- define document folder type variable as custom variable.
- set ""spa-res:cmis:folderid:" + folderId" value to above custom variable on script task.

Regards,
Naoto

NaotoSakai
Product and Topic Expert
Product and Topic Expert
0 Kudos

Once , The method that has been used for a long time is to use Automation. You can set a Document Folder type value as output from Automation.

kazistov_v
Explorer
0 Kudos

Hello @NaotoSakai ,

Thank you very much for that post. It's really very helpful! Every part is good structured and clear enough.

Best regards,
Vladyslav