詳細情報:
Apex からの Integration Procedure の呼び出し (管理パッケージ)
管理パッケージランタイムの場合、Vlocity 管理パッケージの IntegrationProcedureService クラスを使用して、2 つの方法で Apex コードから Integration Procedure を呼び出すことができます。
この情報は、OmniStudio for Managed Packages 用です。標準ランタイムの OmniStudio については、OmniStudio ヘルプを参照してください。
Integration Procedure Call の例 1
class IntegrationProcedureService {
/*
procedureAPIName - the Type_SubType of Procedure or the OmniScript__c.Id
input - The payload / initial data in the DataJSON for the Procedure
*/
public static Object runIntegrationService(String procedureAPIName, Map<String, Object> input, Map<String, Object> options);
/*
VlocityOpenInterface2 implementation:
methodName - the Type_SubType of Procedure or the OmniScript__c.Id - procedureAPIName above
input - The payload / initial data in the DataJSON for the Procedure
output - will return Response in output.put('result', RESPONSE)
*/
public Object invokeMethod(String methodName, Map<String, Object> input, Map<String, Object> output, Map<String, Object> options);
}
Integration Procedure Call の例 2
名前空間 (vlocity_cmt または vlocity_ins) を置き換えます。
/* Initialize variables */
String procedureName = 'Type_SubType';
Map<String, Object> ipInput = new Map<String, Object> ();
Map<String, Object> ipOutput = new Map<String, Object> ();
Map<String, Object> ipOptions = new Map<String, Object> ();
/* Populating input map for an Integration Procedure.
Follow whatever structure your VIP expects */
String orderId = '80100000000abcd';
ipInput.put('orderId', orderId);
/* Call the IP via runIntegrationService,
and save the output to ipOutput */
ipOutput = (Map<String, Object>) namespace.IntegrationProcedureService.runIntegrationService(procedureName, ipInput, ipOptions);
System.debug('IP Output: ' + ipOutput);

