Skip to main content

This content has been archived and is no longer being updated. Links may not function; however, this content may be relevant to outdated versions of the product.

Support Article

DECLARE-TRIGGER on the lower level is firing twice

SA-9852

Summary



A DECLARE TRIGGER rule was built at a higher level class (at the Framework Layer for instance) and another (of the same name) was created in a lower level class (at the Implementation Layer for instance). It is  expected that the lower-level trigger would fire only once: however a TRACER showed that the TRIGGER on the lower level class is firing twice.

Further, it is found that the double-firing occurs even if the higher level class TRIGGER is set to WITHDRAWN.

Error Messages



No errors messsages are associated with this scenario : a TRACER or debug-logging Activity can be used to illustrate the issue.

Steps to Reproduce



The following steps demonstrates the issue.

1. Set up a Higher and Lower Level Class Structure : a standard FRAMEWORK and IMPLEMENTATION layer is suitable here - use the  'Application Accelerator') mechanism to create the structure easily.

2. At the Framework Level* : Create two ACTIVITIES ; Logger1 and Logger2. Ensure that each performs a oLog.infoForced that reflects the name of each Activity - test them manually and ensure the logging correctly identifies which Activity was run.

3. Now create two DECLARE-TRIGGERS: one should call the 'Logger1' Activity, the other should call 'Logger2' : both Triggers should have the same name; one should be built at the FRAMEWORK layer, the other at the IMPLEMENATION layer. Both TRIGGERs should be configured to fire at on 'COMMITED SAVE' - and both should be set to fire 'IMMEDIATELY'.

4. Launch a standard User Portal: and create a single Work Item: this should be sufficient to ensure a 'COMMITED SAVE' occurs.

Observe from the logs: that the IMPLEMENTATION LAYER TRIGGER has fired twice.

Variations to the test:

1. Mark the FRAMEWORK LAYER TRIGGER as WITHDRAWN - repeat the test - the Double-Firing should still occur in the same way as above.
1. Delete the FRAMEWORK LAYER TRIGGER - repeat the test - this should result in the (correct) single-firing of the IMPLEMENTATION LAYER TRIGGER.
 


Root Cause



The root cause of this problem is a defect in Pegasystems’ code/rules. 

Resolution



This issue is resolved by Hfix-21956.
The "Steps to Reproduce" above must be used before and after installing the hotfix to confirm that  it has been installed correctly and works as expected.
 

Published June 12, 2015 - Updated October 8, 2020

Was this useful?

0% found this useful

Have a question? Get answers now.

Visit the Collaboration 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 Community has detected you are using a browser which may prevent you from experiencing the site as intended. To improve your experience, please update your browser.

Close Deprecation Notice
Contact us