Class to invoke methods on APEX classes that implement a VlocityObjectInterface in Salesforce using the Salesforce REST API.

Hierarchy

  • VlocityInterfaceInvoker

Constructors

Properties

connectionProvider: SalesforceConnectionProvider
endPoint: "/services/apexrest/{vlocity_namespace}/v1/invoke" = '/services/apexrest/{vlocity_namespace}/v1/invoke'
logger: Logger
namespaceProvider: NamespaceService

Methods

  • Invoke a Vlocity interface method in Salesforce with the specified input and options. If the method invocation results in an exception this method will throw an error.

    Type Parameters

    • T = any

    Parameters

    • methodSpec: string | {
          className: string;
          methodName: string;
      }

      The method to invoke. Can be a string in the format 'class.method' or an object with className and methodName properties.

    • Optional input: string | object

      Input to pass to the method

    • Optional options: string | object

      Options to pass to the method

    Returns Promise<T>

    The result of the method invocation

    Example

    // Invoke a method with a string
    const result = await invoker.invoke('MyClass.myMethod', { input: 'value' });
  • Parameters

    • methodSpec: string

    Returns {
        className: string;
        methodName: string;
    }

    • className: string
    • methodName: string