Skip to main content


         This documentation site is for previous versions. Visit our new documentation site for current releases.      
 

Unit testing event strategies

Updated on July 5, 2022

Evaluate event strategy logic by testing it against sample events. This option facilitates event strategy design and enables troubleshooting potential issues.

  1. Open the Event Strategy rule instance that you want to test by performing the following actions:
    1. In Dev Studio, click RecordsDecisionEvent Strategy.
    2. Click the name of an Event Strategy rule.
  2. In the top-right corner of the Event Strategy rule form, click ActionsRun.
  3. In the Input Events field of the Run window, enter the number of events to send simultaneously.
    You can send up to 100 events while the Run window is open.
  4. If the event strategy is using the system time, set the Simulate system time setting.
    The method for setting the event time is configured in the Real-time data component. For test events that use system time, the value is converted to the Pega Time format (YYYYMMDD'T'HHmmss.SSS), GMT, and stored in the pzMockedSystemTime property.
  5. If the event strategy is using a custom event field to set the time, populate that field with a correctly formatted value.
    The time format for the custom event field that sets the time property is configured in the Real-time data component.
  6. If the event strategy is referencing lookup fields, simulate the corresponding values in the Lookup section.
    Note: For every lookup field that corresponds to a unique event key, only the initial lookup value is considered. That value does not change for all subsequent events for that key.

    For example, if you set the initial value of the lookup field Month to April for Customer-1234, this value never changes for the following events, even if you simulate the next event for that customer with a different Month value, for example, May.

  7. Click Run to confirm your settings and test the strategy against sample data.
    You can inspect whether the strategy produces expected results in the Sent events and Emitted events sections. Each time you click Run, the number of available events decreases. You can reset the number of available events by clicking Clear events.
    Important:

    Each event that you insert for testing is validated in the same way as in a real-life event strategy run. For example, to avoid validation errors, insert events chronologically and ensure the values must correspond to property types, and so on.

Have a question? Get answers now.

Visit the Support Center to ask questions, engage in discussions, share ideas, and help others.

Did you find this content helpful?

Want to help us improve this content?

We'd prefer it if you saw us at our best.

Pega.com is not optimized for Internet Explorer. For the optimal experience, please use:

Close Deprecation Notice
Contact us