What is Budget Management for Eliminating Over-budget Approval Request?

Utilize the automated process for updating "Choices Master" and realize reliable budget management!

Hi, there!

We received several requests of the following sort:
“I would like to eliminate request for approval that exceed the budget!”
“I would like to grasp the remaining budget and requests for approval!”
“Is it possible to perform budget management using Questetra”


I would like to make a sample Process Model for

“Managing budgets strictly, performing mistake-free approval requests”!

== Policy ==

What I want to accomplish is

* To Update budget master appropriately
* To reflect budget execution from various businesses on the budget
* To be able to check the remaining budget at the time of requesting approval

As concrete solutions to fulfil them, I propose,

* Keep the budget master in “Options-XML”.
* Create a Process Model for updating the budget master so that the Process Model can be simultaneously operated from various Business Processes.

< Overview >

== Design of Budget Master ==

Suppose the following budget management scenario

* Budget is allocated to each department every fiscal year
* A Budget is composed of external payment budget and internal work budget

For example, we can consider the following design sample of a master.
<Example of Budget Master>
budget info/ remaining budget info master

The reason why I separate the budget information type from the remaining budget information is that I thought it is more understandable for applicants to select the “Name of Budget to be implemented” and make decisions when requesting approval.

In addition, considering using the master in various approval requests, it requires setting it as a “Shared Process Model File“.

== Explanation of Process Model for Budget Updating ==

<Example of Process Model for Budget Updating>

process model for updating budget

The Process Model can be as the one shown above. (The code for Script Task is described below)

I configured the following items as the cooperation data for the budget-updating Process.

* Update source Process ID (Process ID of approval requests)
* Information of budget to be updated (Select type Data Item of the budget information master selected in approval requests)
* Information of remaining budget to be updated (Select type Data Item of the remaining budget information master selected in approval requests)
* External payment amount (The amount approved in approval requests)
* Internal work amount (The amount approved in approval requests)

“Update Source Process ID” and “Information of budget to be updated” are not directly needed for update processing.

* when you search the history of the implementation budget etc.
* when you want to know which approval request has updated the master

, that information will be required.

<The code of Script Task of the remaining budget information master updating>

var fileName = "m738-remaining-budget-info";
var cost = data.get("q_cost");                  // Approved external payment budget amount
var internalCost = data.get("q_internalCost");  // Approved internal work budget amount
var selects = data.get("4");  // Remaining budget information master for updates
var select = selects.get(0);  // Specified execution budget
var targetId = select.getValue();
selects = data.get("5");  // Remaining (source) budget information for execution
select = selects.get(0);  // Remaining (source) budget information for specified exection 
var targetCosts = new String(select.getDisplay()).split("|:|");
var targetCost = targetCosts[0];         // Current external payment budget amount
var targetInternalCost = targetCosts[1]; // Current internal work budget amount
var items = itemDao.findAll(fileName, true); // Load remaining budget information master
var values = "";
var displays = "";
var result = "Problem";

