Adding Custom Code to EngageIP

Summary

This article provides detail on using Custom Code adding from the Setup menu.

The custom code section allows uploading or storing an entire assembly of code so that you can make reuse of operations in multiple actions/workflows or jobs. Where complex scenarios are required custom code classes and methods make process creation logic simplified and easier to code and understand. Then using the script based actions or jobs.

Your scripts in actions and jobs can be replaced with a call to the methods inside your custom code.

Examples of custom code use include UDR mediation logic. Customer importing and rating UDR records make use of a scheduled job that calls the custom code methods to process the UDR data. Custom code is also created to run usage analysis reports and fraud monitoring. Multiple jobs can then be set up and reference the custom code methods to perform the actions. If changes are needed only the single custom code script needs to be updated, Job configuration can remain untouched.

Adding Custom Code

  1. Click on the Setup menu

  2. Click on Custom Code

  3. Click the Add button

  4. Add the Name, Description (optional) and Code

  5. Click Save when finished

Disabling Custom Code

You can disable custom code by checking the Disabled checkbox (shown in the image above). If you wish to disable all custom code in EngageIP via SQL query use the command:
update customcode set disabled = 1 

Clear Cache Button

The 'Clear Cache' button allows you to immediately clear the cache of the existing custom code that is loaded into memory. This is to be used if you are frequently updating the custom code and immediately testing it to ensure the system has the latest version of the custom code / script in memory in IIS for processing.

Troubleshooting

AdminPortal returns a 'Server Error' after applying custom code

If your portal goes down after adding a custom code, disable all custom code or the script causing trouble using the SQL query.

As mentioned above all custom code currently enabled can be disabled using this command: update customcode set disabled = 1 

An item with the same key has already been added

If the AdminPortal returns the error "An item with the same key has already been added" after custom code is added/enabled, it means there is duplicate custom code being executed.  Duplicate code will cause the error above, so one script will need to be disabled/deleted.