Retrieving One Record
Retrieving One Record
To get a single record from the workflow rule
result
use
result.dataSet
:
var result = Workflow.callMethod( 'AbSolutionsViewExamples-LogicExamples-getRecordByPrimaryKey', woId); var woRecord = result.dataSet; if (woRecord) { this.cookbookWorkOrderForm.setRecord(woRecord); this.cookbookWorkOrderForm.show(true); }
File: solutions/logic/ab-ex-logic-cookbook.js
The workflow rule returns the single record:
public DataRecord getRecordByPrimaryKey(String woId) {
...
DataRecord record = ds.getRecord();
return record;
}
File: src/main/com/archibus/eventhandler/viewexamples/LogicExampleHandlers.java
If the workflow rule is not defined using class-level security, then the Java Script code uses the
Workflow.call()
method:
var record = Workflow.call('AbSolutionsViewExamples-getNextRequest',
{...any parameters...});
this.requestReport.setRecord(record);
The workflow rule Java code can attach the record to the WFR response by calling the
EventHandlerContext.setResponse(DataRecord record)
method.