Event Hooks Using ISHelper

If any customization is required on EPA or Engage lifecycle events like before Sign-in, after Sign-in, on Search completion in an application and so on, you can use the customization APIs to enable desired custom behavior. The ISEhelper provides multiple event hooks to insert the desired customization at specific events. Customization can be loaded by default, as API consumers, with custom applications or as process API consumers. You can also use the API hooks to trigger search, select and reset at runtime.

 

Details of the APIs are mentioned in the CustomizationAPIs.xlsx. Below are the steps for using the APIs:

 

To use ISEHelper API:

  1. Create a class library project in Visual Studio.
  2. Add a reference of DLL System.ComponentModel.Composition.dll available with .net framework 4.8. Add Proton.Utilities.Interfaces.dll into that project. This DLL is present in the folder where EPA is installed.
  3. Project Assembly name must end with Helper word.
  4. Create a new class and name the class followed by Helper and implement the interface ISEHelper.
  5. Provide ‘[Export (typeof (ISEHelper))]’ attribute on that class, implement that interface.
  6. Invoke the events as mentioned below provided by ISEHelper as per the business requirement. Methods are implemented by default with throw exception, if not in use, should be modified without throw otherwise the logs will show multiple not implemented exceptions for methods which are not in use.

    You can use UI related events or non-UI related events.
    For example, use SelectProcessEvent, TriggerSearchEvent, TriggerResetEvent events or perform the task using SEFramework. It is recommended not to use UI related events and SEFramework methods together for a task.

 

NOTE:  

Getter and setter of SEFramework need to be set before use.

 

To use the event hooks, you must create the subscriptions. Following methods are loaded on implementing ISEHelper:

  1. BeforeSignIn(List<IApplicationPlugin> listOfProfileLevelPlugin)
    Here listOfProfileLevelPlugin contains details of all profile level plugins.
  2. AfterSignIn(List<IApplicationPlugin> listOfProfileLevelPlugin)
    Here listOfProfileLevelPlugin contains details of all profile level plugins.
  3. AppWiseLaunchStatus(LaunchStatusResult launchStatusResult, IApplicationPlugin appPlugin)
    Here launchStatusResult contains status of launch and appPlugin contains details of launch status of each application.
  4. AppWiseSignInStatus(SignInStatusResult signInStatusResult, IApplicationPlugin appPlugin)
    Here SignInStatusResult contains status of signin and appPlugin contains details of signin status of each application.
    Select a process before firing the search or reset event.
     

    [Export(typeof(ISEHelper))]

    public class SEConsumerHelper : ISEHelper

    {

    //Invokes Search vent

    private void DoSearch()

    {

    SelectProcessEvent(parameters[0]);

    //Extracting the search parameters sent in Context from calling entity.

    Dictionary<string , string> dict = Proton.Miscellaneous.Framework.Extension.Context.Instance.data[“SearchParams”] as Dictio- nary<string , string>;

    args.searchDictionary = dict;

    //Setting the Search Source for Reporting Purpose. You can provided any value here, that you wish to have it in your reports args.SearchSource = “FromISEHelper”;

    //Fire search for the selected process TriggerSearchEvent(null , args);

    }

    //Invokes reset

    private void DoReset()

    {

    Dictionary<string, string> searchDictionary = new Dictionary<string, string>(); searchDictionary.Add(“Search Text”, “123”); TriggerResetEvent(searchDictionary);

    }

    }

  5. Build the project solution in x86 Mode.
  6. Paste the DLL in the EPA installation folder at: Engage\APIConsumers\SEAPIConsumer.

 

To use ISEHelper APIs in CustomApplications:

  1. Implement the interface ISEHelper in code file of the custom application.
  2. Verify that the interface is implemented.
  3. Invoke the events provided in the ISEHelper as per the business requirement.
  4. Build the custom application project and configure the DLL in the Automation Studio for custom application. This is applicable for custom application configured through Automation Studio as well.

 

NOTE:  

While implementing the interface ISEHelper, the properties of ISEHelper must not contain throw new NotImplementedException() code. Remove such code, if present. The Get and Set blocks must be free of any exception code.

 

To use Process Implementation Helper APIs:

  1. Create a class library project in Visual Studio.
  2. Add a reference of DLL System.ComponentModel.Composition.dll available with .Net framework 4.8 and add Proton.Utilities.Interfaces.dll into that project. This DLL is present in folder where EPA is installed on the system.
  3. Create a new class and name the class followed by Helper. Implement the interface IProcessImplementationHelper.
  4. Project Assembly name must end with Helper.
  5. Provide ‘[Export (typeof (IProcessImplementationHelper))]’ attribute on the class and implement the interface.

    Sample code for usage of IProcessImplementationHelper is given below:

    using PROTON.Utilities.Interfaces.Customization; using System;

    using System.Collections.Generic;

    using System.ComponentModel.Composition;

    namespace SECustomization

    {

    [Export(typeof(IProcessImplementationHelper))]

    public class CreditCardProcessHelper : IProcessImplementationHelper

    {

    /// <summary>

    /// This will get executed on every application search completion

    /// </summary>

    /// <param name=”searchStatus”></param>

    /// <param name=”extractedData”></param>

    public void AppSearchCompleted(PROTON.Utilities.Interfaces.SearchStatusResult searchStatus, Dictionary<string, string> extractedData)

    {

    // Write custom code

    }

    /// </summary>

    public string ProcessBinding

    {

    get { return _processName; }

    }

    /// <summary>

    /// Provide valid profile name

    /// </summary>

    public string ProfileBinding

    {

    get { return _profileName; }

    }

    /// <summary>

    /// This gets triggered after overall search completes

    /// </summary>

    /// <param name=”searchStatus”>Search result Success/Fail</param>

    /// <param name=”searchExtractionData”>Extracted Data</param>

    public void SearchCompleted(string searchStatus, List<PROTON.Utilities.Interfaces.AppExtractionData> searchExtractionData)

    {

    // Write custom code on search completion

    }

    /// <summary>

    /// Useful to set CView in SE

    /// </summary>

    public event EventHandler<PROTON.Utilities.Interfaces.CViewDictionary> ShowCviewEvent;

    /// <summary>

    /// Framework will set this workspace key. Please don’t set it explicitly unless required

    /// </summary>

    public PROTON.Utilities.Interfaces.WorkspaceEntity WorkspaceIdentity

    {

    get;

    set;

    }

    }

    }

  • Build the project solution in x86 Mode and paste the DLL in the Engage installation folder at: Engage\APIConsumers\ProcessAPIConsumer.

    NOTE:  

    Invoke all the events in UI thread using Dispatcher (in case of WPF application) or Invoke (in case of WinForms).