Developer Programs

Learn

Docs

AppCls

API Reference > AppCls
SoapActionn/a
Input NameAppCls
Output NameAppClsResponse
Input Namespacen/a
Group NameXperience
ContainerXP_MsgBus.xsd
AppCls.js
function onFrameworkReady() {
  this.hosted = jackHenry.xperience.isFrameworkHosted.toString();

  // This will be called when the framework is ready, or after a timeout.
  // Make sure we are hosted before doing any connections:
  if (jackHenry.xperience.isFrameworkHosted) {
    // NOTE: It is a good idea to subscribe to messages before you connect to the message bus but subscribing can be done at any time
    jackHenry.xperience.messageBus.subscribe('AppCls', onAppCls);

    // Must connect with the message bus before sending any messages
    jackHenry.xperience.messageBus.connect();
  }
}

function onAppCls(context: any) {
  const message = context.messageToJson();

  const response = new jackHenry.enterprise.businessObjects.AppClsResponse();
  const closeStatus = 'ClsAck';

  response.ClsStat = closeStatus;
  response.RsStat = 'Success';

  context.reply(response);
  jackHenry.xperience.messageBus.disconnect(true);
  window.close();
}
AppCls.cs
XperienceContext.Current.MessageBus.Subscribe(AppCloseHandler);

private static void AppCloseHandler(ISubscribedMessageContext context)
{
    // ClsStat has 2 values:  ClsAck (close acknowledgement),
    // FocusReq (Focus Required)
    var appClsRs = new AppClsRs_MType()
    {
        RsStat = "Success",
        ClsStat = "ClsAck"
    };

    context.Reply(appClsRs);
}

Did this page help you?

Last updated Mon Dec 9 2024