Customization in Automation Studio
This section provides steps to configure various automations which are not configurable through studio. It includes Custom plugin, Code Editor, Summary, Notesmaker, Custom CView, Custom Search and ISEHelper.
Creating DLL for Custom Application
- In Visual Studio, create a new project with the output type as Class Library using .net framework 4.8. Validate that the DLL is build using x86 platform and DLL name is the same as Namespace.
- Add Proton.Utilities.CodePluginInterfaces, PROTON.Utilities.Interfaces, and Proton.Miscellaneous.Framework DLLs (present in EPA Build) references in the project. From any of the following locations:
- EPA\client-tools\AutomationStudio\bin
- EPA\client-tools\AutomationRuntime\Engage
- Add reference to PresentationFramework, System.Windows.Forms and WindowsBase to use the Dispatcher to access the main thread when required.
- Implement ICodePlugin and ISEHelper interfaces. Also extend System.Windows.Forms.UserControl class to resize this custom application in EPA.
- On implementing the ICodeplugin interface, following methods can be used.
Launch –used to launch a custom application.
DoSignIn –used to perform sign-in for custom applications. DoAutomation – used to perform an automation in custom applications. DoReset – used to perform reset automation in custom applications.
DoDispose – used to dispose a custom application - Launch the application (using implantation written for Launch method of ICodeplugin interface). Pass the application name (name is same as entered in Studio Application Management) and the class handle as input parameters to this above-mentioned event. Use Dispatcher to call this event.
NOTE:
Refer to the Event Hooks Using ISEHelper section for further information on usage of ISEHelper APIs. - Raise the LaunchCompleted event when the launch is complete. Pass the code plugin object as sender. Set the application object in the appContext InstanceObject, set IsLaunched as True and pass the appContext object in the LaunchEventArgs in the Launch- Completed event. All the events must be raised in the main thread, using Dispatcher.
- After LaunchCompleted event is raised, EPA calls the DoSignIn method of the code plugin, if SignIn is configured for the Custom Application. Raise the SignInCompleted event once the signin is done with SignInEventArgs having either SignInStatus as Completed or Failed using SignInStatus Enum. If this method takes more time than the value configured in the sign in manager in IDE for the code plugin then EPA marks the sign-in as ‘failed’ for this custom application. UserId and password is present in inputParamDict.
- Application automation logic is implemented in DoAutomation method. InputParamDict which contains all inputs parameters configured for this custom application in the format of KeyValuePair. Here, key corresponds to Field names and value corresponds to its value. OutPutParamDict contains KeyValuePair of all the output parameters where key corresponds to Field name and value corresponds to its value which is modified or assigned depending upon the output from the custom application. To return the extracted fields to EPA, raise FillExtractedFieldsEvent with ExtactedFieldsEventArgs having dictionary containing extractedFields assigned to outputPutParamDict. This event is raised using Dispatcher.
- To mark the search as completed or failed, raise SearchStatusEvent with SearchStatusEventArgs having either searchCompleted or SearchFailed as enum in eventArgs.
- Reset the Custom Application whenever the process in EPA is reset by implementing the DoReset method. After the reset, raise SearchStatusEvent as ResetCompleted or ResetFailed using SearchStatus Enum. This event is raised using Dispatcher as displayed.
NOTE: |
|