Skip to Content
Personal Insights
Author's profile photo Wolfgang Fuchs

Use uploaded documents in Process Automation API Trigger

Use Case:

We are shifting Workflows from an old environment to SAP Build Process Automation.
Our main ERP System is SAP S/4 HANA On Premise Release 2020 FPS02.

For one of the Processes, we need to trigger Workflows from SAP Backend. It is crucial to use documents in the Workflow, as it is one part to make the approver understand what he/she has to approve. And it is not a user friendly solution to trigger a Workflow and make a first task available again for exactly the same user to upload the files as a first task. That is simply not acceptable.

Until now i couldn’t find any solution to upload documents and use them already in the first Task of the Process. Beeing desperate helped and i was playing around with the API-Trigger.

We have Process Automation and DMS, Integration Option in place. Both instances are reachable from SAP Backend.

 

What is necessary to make uploaded files available in the first Approval Task?

Here are the steps to reproduce if you use the Process part of Process Automation.

 

Create a project for your process is something i do not handle here.

Create new Data Type

Create%20Data%20Type

 

 

 

 

 

 

 

 

 

Create new Data Type and add one field.

I named it ‘file’ and its of data type ‘Document Folder’.

 

Configure Process Inputs

In the Process Inputs add one property ‘uploadFile’ and use the created data type. As it is already month ago now, I don’t remember if it only will work if you name it ‘uploadFile’. Because if you check out context Payload when you upload documents in a task, then this property is called ‘uploadFile’.

 

Trigger API with CMIS folder ID

 

You now see it available in API-Trigger.

 

I trigger the API now with this data. For the ‘file’ property I have to use the cmis path to the folder I used to upload files prior to the api trigger. I send this information with prefix ‘spa-res:cmis:folderid:’ and add the id of the folder.

So of course you need to have CMIS configured in Subaccount/Tenant to have it available like this.

 

Receive Task Email

In this process user receives an email and is able to navigate to inbox via link.

 

Have documents available in first Approval Task

Here in the first available task in process you see already a document attached. Additionally, the user can still add more documents if configured and useful.

 

 

I hope this blog helps some SBPA Users facing the same situation as we did 🙂

And of course let me know if things here needs to be explained more detailed.

 

See you,

Wolfgang

Assigned Tags

      5 Comments
      You must be Logged on to comment or reply to a post.
      Author's profile photo Kazuhiko Takata
      Kazuhiko Takata

      Hi Wolfgang Fuchs

       

      Thanks for your solution. This is exactly what I was trying to find and I can solve issue to pass attachment file to workflow approver.

      Author's profile photo Avik Saha
      Avik Saha

      Thanks for your Solution. This is what I was looking for.

      Author's profile photo Chaitanya Priya Puvvada
      Chaitanya Priya Puvvada

      Hello Avik Saha

      We have released a Learning content store sample where you can download and refer to the code.Please refer to the blog post for more details.

      You can refer to the SBPA learning content monthly release for more updates.

       

       

      Author's profile photo Shubham Kumar
      Shubham Kumar

      Hi Wolfgang Fuchs,

      Thanks for this Blog, it is really useful.

      I am trying to implement one thing If anyone could help me in find the solution for:-

      I wanted to get the user detail who has triggered the process from API using token as for now when i am triggering the process, the startedBy when triggered the Process through API using OAuth 2.0 using Token  is coming as as "sb-clone-*****" .

      {

       "startedBy": "sb-clone-*****",

      }

      How can i get user detail who has triggered the process through API using token?

      Author's profile photo Chaitanya Priya Puvvada
      Chaitanya Priya Puvvada

      Hello Avik Saha  , Kazuhiko Takata

      We have released a Learning content store sample where you can download and refer to the code.Please refer to the blog post for more details.

      You can refer to the SBPA learning content monthly release for more updates.