Tips When You are in Trouble with kintone’s “Workflow Management” (part 1)

How to start business (Process) of Cloud-based BPM Workflow Questetra from kintone

 

Hi, there!

 

“kintone”, a software provided by kintone Corporation, has a Workflow management feature. Concerning the feature, I have heard from people using it, the following challenges they were facing:

  • In the first place, configuration is hard.
  • You cannot design complicated business flows.
  • After trying hard to finally come up with a complicated setting, maintenance was very difficult later on.

On the other hand, in Cloud-based Questetra BPM Suite, there are features such as:

  • You can configure business flows naturally with Drag & Drop.
  • You can design complicated business flows (i.e. Parallel split, Complex conditional split, etc.)
  • Easy to maintain because the flow of business is visible.

Therefore, there are cases where kintone and Questetra are used in combination in order to clear the challenges of “Workflow management” mentioned above.

So, this time I would like to show you how to start business Processes on Questetra, triggered from kintone.


This time I will explain on the contract renewal operation as a sample.
The screen of kintone looks like the following, and the “send data to Questetra” button is placed by customizing with Javascript.

kintone_display_sample-en
For contracts with less expiration date, you click on the button to start the contract renewal process.


kintone_to_QBPMS2-en
Make the following settings respectively.

  • Questetra: Set to be started by receiving an HTTP request
  • kintone: Using customization with Javascript, add a button for sending displayed record information to Questetra via HTTP request


By placing a “Message Start Event” as below, it becomes able to be started by receiving HTTP request.
message_start_sample-en
* For details of “Message Start Event (HTTP)”, please see this Web document.
M221 AUTO START Auto Starting Triggered by HTTP Request

I made a business flow like the following, this time.
flow_sample_kintone-en

The Data Item setting on Questetra is as follows (only those related to cooperation with kintone are listed).

Data Item Number Data Item Name Data type
9 Record Number Numeric type
0 Customer Code String type
1 Customer Name String type
2 Representative in Charge String type
3 Customer Email address String type
4 Expiration Date Date type

In addition, the data edit permission setting of “Message Start Event (HTTP)” is as follows.
message_start_property-en

Once you release the App, the parameters etc. Of the connection part with kintone are confirmed. When opening “URL / Parameter Details” on the property of the “Message Start Event (HTTP)” on the released version, the following screen will be displayed and you can check it.
message_start_settings_sample-en

* Although this time it is not used to reduce setting as much as possible, it is possible to designate the Reception Parameter Name by specifying a “Field Name” in the Data Item setting.

Since it is not the main purpose of this example, we do not define a complicated business flow in Questetra, but we can also design a production business flow like the following:


For instructions on customizing with Javascript, the following links are helpful.
Tutorial
Add Buttons (Record Details)

The setting of the fields on kintone are as follows:

Field Name Field type Field Code
Customer Code SINGLE_LINE_TEXT customerCode
Customer Name SINGLE_LINE_TEXT customerName
Representative Name SINGLE_LINE_TEXT customerUserName
Customer Email address SINGLE_LINE_TEXT customerUserEmail
Expiration Date DATE expireDate

Javascript code set to kintone is as follows. It is set according to “URL / Parameter Details” of “Message Start Event (HTTP)” confirmed in the previously done setting on Questetra.
* Please change “●●●” that are set asURL, processModelInfoId, and key according to your Questetra environment.

(function () {
  "use strict";

  kintone.events.on('app.record.detail.show', function (event) {
    var myIndexButton = document.createElement('button');
    myIndexButton.id = 'my_index_button';
    myIndexButton.innerHTML = 'Submit Data to Questetra';
    myIndexButton.onclick = function () {

      var customerCode = '';
      var customerName = '';
      var customerUserName = '';
      var customerUserEmail = '';
      var expireDate = '';

      var recordId = kintone.app.record.getId();
      var rec = kintone.app.record.get();
      if (rec) {
        customerCode = rec.record.customerCode.value;
        customerName = rec.record.customerName.value;
        customerUserName = rec.record.customerUserName.value;
        customerUserEmail = rec.record.customerUserEmail.value;
        expireDate = rec.record.expireDate.value;
      }

      var url = "https://●●●.questetra.net/System/Event/MessageStart/start";
      var headers = {'Content-Type' : 'application/x-www-form-urlencoded'};
      var data = "processModelInfoId=●●●"
        + "&nodeNumber=0"
        + "&key=●●●"
        + "&data[9].usdecimal=" + recordId
        + "&data[0].input=" + customerCode
        + "&data[1].input=" + encodeURIComponent(customerName)
        + "&data[2].input=" + encodeURIComponent(customerUserName)
        + "&data[3].input=" + encodeURIComponent(customerUserEmail)
        + "&data[4].input=" + expireDate;

      kintone.proxy(url, 'POST', headers, data, function (body, status, headers) {
        if (status === 200) {
          alert('Transmission completed');
        } else {
          alert('Transmission failed (Please consult system administrator)\n' + status + '\n' + body);
        }
      });

    }
    kintone.app.record.getHeaderMenuSpaceElement().appendChild(myIndexButton);
  });
})();
* For data transfer between kintone and Questetra, it is necessary to match the format depending on the type of data. Regarding the Texts, numerals, and dates we used in this example, we were able to collaborate with them as they did not have any conversion.


With the above setting, when you press a button on the record details screen of kintone, work (Process) starts on Questetra.
In this scenario, it is necessary to return the result from Questetra to kintone, but that part will be explained in Part 2.


When you apply from this web form, you can create a free account for Questetra. All functions including the above are available, so please try it.

FreeQues

 

About Kusaka Tsuyoshi

営業をやってますが、もともとエンジニアなので、プログラミングもやります。
View all posts by Kusaka Tsuyoshi

Recommendations
Prev article - 50. Questetra Tips Automate Processing by Accessing its Own API
Next article - 50. Questetra Tips Can Backlog and Cloud BPM Cooperate?
Another article - Kusaka Tsuyoshi Collaboration of Cloud-based Workflow with Various Groupwares

Archive

 RSS