Workflow API Reference
Workflow API Reference
0 – 2014-09-24 PUBLIC
Example Words or characters quoted from the screen. These include field names, screen titles,
pushbuttons labels, menu names, menu paths, and menu options.
Textual cross-references to other documents.
EXAMPLE Technical names of system objects. These include report names, program names,
transaction codes, table names, and key concepts of a programming language when they
are surrounded by body text, for example, SELECT and INCLUDE.
Example Output on the screen. This includes file and directory names and their paths, messages,
names of variables and parameters, source text, and names of installation, upgrade and
database tools.
Example Exact user entry. These are words or characters that you enter in the system exactly as they
appear in the documentation.
<Example> Variable user entry. Angle brackets indicate that you replace these words and characters
with appropriate entries to make entries in the system.
2 Class ................................................................................................................................................................. 6
2.1 ExecutionEntity ........................................................................................................................................................ 6
2.2 Company .................................................................................................................................................................. 7
2.3 Recordset ............................................................................................................................................................... 10
2.4 RecordsetParams .................................................................................................................................................. 12
2.5 Field......................................................................................................................................................................... 13
2.6 GeneralService....................................................................................................................................................... 14
2.7 GeneralData ........................................................................................................................................................... 17
2.8 GeneralDataCollection .......................................................................................................................................... 18
2.9 GeneralDataParams .............................................................................................................................................. 19
2.10 GeneralCollectionParams .....................................................................................................................................20
2.11 UserFields............................................................................................................................................................... 21
3 Services .........................................................................................................................................................23
3.1 StartService ...........................................................................................................................................................23
Name:
Description:
Output the information to the workflow log file for workflow debugging purposes.
Parameter:
• Name: content
• Type: String
• Description: The string that needs to be output.
Return Value:
void
2.1 ExecutionEntity
Description:
Methods:
2.2 Company
Description:
Methods:
Method 4: RecordsetgetRecordset()
Description: Get a Recordset object.
• Return Value:
Type: Recordset
Description: The DI Recordset object in JavaScript.
• Sample Code:
var recordsetParams = company.getRecordsetParams();
var query = “select * from OITW where WhsCode = 02 and OnHand< 1000”;
recordsetParams.setQuery(query);
var recordset = company.getRecordset();
recordset.doQuery(recordsetParams);
if (0 <recordset.read()) {
......
}
Method 5: RecordsetParamsgetRecordsetParams()
Description: Get a RecordsetParams object.
• Return Value:
Type: RecordsetParams
Description: The DI RecordsetParams object in JavaScript.
• Sample Code:
var recordsetParams = company.getRecordsetParams();
var query = “select * from OITW where WhsCode = 02 and OnHand< 1000”;
recordsetParams.setQuery(query);
var recordset = company.getRecordset();
recordset.doQuery(recordsetParams);
if (0 <recordset.read()) {
……
}
2.3 Recordset
Description:
A raw data access object that enables you to select data from the database, navigate through the result set, and
manipulate user tables.
Methods:
Method 2: booleanread()
Description: Read the next record, and return true if the next record exists.
• Return Value:
Type: boolean
Description: True if the next record exists.
• Sample Code:
var recordsetParams = company.getRecordsetParams();
var query = “select * from OITW where WhsCode = 02 and OnHand< 1000”;
recordsetParams.setQuery(query);
var recordset = company.getRecordset();
recordset.doQuery(recordsetParams);
if (0 <recordset.read()) {
……
}
2.4 RecordsetParams
Description:
2.5 Field
Description:
An object contains both standard and customized data access properties, which enables you to manipulate the
field data.
Methods:
2.6 GeneralService
Description:
Methods:
Method 2: GeneralDatagetGeneralData()
Description: Get a GeneralData object.
• Return Value:
Type: GeneralData
Description: The specific GeneralData object retrieved.
• Sample Code:
var generalSerivce = company.getGeneralService(“udoService”);
var generalData = generalSerivce.getGeneralData();
var generalDataParam = generalService.getGeneralDataParam();
generalData.put(“U_name”, “SAP”);
generalData.put(“U_price”, “15”);
var childs = generalData.child(“childTableName”).add();
childs.put(“U_name”, “SAP Business One”);
childs.put(“U_amount”, “99999”);
generalDataParam = generalService.add(generalData);
var newlyAddDocEntry = generalDataParam.get(“DocEntry”);
Method 3: GeneralDataParamsgetGeneralDataParam()
Description: Get a GeneralDataParams object.
• Return Value:
Type: GeneralDataParams
Description: The parameter of the GeneralData.
• Sample Code:
var generalSerivce = company.getGeneralService(“udoService”);
var generalData = generalSerivce.getGeneralData();
var generalDataParam = generalService.getGeneralDataParam();
generalData.put(“U_name”, “SAP”);
generalData.put(“U_price”, “15”);
var childs = generalData.child(“childTableName”).add();
childs.put(“U_name”, “SAP Business One”);
childs.put(“U_amount”, “99999”);
generalDataParam = generalService.add(generalData);
var newlyAddDocEntry = generalDataParam.get(“DocEntry”);
Method 4: GeneralDatagetByParams(GeneralDataParamsparam)
Description: Get a GeneralData object by parameters.
Parameter:
Name: param
Method 5: GeneralCollectionParamsgetList()
Description: Get a collection of GeneralData objects.
• Return Value:
Type: GeneralCollectionParams
Description: The collections of GeneralData objects retrieved.
Description:
Methods:
2.8 GeneralDataCollection
Description:
Methods:
Method 1: GeneralDataadd()
Description: Add a GeneralData object to the collection.
• Return Value:
Type: GeneralData
Description: The GeneralData object added.
• Sample Code:
var generalSerivce = company.getGeneralService(“udoService”);
var generalData = generalSerivce.getGeneralData();
Method 2: voidclear()
Description: Clear all data in the collection.
• Return Value:
Type: void
Description: No return value required.
2.9 GeneralDataParams
Description:
Method:
2.10 GeneralCollectionParams
Description:
Methods:
2.11 UserFields
Description:
Methods:
3.1 StartService
Description:
Description: Retrieve an object from the conditional start event, before an instance starts.
Parameter:
Name: key
Type: String
Description:The ID of the data object defined in the .xbml workflow template.
• Return Value:
Type: Object
Description:The specific object retrieved.
• Sample Code:
varparam = company.getRecordsetParams();
var query = "select * from OITW where WhsCode = 02 and OnHand< 1000"
param.setQuery(query);
varrecordset=company.getRecordset();
recordset.doQuery(param);
var success = recordset.read() ;
if (success)
{
var field =recordset.getField(0);
varItemC=field.getColumnValue();
varobj= StartService.getStartDataObject("dataObject4");
obj.putItem("Key", ItemC);
obj.putItem("ObjType","4");
}
success >0;
Material Number