Converting a particular "Business data"
Retrieving the number of characters as a property of a particular "Business data"
Basically, a "Workflow system" automates "transactions" of Business data. I want to automate not only "transactions", but also "Tasks themselves" as far as possible.(To be unmanned) Especially, for "Mechanical routine"...
In "Questetra BPM Suite", a Cloud-based Workflow, using a feature of Auto-Step which has equipped originally, it is capable of server side processing, such as
- To combine String A and String B (M227)
- To sum Numeric A and Numeric B (M227)
- To generate PDF file embedding strings to a Template PDF (M228)
- To back up files tin Google Drive (M229)
However, it won't do for a "Processing that is more unique" even a little bit.
The "Character number counter" in the following Workflow is an automated Step that is, for example, to count the number of characters in String type data of X which has been entered at upstream Step, and to store the number into a Numeric type data item. (All done on the Server side) For such a case, you need to place a versatile Step which is referred to as [Script Step] (Script Task: M230), and to set a Script (ECMA-Script/JavaScript) into it. (as of version 11.0)
[Character Number Counter]
[Character Number Counter:"1. Document Set" screen]
The Script to be set here will be very short. It could be simple like
var countA = myText.length;if you imagined "part of counting characters" concretely. However, there might be uneasy cases where it should be counted as how many characters, in realistic business. It greatly differs according with its industry or business culture.
- Reviewing of a treatise
- Calibration on HTML
- Reviewing on program
- Reviewing on draught of press release
For example, how many should be the number of characters of the following strings counted as? (Showing double byte space as "_" for convenience)
1234567890 12345678 0 12345678_0 1234567 _0
In many businesses, "line break" is not considered as a character. In some business, "Line-breaks or Consecutive spaces, etc., which entered for the legibility," are considered should not be counted as characters. For a draught in Japanese, "double byte spaces" and "single byte spaces" might be considered not to be counted.
After all, you need to determine "How to count characters" of your company beforehand.
= Setting Sample for Script Step "Character Number Counter" (Server side JavaScript)
//// == Retrieving == var myText = data.get("q_mytext") + ""; // JavaScript String //// == Calculating == var countA = myText.length; var countB = myText.replace(/\r|\n/g, "").length; var countC = myText.replace(/\r|\n/g, "") .replace(/\s+/g," ").length; var countD = myText.replace(/\r|\n/g, "") .replace(/\s/g,"").length; // Note) Tab and double byte space are included in "\s" (UTF-8) //// == Updating == retVal.put("4", java.math.BigDecimal( countA ) ); retVal.put("5", java.math.BigDecimal( countB ) ); retVal.put("6", java.math.BigDecimal( countC ) ); retVal.put("7", java.math.BigDecimal( countD ) );
= Example of implementation of "Character Number Counter" on the Browser side (HTML/JavaScript)
<span id="myCounter">0</span> <script type="text/javascript"> jQuery('textarea[name="data[0].input"]').bind('keyup change',function(){ var myTextLength = jQuery(this).val().length; jQuery('#myCounter').html( myTextLength ); }); </script>
[Data Items list]
[Free Download]
- Business Template: Character Number Counter
- Episode 479: Cautions for Letting "Prorating" to Script Step (2016-04-18)
- Not Directly Modify Expense Paid Data! (2015-05-11)
- Platforming the Translation Workflow (2015-04-13)
- M415 AUTOMATED STEP: Adding of Auto-Step which to be Utilized for Business Process Definition (Modeling)
- M230 AUTOMATED STEP: Auto Executing Complicated Data Processing (ECMAScript)
- M401 BUSINESS FLOW: Setting: Separate the Steps of Application from Reworking for the sake of Easy Monitoring
[Japanese Entry (εζθ¨δΊ)]