afv-library/skills/building-omnistudio-callable-apex/examples/Test_VlocityOpenInterfaceConversion/MyCustomVlocityOpenInterface2.cls
sandipkumar-yadav 37aa84df42
feat: @W-22444026@ Introducing Core Skills, Datacloud Skills, Industries and Utility Skills. (#268)
* 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>
2026-05-14 19:32:15 +05:30

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);
}
}