Script Steps, Carefully Plan Them!

Monday, May 25, 2015
Requesting an answer (0-100) about the "Project progress" to four people at the most.

For staffs of the Internal Audit department who conduct investigation all over every week, they would think 'I wish at least the calculations for "the average value of progress" to be automated'.

In the following Workflow, a mechanism (Script Step) of auto-calculation of 'the average' upon the completion of answering by the Rapporteurs (1-4 people), is devised. (Moreover, it is equipped with an automatic sending of email addressed to the concerning officers when the progression average was more than 90%.)

The "Automation of In-house situation awareness" like this would also contribute to the strengthening of the quality control system, not only to the operational efficiency. (for the Contracting business, the Construction business, etc.)

[Progress Report Process Auto-calculation]

[Sample Script of Ave. calculation]
//// == Retrieving ==
var scoreA = data.get("10"); // 0-100 Numeric type
var scoreB = data.get("11"); 
var scoreC = data.get("12"); 
var scoreD = data.get("13"); 

//// == Calculating ==
var scoreNum = 0;
var scoreSum = 0;

if (scoreA != null) {
  scoreNum ++;
  scoreSum += scoreA - 0; 
//  scoreSum += scoreA.intValue();  is also available
if (scoreB != null) {
  scoreNum ++;
  scoreSum += scoreB - 0; 
if (scoreC != null) {
  scoreNum ++;
  scoreSum += scoreC - 0; 
if (scoreD != null) {
  scoreNum ++;
  scoreSum += scoreD - 0; 

//// == Updating ==
retVal.put("14", new java.math.BigDecimal( scoreSum/scoreNum + 0.005)); 

The content of the automated calculation of [Avg.], the Script Step, is not so difficult.

If three numeric fields are input, the sum will be divided by 3. As the same, if four fields, by 4. More specifically;
  1. Respectively for four of the numeric fields, if a value was input, add it to "the sum", and add 1 to the "number of data", and iterate this.
  2. Finally, it assigns the value which "the sum" is divided by "the number of data" into "the average of progress in subjective".

However, the discussion about whether this scripting is simple or not is profound.

For example, Excel files which so many complicated functions have been set, might exist as many as the stars above, in this world. But, some people would say these are simple, whereas, some other people would say these are not simple. In fact, I often encounter "Excel files that no one can maintain anymore".

Although Script step is a very convenient mechanism to achieve the unmanned business process, you should use it with sufficient consideration about the IT literacy and the training system of your organization or team.

[Progress Report Process Auto-calculation:'1. Rapporteur Designation' screen]

[Data Items list]

[Free Download]
<Similar Models>
<<Related Articles>>

[Japanese Entry (ε’Œζ–‡θ¨˜δΊ‹)]