Many of our Questetra’s customers† utilize Cloud Storage together with our service.
† Those who use “Questetra BPM Suite”, the cloud-based service for managing Business Process in organization (Visualizing progress and achievement)
From such customers, we often receive consultations about a method for saving files automatically to Questetra BPM Suite and Cloud storage. In this article, we introduce how to collaborate Questetra BPM Suite with “Box”, the representative cloud storage service for enterprise.
As we mentioned the past article “Cannot Collaborate with Box … for Now“, you could not collaborate Questetra BPM Suite and Box. However, now you are able to do it!
To make the collaboration procedure easier to understand, we suppose a simple Business Process of saving a file from Questetra BPM Suite to Box.
Description Flow
I will describe a way of setting for realizing collaboration of Questetra BPM Suite with Box according to the following steps.
1. Define Process Model on Questetra BPM Suite
2. Setting OAuth 2.0
3. Confirm operation
After accessing API of Box from Questetra BPM Suite, transfer a registered file on Questetra BPM Suite to Box and save it. To access the API, it is required to use the authentication system OAuth 2.0. First, you must set up it.
Incidentally, this article is written for people who have the following skills.
- Those who understand how to develop Box application
- Those who understand how to use [Throwing Message Intermediate Event (HTTP)] / [Script Task] in Questetra BPM Suite
== Define Process Model on Questetra BPM Suite ==
Here we configure Questetra BPM Suite setting. The process model we define here can be download from here.
In the process model diagram, the human task includes “File Registration” only. Files that have been registered in this task will be sent to Box by the “File Sending” of [Throwing Message Intermediate Event (HTTP)] which is placed one step before the end.
The information on APIs for accessing Box is published as Box Content API in the following page.
https://box-content.readme.io/reference
API specifications for saving files to Box are described as follows:
- Access URL
- https://upload.box.com/api/2.0/files/content
- HTTP Method
- POST
- Request Parameter
- filename: file
- parent_id: 0 (We decided to save to the root here)
Based on this rule, configure the setting of “File Sending” Throwing Message Intermediate Event (HTTP).
== OAuth 2.0 Setting ==
To access a URL for API of Box from Throwing Message Intermediate Event of Questetra BPM Suite, OAuth 2.0 authentication is needed.
This setting includes the following steps.
- Confirm Callback URL in Questetra BPM Suite
- Confirm client_id and client_secret on Box Application
- Set OAuth 2.0 and acquire token in Questetra BPM Suite
=== Confirm Callback URL in Questetra BPM Suite ===
It is an operation in the Questetra BPM Suite side.
Confirm Callback URL in the property screen of Throwing Message Intermediate Event. In the screen of [Security] tab, select [Connect with the OAuth 2.0] and click [Set up OAuth 2.0 from here]. Then the screen of OAuth 2.0 setting is displayed in another window. Take note of Callback URL written in this page.
=== Confirm client_id and client_secret on Box Application ===
It is an operation in the Box side.
Take notes of client_id and client_secret that are displayed in the setting screen of an Box Application†. At the same time, register the Callback URL of Questetra BPM Suite that has been noted at the previous step to redirect_url in the same screen.
† Need to create Box Application before setting.
=== Set OAuth 2.0 and acquire token in Questetra BPM Suite ===
It is an operation in the Questetra BPM Suite side.
Open the property of “File Sending” Throwing Message Intermediate Event (HTTP) of a created process model.
In the screen of [Security] tab, select [Connect with the OAuth 2.0] and click [Set up OAuth 2.0 from here]. Then the screen of OAuth 2.0 setting is displayed in another window. Clicking [Add] on the top of the displayed screen, the details setting screen on OAuth 2.0 will be displayed. Set up each item as follows.
- Name
- (Arbitary)
- Authorization Code Request URL
- https://app.box.com/api/oauth2/authorize
- Access Token Request URL
- https://app.box.com/api/oauth2/token
- Scope
- (Empty)
- Consumer Key
- client_id of Box Application
- Consumer Secret
- client_secret of Box Application
When finished inputting, then save and acquire token.
== Operation Confirmation ==
When finished setting as described in the previous sections, then release the defined Process Model. After that, start the process from New Start and process an only Human Task [File Registration].
== Many kinds of Box APIs ==
Now, the description of how to configure a system for saving files which have been registered in Questetra BPM Suite to Box automatically has finished.
Box provides many kinds of APIs, and their specifications are published.
- API for saving file to Box (We used this time)
- API for referring to or operating files saved in Box
- API for referring to information of folders created in Box
etc. (There are many other APIs!)
By using Box API from Questetra BPM Suite, you can perform operations such as saving and changing to Box, or can get the information in the Box.
That’s it for today!