The Relativity Templates are compatible with Visual Studio 2017 and 2019 and consist of the following:
- Agent template
- Custom page templates
- Custom page MVC 5 template
- Custom page Web Forms template
- Event Handler templates
- Console Event handler template
- List Page Interaction Event handler template
- Page Interaction Event handler template
- Post-Install Event handler template
- Post-Save Event handler template
- Pre-Cascade Delete Event handler template
- Pre-Delete Event handler template
- Pre-Install Event handler template
- Pre-Load Event handler template
- Pre-Mass Delete Event handler template
- Pre-Save Event handler template
- Pre-Uninstall Event handler template
- Manager-Worker Agent template
- Kepler template (for Relativity Versions 10.3.191.8 and higher)
- Kepler Exception
- Kepler Exception Fault Safe
- Kepler IModule
- Kepler IService
- Kepler Module
- Kepler Service
Installation
To install all of the templates simply double click the .vsix file and click the “Install” button. If Visual Studio is already open you will have to restart it for the templates to populate.
Project Templates
To use these click File -> New Project
All the Relativity Project Templates will be found under:
- Visual C#/Relativity/Agent/
- Visual C#/Relativity/CustomPages/
- Visual C#/Relativity/EventHandlers/
- Visual C#/Relativity/ManagerWorker/
- Visual C#/Relativity/Kepler/
* If there are any errors make sure you have all the references setup correctly.
Item Templates
To use these right click on your desired solution and then click “add new item”
All the Relativity Item Templates will be found under:
- Visual C#/Relativity/Agent/
- Visual C#/Relativity/CustomPages/
- Visual C#/Relativity/EventHandlers/
- Visual C#/Relativity/Kepler/
* Note that if the project you add the item to does not have the correct references added, Visual Studio will tell you that you are missing assembly references.
Manager-Worker Agent template
The Manager-Worker Agent project template is an architectural pattern where a long-running Agent task can be split into single or multiple manager/worker agents and execute the task in parallel. This template also consists of recommended best practices for coding and features like resource-pool aware agents, configure agents to run in off-hours, a custom page to view manager/worker agents progress, unit tests projects etc.
The following projects are created:
Agents
This project includes a manager agent and a worker agent. Single or Multiple Manager/Worker agents can be installed in the environment. The only thing you should need to change is the ProcessRecordsAsync method of the Job class. This is where all of the agent work should happen.
Agents.NUnit
Add any unit tests for the agent project to this project.
CustomPages
This project includes custom pages to manage both the worker and the manager queue. Once you create an application which includes the custom pages, you can create a tab to view each queue using the following URLs:
/Relativity/CustomPages//ManagerAgent/Index/?StandardsCompliance=true&%AppID%
/Relativity/CustomPages//WorkerAgent/Index/?StandardsCompliance=true&%AppID%
CustomPages.NUnit
Add any unit tests for the custom pages project to this project.
EventHandlers
This project includes a post-install event handler to create the underlying queue tables and error log table. It also includes a console event handler which can be used to manage jobs in the manager queue using a custom object if you do not wish to use the custom pages to manage the jobs.
EventHandlers.NUnit
Add any unit tests for the event handlers project to this project.
Helpers
This project includes the shared code between the projects in the solution. The only things you should need to change are these constants in the Constant class:
ApplicationGuid – the GUID of the application
ManagerQueueTab – the GUID of the tab which displays the manager queue custom page
WorkerQueueTab – the GUID of the tab which displays the worker queue custom page
Source Code
Relativity Templates is an open-source project on Github. If the templates are missing any features, you are encouraged to contribute to the project.
Link to Relativity Templates Github repository:
https://github.com/relativitydev/relativity-templates