Skip Navigation
Expand
Custom process using run_mode in object event handlers
Answer ID 6709   |   Last Review Date 07/22/2019

How can I write a custom process that will act differently when I am testing and when it is it in production?

Environment:

Process Designer, Custom Process Model (CPM) / Service Process Model (SPM)
November 2012 version and newer

Resolution:

There are times that you may want an external event or a custom process to do one things during testing and another thing when it is in production.

An example of this is: posting to a 3rd party server, during development you want to post to another development server, during production your would like to route the data to a 3rd part production server.

This action can be completed using the apply() method which is passed a $run_mode parameter. Test $run_mode against RNCPM\RunModeLive in the apply method to guard any non-testable or unique testing behaviors, external integrations, etc.

 

Available Languages for this Answer:

Notify Me
The page will refresh upon submission. Any pending input will be lost.