Output Necessary Items out of Expense Paid Data in Table Type into CSV

Monday, May 4, 2015
There would never be a Workflow that is suitable for [Table type data] other than "Expense reimbursement claim flow".
  • There would be an "Input format" in each company,
  • "Number of applications" would differ according to the department and personnel.
[Table type data] which allows you to design columns as much as you want, and is capable of accepting data entry in any number of lines, is a strong ally for a Business Process designer. In short, you can design "variable-length data" easily.

However, on the other hand, it might be a trouble for the people who aggregate the business data. That is, 'The format is not so for the aggregation!'

In the following Workflow, data shaping will be carried out automatically before the end of it. That is from the idea of creating data which is more accessible in the 'next operation' separately. Though, in formatting case like this, [Script Step] is inevitable. (Programming knowledge helps yourself)

[Expense Reimbursement Claim flow-CSV Generation]



In this Business Process, "CSV text" will be automatically generated in the last part of the flow.

It is very efficient when an accounting personnel to paste data into Excel, etc. because;
  • Data of column 1, 2, 4, 5, in Table type
  • ID of belonging Organization
  • Email address of applicant
are listed conveniently.

When aggregating the tabular data of this kind, common data such as "ID of belonging Organization" or "Email address of applicant" are tend to be missed. Speaking from the applicants, it seems nonsense that inputting the "Name of Organization" and "Email address of own" into each every line.

However, speaking from who aggregates, they need to conduct analysis such as 'How much is the travel expense of the entire company?' or 'How much is the total entertainment expense in the Sales department?', by decomposing all of the expense record.

Even for the same information, it should be processed by the way of appearance and arrangement, in accordance with the information utilization personnel. The efficiency of the business operation will be further improved, if the designer has this in mind when designing a Business Process.

[Expense Reimbursement Claim flow-CSV Generation:'1. Application' screen]

[CSV Generation setting screen]

[Sample Script of CSV Generation]
//// == Retrieving ==

// mytable: com.questetra.bpms.core.model.formdata.ListArray
var mytable = data.get("5"); // Retrieving Table type data

// employee: com.questetra.bpms.core.event.scripttask.QuserView
var employee = data.get("1"); // Retrieving User type data

// div: com.questetra.bpms.core.event.scripttask.QgroupView
var div = data.get("2"); // Retrieving Organization type data


//// == Calculating ==
divId = div.getId();
employeeMail = employee.getEmail();

// Date, Organization, Applicant, Items, Payee, Amount
var i=0;
var n = mytable.size();
var textcsv = "";
var texttsv = "";

for (i=0; i<n; i++){
textcsv += mytable.get(i, 0) + ", ";
textcsv += divId + ", ";
textcsv += employeeMail + ", ";
textcsv += mytable.get(i, 1) + ", ";
textcsv += mytable.get(i, 3) + ", ";
textcsv += mytable.get(i, 4) + "\n";

texttsv += mytable.get(i, 0) + "\t";
texttsv += divId + "\t";
texttsv += employeeMail + "\t";
texttsv += mytable.get(i, 1) + "\t";
texttsv += mytable.get(i, 3) + "\t";
texttsv += mytable.get(i, 4) + "\n";
}


//// == Updating ==
retVal.put("19", textcsv ); 
retVal.put("20", texttsv ); 

[Generated CSV/TSV data]

[Data Items List]


[Free Download]
<Similar Models>
<<Related Articles>>
[Japanese Entry (ε’Œζ–‡θ¨˜δΊ‹)]