application.performAction

Purpose:

Allow users to perform one of an enumerated set of actions, as supported by the host application. For example, allowing the user to upload/attach a file to the transaction request, or update a set of invalid/expired credentials configured for their use with your integration.

📘

Runtime supported action discovery!

You can also discover whether the host application within which your integration is currently embedded supports a specific action or not. You can invoke the application.supportsAction method - which returns a boolean value indicating whether the action provided as an argument is supported by the host application.

You can also get all the host application supported actions using the application.getCapabilities method which returns a list of supportedActions

Sample Usage:

import host from '@elliemae/em-ssf-guest'

...

const action = "ACTION_ID"
const options = "OPTIONS"

async function performAction(action) {
  try {
    const applicationObject = await host.getObject('application');
    const capabilities = await applicationObject.getCapabilities();
    const supportedActions =  capabilities.supportedActions;
    const actionResult = null

if (supportedActions.includes('ACTION_ID')){
      actionResult = await applicationObject.performAction(action, options);
}

    console.log(actionResult);
  } catch (error) {
    console.log({error});
  }
}

await performAction(action);
import host from '@elliemae/em-ssf-guest'

...

const action = "ACTION_ID"

host.getObject('application')
  .then(
    (applicationObject) => {
      applicationObject.performAction(action)
        .then(
          (actionResult) => {
            	console.log(actionResult)
            }
          }
        )
        .catch(
          (error) => {
            console.log({error})
          }
        )
    }
  )
  .catch(
    (error) => {
      console.log({error})
    }
  )

Interface:

InputDescriptionSupporting Applications
ACTION_IDThe action to be performed.Desktop Version of Encompass & Web Version of Encompass
OPTIONSThe actions parametersDesktop Version of Encompass & Web Version of Encompass

Returns:

Type: Promise

==> Resolved

The action result. Action's parameters and results are different for each ACTION_ID

Supported Actions

  1. getAvailableResouces
  2. getRoles
  3. getPersonas
  4. getContext
  5. setContext
  6. getEligibleServiceSetups
  7. updateCredentials