Sending Multiple Named Records

To send multiple records, each with its own name, pass them as arguments to the Workflow.callMethod() method. The following example passes a boolean as a third argument:

var employeeRecord = this.prgFormWizard_employeeForm.getOutboundRecord(); var parkingRecord = this.prgFormWizard_parkingForm.getOutboundRecord(); try { Workflow.callMethod('AbSolutionsViewExamples-LogicExamples-saveEmployeeAndParking',
employeeRecord, parkingRecord, this.requiresParking); } catch (e) {
Workflow.handleError(e); }

File: solutions/programming/form/ab-ex-prg-form-wizard.js

The workflow rule declaration contains the same list of parameters:

public void saveEmployeeAndParking(DataRecord employeeRecord, DataRecord parkingRecord, boolean requiresParking)
{ ...

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, passing the records as named properties of a parameters object:

var requestRecord = this.requestForm.getOutboundRecord();
var orderRecord = this.orderForm.getOutboundRecord();
try {
Workflow.call('AbSolutionsViewExamples-saveRequestAndOrder', {
request: requestRecord,
order: orderRecord

});
} catch (e) {
Workflow.handleError(e);
}

The workflow rule Java code can get the record by calling the method context.getParameter():

String requestRecord = (String) context.getParameter("request");