How to Let a Robot Nominates Translators Randomly (2)

I will show you a method to randomly designate a person who matches search criteria using Add-on XML / Options XML information out of a group of users.

Hi, there!

“Automation of Business Process” is a hot topic. (Again, the same words I began with.)
As declared, I am writing this in series.

This time, I would like to introduce you a smarter robot than before.

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

The part the robot to help is the same as before. (Step of “2. Designate”)

<Translation flow: Using a robot>

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

Although it was made a rule that “Designate randomly within translation team”, skills of translating might be different by the person, such as languages that one is capable of doing.
That is, for example, there may be a person who is capable of translating “(original) Japanese into French”, but not “(original) Japanese into English”.

If the rule is simply “to designate randomly”,
for the designator, he or she will be bothered for worrying “Who can translate Japanese – French?”, or “Whom should I request next time, for maintaining fairness?”.
And for the person to be designated, he or she might be troubled that “Even though I am designated, I’m not capable of Japanese – French.”

In such cases, the robot is no longer helpful.

As a summary of the rule of translator designation, it will be

*”Designate a translator randomly out from a group of who are capable of translating specified languages.

So, a robot will be able to designate a proper translator by inputting

* Translation language pattern (original – translation)
*Information about language capability of target users”

instead of “Translation team”.

Let a robot doing works in above rule.

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 who are capable of translating specified language pattern
2. Generate a random number out from one less of the number of the people of 1.
3. Store the person (obtained in 1.) of the nth (number obtained in 2.) into a User type Data Item

I will also implement it with Add-on XML this time, but the following settings are necessary as preparation.

* Enable to specify translation language pattern
* Prepare a user information list on which it can search specified translation language patterns

For “user information list that can search specified translation language patterns”, it would be better to use option XML in consideration of maintainability.

The following figures are examples of settings to realize.

<Add Data Items to specify “Language pattern” at the Step of “1. Request translation”>

<User information list on which it can search specified translation language patterns (Options XML)>

<items>
  <item value="b-james@example.com" display="Japanese→English|:|English→Japanese|:|Japanese→French|:|apanese→Chinese|:|Japanese→Spanish|:|Japanese→Portuguese" />
  <item value="jbrown@example.com" display="English→Japanese|:|Japanese→French" />
  <item value="sueJ@example.com" display="Japanese→English|:|English→Japanese|:|Japanese→French" />
  <item value="joes@example.com" display="English→Japanese|:|Japanese→Chinese|:|Japanese→Spanish" />
</items>

* value: Email address of Questetra user
* display: language pattern on which user of “value” is capable of
(Use “|:|” as a delimiter when more than one patterns.)

Implementation of robot

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

<Content of the configuration of the package>
* User type Data Item to store the designated user
* Master name of Options XML which stores attribute information of target users
* Matching-word of Language pattern to be searched in attribute information (Select type Data Item)

Configure Add-on as above figure so that implement the behaviors mentioned in “Specification of robot”.

<Codes in Add-on XML for “Designation (by Random + Master search)”>

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

<label>Designation (by Random + Master search)</label>

<configs>
  <config name="conf_TargetQUser" required="true" form-type="SELECT" select-data-type="QUSER">
    <label>Designated User</label>
  </config>
   <config name="conf_MatchingWord_QUserMasterName" required="true" form-type="TEXTFIELD">
    <label>Master name of matching-word compatible user list</label>
  </config>
  <config name="conf_MatchingWord" required="false" form-type="SELECT" select-data-type="SELECT_SINGLE">
    <label>Matching-word</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 Designation (by Random + Master search) (ver. 20170804)
// (c) 2017, Questetra, Inc. (the MIT License)

//// == Config Retrieving ==
var targetQUserNum = configs.get("conf_TargetQUser");
var matchingWord_QUserMasterName = configs.get("conf_MatchingWord_QUserMasterName");
var targetMatchingWordNum = configs.get("conf_MatchingWord");
var debugPrintNum = configs.get("conf_DebugPrint");

