/** * System.Callable skeleton — same inputMap/options structure as VlocityOpenInterface. * Use when integrating with Open Interface callers or when callers pass { inputMap, options }. * Backward-compatible: if args lacks 'inputMap', treats args itself as inputMap. * * Replace Industries_XxxCallable and actionOne with the actual class/action names. */ public with sharing class Industries_XxxCallable implements System.Callable { public Object call(String action, Map args) { Map inputMap = (args != null && args.containsKey('inputMap')) ? (Map) args.get('inputMap') : (args != null ? args : new Map()); Map options = (args != null && args.containsKey('options')) ? (Map) args.get('options') : new Map(); if (inputMap == null) { inputMap = new Map(); } if (options == null) { options = new Map(); } switch on action { when 'actionOne' { return actionOne(inputMap, options); } when else { throw new IndustriesCallableException('Unsupported action: ' + action); } } } private Map actionOne(Map inputMap, Map options) { // 1. Validate required keys from inputMap // 2. Coerce types safely // 3. Run business logic (SOQL with WITH USER_MODE, DML with sharing) // 4. Return response envelope return new Map{ 'success' => true, 'data' => new Map() }; } }