mirror of
https://github.com/forcedotcom/afv-library.git
synced 2026-07-30 11:19:27 +08:00
* Migrating Core Salesforce Skills * Updating pr comments * updat reference * Updating a skill * Migrating Datacloud skills * Migrating Industries cloud skills * Validating - skills fixing --------- Co-authored-by: Sandip Kumar Yadav <sandipkumar.yadav+sfemu@salesforce.com>
23 lines
799 B
OpenEdge ABL
23 lines
799 B
OpenEdge ABL
global class MyCustomClass implements vlocity_cmt.VlocityOpenInterface {
|
|
|
|
global Boolean invokeMethod(String methodName, Map<String, Object> inputs,
|
|
Map<String, Object> output, Map<String, Object> options) {
|
|
|
|
if (methodName == 'calculateTotal') {
|
|
calculateTotal(inputs, output);
|
|
}
|
|
return true;
|
|
}
|
|
|
|
private void calculateTotal(Map<String, Object> inputs, Map<String, Object> output) {
|
|
// Retrieve inputs from OmniScript/IP
|
|
Decimal price = (Decimal)inputs.get('Price');
|
|
Integer qty = (Integer)inputs.get('Quantity');
|
|
|
|
// Perform calculation
|
|
Decimal total = price * qty;
|
|
|
|
// Return result to JSON
|
|
output.put('TotalAmount', total);
|
|
}
|
|
} |