Last updated Sep 15, 2017

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)


a. Aspect of IT Skill Requirments (Compared with Script Task)
A Flow Designer who does not have Script knowledge should be capable of promoting the automation of the process, as well
b. Aspect of Modeling Cost (Compared with Script Task)
There will be no need to write the same Script again and again
  • It can be considered a responsibility in the boundary between the IT Department and the Process owner
  • Go to M415 for more info on how to import a preexisting [Addon XML]
  • Go to M416 (Bottom of this page) or to “Download” in M415 for Sample codes

a. Aspect of Output of the Auto-step
e.g.: Contents of Data to be stored, Contents of Auto-operation of external system, etc.
b. Aspect of Input of the Auto-step
e.g.: Business data to be inspected, Data name in external system to retrieve, etc.
  • Name of Auto-step (Service Task) is defined in <label> element
  • Sample of a: <label>Random Number Generator</label>
  • Sample of b: <label>Weather Info Getter</label>

a. Business Data Items which are to be referred by the Step (SELECT)
e.g.: To write to Data A, To read Data B. etc.
b. Fixed Values used in the Step (TEXTFIELD, TEXTAREA)
e.g.: Maximum value: “100”, Status:This Draft is on the stage of not yet approved, etc.
  • Enumerate Configuration Items with <config> which is a child element of <configs>

R4160 Addon-XML Attributes of config element

1. Write a Server-side Script
Write in ECMA code available in Script Step (M230)
  • Knowledge of ECMAScript (JavaScript) is required
  • Parts of Java class are also available
  • Use special methods of configs.get("♦configName♦") for retrieving config
  • configs.get("♦configName♦"): instanceof java.lang.String
  • Use special methods of data.get( ♦dataId♦ ) for retrieving Business Data (M230)
  • Use special methods of retVal.put( ♦dataId♦, ♦value♦ ) for updating Business Data (M230)
var dataItemId = configs.get("conf_updateDataItem"); 
retVal.put( dataItemId, "Hello World" );

R2300 Functions available in Script

1. Prepare an Image File
Prepare a Image file of less than 64px (JPEG, GIF, PNG only)
2. Encode to Base64
Use Converter software or web service for it
  • Define using the icon data<icon> element
  • The Logo will be displayed upon placement using Drag&Drop

1. Add label elements with the locale attribute
Add <label> for as many languages as you need for your Workflow Designers
  • e.g.: Configure <label locale="ja">Generador de Numeros aleatorios</label> for Spanish Designers
  • en(default), ja, de, es, fr, ko, pt, zh_CN



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

<label>Random Number Generator</label>
<label locale="es">Generador de Numeros aleatorios</label>

 <config name="conf_MaxNum" required="true" form-type="TEXTFIELD">
 <label>Set MAX NUMBER (100 returns 0 - 99)</label>
 <label locale="es">Establece el numero maximo (100: 0 - 99)</label>
<config name="conf_UpdateDataId" required="true" form-type="SELECT" select-data-type="DECIMAL">
 <label>Select RANDOM NUMBER DATA</label>
 <label locale="es">Seleccione unos datos de numericos que se almacena un numero aleatorio</label>

var maxNum = configs.get( "conf_MaxNum" ); 
var dataId = configs.get( "conf_UpdateDataId" ); // (returns Number)
var tmpNum = Math.random() * maxNum; // Math.random() -> 0.00 ~ 0.99
var retNum = Math.floor( tmpNum );
retVal.put( dataId, java.math.BigDecimal( retNum ) );