for (var i=0; i < items.size(); i++){
 	if (items.get(i).getValue() == targetId){
 		values += items.get(i).getValue() + "\n";
 		displays += (targetCost - cost) + "|:|" + (targetInternalCost - internalCost) + "\n";
 		// minus amount check of remaining budget
 		if (((targetCost - cost) >= 0)&&((targetInternalCost - internalCost) >= 0)){
			result = "No Problem";
		values += items.get(i).getValue() + "\n";
		displays += items.get(i).getDisplay() + "\n";

values = values.slice(0, -1);     // Delete last newline
displays = displays.slice(0, -1); // Delete last newline


== Description for Sample Process Model of Approval Requests (Supporting Collaboration with Process Model for Budget Updates) ==

If the process model matches the interface of the message start event of the process model for budget update, there is no problem.
You can find various samples in Workflow Sample.
In particular, the approval request sample of Starter Template pre-installed in Questetra BPM Suite Free SaaS is recommended.

Episode 462: Planning – Approval (Starter Template)
I’m going to consider “Basic Business Pack” of the 2016 edition.
This time I will introduce a simple “approval flow”, the first of the series.
an employee submits a plan and
his/ her superior approves it.
That’s what it’s all about.


It is enough configuring the following settings for the sample process.

* Interface setting of the message start event of the process model for budget update
* Creation of application process for selecting the target budget and inputting amounts of external payment / internal work
* Use budget information master and Options-XML of remaining budget information master as the process data items of the target budget

As for [Creation of application process for selecting the target budget and inputting amounts of external payment / internal work], using JavaScript enables you to input more conveniently.

For example, we can consider an implementation such as displaying the remaining budget when you select the scheduled implementation budget / comparing the entered budget amount with the remaining budget.

<Budget Selection in Approval Request Screen / Video on input>

<Select budget / Check Input JavaScript Code Sample>

<!--■ Display remaining amount of target budget ■-->
<td>Remaining budget for external payment:</td><td><div id="cost"></div></td>
<td>Remaining budget for internal work:</td><td><div id="internalCost"></div></td>
<!--■Up to here■-->
<script type="text/javascript">
(function (){
    function ParentAndChildSelectByName(){
        this.ini = function(parent, child){
            var parent_obj = null;
            var child_obj = null;
            var child_html = null;

                if(jQuery(this).attr('name') == parent){
                    parent_obj = jQuery(this);
                if(jQuery(this).attr('name') == child){
                    child_obj = jQuery(this);
                    child_html = jQuery(this).html();
            if(parent_obj && child_obj){
                        var prefix = jQuery(this).val();
                            var val = jQuery(this).attr("value");
                            if(val.indexOf(prefix, 0) != 0){
                    }catch (e) {
                    var costs = child_obj.text().replace(/\s+/g, "").split("|:|");
    (new ParentAndChildSelectByName()).ini("data[24].selects", "data[25].selects");
        var remainingBudget = jQuery('#cost').text();
        if ((remainingBudget - jQuery(this).val()) < 0){
            alert("External payment amount exceeds the remaining budget");
        var remainingInternalBudget = jQuery('#internalCost').text();
        if ((remainingInternalBudget - jQuery(this).val()) < 0){
            alert("Internal work amount exceeds the remaining budget");

※ Implemented in the description field of Process Data Item [Execution Target Budget]

== Afterword ==

I’m sorry for writing such a long entry.
The content I described in here could be done with the two blog posts I wrote in the past. (See below)
We recommend checking both of them together with this article.

As shown above, the utilization/update of each budget information master is not very difficult.

The most important thing to keep in mind is [Designing the budget master].

The question “What kind of budget type / configuration do you want to manage?”

is the key of these processes.

We think that smooth implementation can be accomplished if you decide the range you want to manage in advance

Please consider its use or improvement.
Please feel free to contact us for any consultations when considering them.

Implement Customer Master using Options-XML (Part 2)
I think that to “Manage customer master data” involves the following two things:
* (Correctly) Add customer master.
* (Correctly and easily) Modify customer master.
“Add customer master” means “Not adding if a registered customer master exists”.
“Modify customer master” means “Modify customer master in order not to make mistakes” “Modify customer master based on existing data”.
In addition to these requests, it seems that it requires meeting the general business rule for adding/modifying a master, “Registering addition/modification after approval and confirmation”.


Trouble-free! How to Perform an Options-XML Update?
Then, improve “Options-XML Updating Procedure” and make it more convenient!
* Making it more convenient
Without downloading/uploading shared files, perform automatic updates by inputting updates.
* Improve
Avoid reversals as much as possible even when multiple administrators do updates asynchronously.


About Masato Furukubo

Questetra, Inc. Sales Department
View all posts by Masato Furukubo

Prev article - 50. Questetra Tips How to Upload and Download Files to and from kintone
Next article - 50. Questetra Tips Analyzing the content of Email, Auto-setting based on it (Part 1)
Another article - Masato Furukubo How to Change Filenames Automatically following the Rule