Loading
可调用实施

可调用实施

Vlocity Apex 类和 Omniscript 远程操作和集成程序支持可调用接口。

虽然 VlocityOpenInterfaceVlocityOpenInterface2 接口支持使用统一签名的灵活实施,但它们驻留在 Vlocity 受管软件包中,不是真正的 Salesforce 标准。但是,实施 VlocityOpenInterfaceVlocityOpenInterface2 的类也实施可调用接口,这是一个 Salesforce 标准。

此外,Omniscript 的远程操作和集成程序可以调用任何实施 Callable 的类,无论它是实施 VlocityOpenInterface 还是 VlocityOpenInterface2。对于实施任何这些接口的类,您可以以同样的方式指定远程类远程方法其他输入属性。

要将实施 VlocityOpenInterfaceVlocityOpenInterface2 的自定义类更改为可调用实施,请使用几行代码转换签名:

global with sharing class ClassName implements Callable
{
    public Object call(String action, Map<String, Object> args) {

        Map<String, Object> input = (Map<String, Object>)args.get('input');
        Map<String, Object> output = (Map<String, Object>)args.get('output');
        Map<String, Object> options = (Map<String, Object>)args.get('options');

        return invokeMethod(action, input, output, options);
    }
    private Object invokeMethod(String methodName, Map<String, Object> inputMap, Map<String, Object> outMap, Map<String, Object> options) {
        ...
    }
    ...
}

有关完整示例,请查看使用 Omnistudio.OmniContinuation 进行长时间远程调用。

 
正在加载
Salesforce Help | Article