How to Let a Robot Nominates Translators Randomly (1)

Introducing a method to randomly designate from users belonging to a specific organization using Add-on XML.

Hi, there!

“Automation of Business Process” is a hot topic. (Again, the same words I began with.)
I mentined in the last article that

Method of Letting a Robotty(?) Start Processes Every Other Week
When an application equipped with RPA passes entered information to the robot, the robotty will manipulate as just the way as a human being operates, and produce results. It is very convenient. I wish that there were twenty of robotty…

https://www.questetra.com/blog/cat-questetra-tips/start-every-other-week/

Today, I would like to show you a little bit smarter robot.

(I am going to write series about this.)

When, where and How do You Ask Robot to Help You?

This time, I am going to explain based on the translation flow below.
<Translation flow: Not using Robot>

* Original article: “Episode 538: Analyzing Time Required for Translating 100 Characters in Japanese”

There is a Step of “2. Translator designation” in this Translation flow.
If there was a rule that was

* Designate randomly within translation team

for the designator, he or she might think “I forgot whom I asked the last time” or “It’s cumbersome effort to draw for deciding who does it“.
And for the person to be designated, he or she might be suspicious thinking “Isn’t it too often that I am designated?“.

Let a robot handle that part.

Implement Robot with Add-on XML (Auto-processing package)

Specification of robot

The behaviors of the robot are;

1. Find the number of people and the individuals in the organization you want to specify
2. Generate a random number out of one less numbers of the number of the people of 1.
3. Store the person (obtained in1.) of nth (number obtained in 2.) into a User type Data Item

For example,

* People belong to Translation team are Jack, Betty, Joe, and Sue.
* The number generated randomly out of between 0 and 3 is “2”.
* Joe, who is the 2th (counting from 0), is stored into User type data

Implementation of robot

Since it seems that it can be used in other App, so I am going to implement it with Add-on XML.

<Content of configuration of the package>
* Actual organization name that corresponds to “Translation team”
* User type Data Item in which designated User to be stored

Implement an Add-on XML which is capable of both of above configurations and the behavior of “specification of robot ” described above.

<Codes in Add-on XML for “Random nomination“>

<?xml version="1.0" encoding="UTF-8"?><service-task-definition>

<label>Random nomination</label>

<configs>
  <config name="conf_TargetOrganizationName" required="true" form-type="TEXTFIELD">
    <label>Target organization</label>
  </config>
  <config name="conf_TargetQUser" required="true" form-type="SELECT" select-data-type="QUSER">
    <label>Designated user</label>
  </config>
  <config name="conf_DebugPrint" required="false" form-type="SELECT" select-data-type="STRING_TEXTAREA">
    <label>Data indication for debugging (No-display if not specified)</label>
  </config>
</configs>

<script><![CDATA[
// Script for random nomination (ver. 20170801)
// (c) 2017, Questetra, Inc. (the MIT License)

//// == Config Retrieving ==
var targetOrganizationName = configs.get("conf_TargetOrganizationName");
var targetQUserNum = configs.get("conf_TargetQUser");
var debugPrintNum = configs.get("conf_DebugPrint");

//// == Data Retrieving, Data Define ==
var targetOrganization = qgroupDao.findByName(targetOrganizationName);
var targetQuserList;
var targetNum;
var debug = "";

//// == Calculating ==
// Retrieve users list from target organization, designate with random number

// Retrieve user group in target organization
targetQuserList = quserDao.findByQgroup(targetOrganization);
// Randomly generate a numerical value between "0" and maximum value (number of people in target user group)
targetNum = Math.floor(Math.random() * targetQuserList.size());

debug += "targetQuserList.size():" + targetQuserList.size() + "\n";
debug += "targetNum:" + targetNum + "\n";

// for Debug
if (debugPrintNum != ""){
    retVal.put(debugPrintNum,debug);
}

//// == Data Updating ==
retVal.put(targetQUserNum,targetQuserList.get(targetNum));
]]></script>


<icon> (omitted) </icon>

</service-task-definition>

Even though it is difficult to understand the code of randomly generated values, I would like you to check the specifications of Math.random () and Math.floor ().
With this, you no longer be bothered for thinking “Whom should I let …

Closing

Simply speaking, it automates “randomly picking people out of specific organizations (impartially to a certain extent?)“.
Even though you may say “nonsense“, but if you can imagine that you have to do such designating tasks so many times on a day, won’t you feel a little useful value in it?
It is also an Add-on which is actually being used by companies of the customer of Questetra. (Though some arrangement has been given…)
I hope that you give a try it once.

Next time I would like to introduce you a robot who will do a more difficult job.
If you have any questions, please feel free to contact us.

The necessary manual for implementing Add-on XML is as follows.
Please refer to it together.

Create your own Auto-Step for Business Process Definition
If you want to automate a Processing-step, such as “Obtaining Number of characters and Hash value”, you need to write Scripts using [Script Task]. If you need to use the same [Script Task] in different places, you should consider packaging the Script as a [Addon XML]. (Service-Task Addon)

https://www.questetra.com/tour/m4/m416/

Auto Executing Complicated Data Processing (ECMAScript)
By placing a Script Step in the middle of the Workflow diagram, data editing by ECMA Script is available. You can automate processing of string editing, for example, calculating the working hours between “Attendance time” and “Quitting time” or, automatically adding the day of the week information to the ‘Operation date’. (You can achieve a more complicated processing, than by “ServiceTask (data assignment)”.)

https://www.questetra.com/tour/m2/m230/

2017-08-08

About Masato Furukubo

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

Recommendations
Prev article - 50. Questetra Tips How to Cooperate between Office 365 and Cloud Based Workflow
Next article - 50. Questetra Tips How to Let a Robot Nominates Translators Randomly (2)
Another article - Masato Furukubo How to Automatically Rewrite Dates that fall on National Holidays

Archive

 RSS