//// == Data Retrieving, Data Define ==
// Retrive list of Options XML for search
var matchingWord_QUserList = itemDao.findAll(matchingWord_QUserMasterName,true);
var matchingWord = null;
if (targetMatchingWordNum != ""){
	matchingWord = data.get(targetMatchingWordNum).get(0).getValue();
}
var matchingList = new Array();
var targetQuserList;
var targetNum;
var debug = "";

//// == Calculating ==
var j = 0;
for (var i=0; i < matchingWord_QUserList.size(); i++){
	if (matchingWord != null){
		// Retrieve elements that matches to Matching-word from the list
		if (matchingWord_QUserList.get(i).getDisplay().indexOf(matchingWord) != -1){
			matchingList[j] = i;
			j++;
		}
	// if "matching-word" is not specified, set all the contents of Options XML
	}else{
		matchingList[j] = i;
		j++;
	}
}
// Extract one randomly from the target list
targetNum = matchingList[Math.floor(Math.random() * matchingList.length)];

for (var i=0; i < matchingList.length; i++){
	debug += "matchingList[" + i + "]:" + matchingList[i] + "\n";
}
debug += "matchingList.length:" + matchingList.length + "\n";
debug += "targetNum:" + targetNum + "\n";

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

//// == Extract one randomly from the target list Data Updating ==
retVal.put(targetQUserNum,quserDao.findByEmail(matchingWord_QUserList.get(targetNum).getValue()));
]]></script>

<icon>(omitted)</icon>

</service-task-definition>

Searching the Language pattern specified in the Data Item of “Translation type” (matching-word) out from “display” in the Options XML of “traslationSkillList” and create a list.
Then it randomly designates a person out from the created list and set the “value” (email address) to User type Data Item of “Translator”.
An example of its operation is as follows.

<Step of “1. Request translation”>
* Select “Japanese→English” in “Translation type”<Step of “2R. Rondam nomination”>
1. Search for “Japanese→English” in “display” element on Options XML of “traslationSkillList”
2. “b-james@example.com”, “sueJ@example.com” are extracted from “value” elements
3. “sueJ@example.com” is selected by random selection
4. “Translator”, the User type Data Item, is set based on “sueJ@example.com”

Closing

Don’t you think it has become a little bit smarter robot than before?

It can also be considered to be used generically.
Besides “Designate by automatically filtering by ‘translation skill'” as this time, it can be used for

* Allocate Issues according to with “Specialized IT knowledge”
* Select a purchasing personnel by “product who is knowledgeable”
* Allocate a sales staff by “familiar with the company”
* Allocate a sales personnel “who knows well industry knowledge”

etc.
The add-on XML “Designation (by Random + Master search)” can be used as it is if it is a business process in which allocations that I mentioned above exist, as long as an Option XML is prepared.

In consideration of more versatile use, it is implemented so that,

* if “matching-word” is not specified, it is possible to select a designating user out from all users on the Options XML set at “Master name of matching-word compatible user list”.

If you have any questions, please feel free to contact us.

It uses the Options XML feature as the judgment information. So referring to the following manual will be also helpful.

Register an Options-XML file to which the Process Model Definitions Refer to
Select type data of Data items definition requires “Candidate list” to be set. If the target List was registered to the system by a User with [System Administrator Authorization], it allows setting of referring from each App. More efficiency of modeling, or centralized management of candidate list will be achieved.

https://www.questetra.com/tour/m3/m319/

2017-08-22

About Masato Furukubo

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

Recommendations
Prev article - 50. Questetra Tips How to Let a Robot Nominates Translators Randomly (1)
Next article - 50. Questetra Tips Several Ways to Manage Master Data with Questetra
Another article - Masato Furukubo How to Monitor Asynchronous System Connectivity

Archive

 RSS