- 04 Aug 2022
- 1 Minute to read
SDK: Building a Module (Advanced)
- Updated on 04 Aug 2022
- 1 Minute to read
Custom modules are created by users to add or extend certain functionalities and to link together different types of custom functionality. While custom modules do not require .dlls, it is common to build custom code in a .dll. Use of custom module may involve grouping exported Decisions Objects, custom Flow behaviors, and/or step implementations together in one Module, integrating custom Flow or step implementations with a third party library, etc.
Creating a Custom Module
- Install Decisions 6 locally. Download the Custom Module by selecting Code > Download ZIP; use this as a guide to creating a Module.
- The example module is named "CustomModule." Rename files to match the name of the Module that is being created.
- Open CustomModule.csproj, CustomModule.sln, Module.Build.xml, and build.proj and rename instances of "CustomModule" to match the module name.
- If needed, update the NuGet package reference in the CustomModule.csproj file to the correct version of the SDK.
- Add a reference to any external or third-party DLLs.
- Implement the module functionality by adding class files or custom code.
- Run BuildModule.ps1 to build DLL and create Module.zip. To build the project, MSBuild is required. this builds the DLL file and creates the required module zip file to be deployed in Decisions.
- This script will create the zip, stop the Service Host Manager service, copy the zip into 'C:\Program Files\Decisions\Decisions Services Manager\CustomModules', and starts the Service Host Manager service.
- Once the Module is deployed, log in to Decisions Studio and navigate My Apps >APP STORE> Modules.
- Find the custom module, click DETAILS and click INSTALL.
- If any changes are required, make the changes to the code.
- Run BuildModule.ps1 to deploy changes and repeat as needed.
- Attach IDE debugger to DecisionsServiceHost process.
- Add breakpoints.
When creating a custom module, keep the following best practices in mind:
- Create a module for service DLLs and a different module for all configurations to assist with breaking cycles apart if using a development team and design team.
- Always version modules.
- If issues arise, please refer to C:\Program Files\Decisions\Decisions Services Manager\Logs.