Question
Areteans
AU
Last activity: 16 Oct 2020 1:23 EDT
Declare trigger is not getting triggered
We have created a declare trigger rule on 'System-Locks' class, but is not getting triggered when work is submitted.
Trigger condition: Committed Delete
Traced the scenario, I am able to see that work lock is released, but trigger is not triggered.
Suggestions are appreciated, thanks in advance.
-
Like (0)
-
Share this page Facebook Twitter LinkedIn Email Copying... Copied!
Accepted Solution
Updated: 21 Feb 2020 15:17 EST
Areteans
AU
Thanks for info @BraamCLSA , and @MarcLasserre_GCS .
After more analysis I got to know that the issue is, Pega saves the System-Locks instance via Java. So as Pega does not use obj-methods to save/create an instance of System-Locks, declare trigger will not be triggered.
Pegasystems Inc.
FR
Hello,
Can you share the tracer ouput? I guess it should be working even if I never tried myself on said class.
Pegasystems Inc.
AU
Noting that your Trigger Condition is "Committed Delete", are you looking at the lines in the Tracer following the 'Commit' event? Have you experimented with just the "Delete" event.
Check also that you don't have any When conditions governing whether the Trigger activity should run. You should still see these in the Tracer and evaluating to 'false' if that was the case.
Lastly, check the logs to see if there's some runtime issue where it attempts to run but doesn't, but fails silently in the core interaction.
The help docs do advise the Declare Triggers can't be created on Code-* and Embed-* subclasses (this help link is for 8.4, but I know this dates back to 7.x). I think that constraint is applied on the New Rule form so if System-* was fell under the same constraint you should have been blocked from creating the Declare Trigger.
Failing that, raise a Support Request. Nothing I've just read suggests this is not supported.
Accepted Solution
Updated: 21 Feb 2020 15:17 EST
Areteans
AU
Thanks for info @BraamCLSA , and @MarcLasserre_GCS .
After more analysis I got to know that the issue is, Pega saves the System-Locks instance via Java. So as Pega does not use obj-methods to save/create an instance of System-Locks, declare trigger will not be triggered.
Pegasystems Inc.
AU
Is another way to approach this to have the Declare Trigger run on the Committed Save of the item that you have locked? In other words is the actual event of interest 'the save of a lockable item' as distinct from 'the release of the lock' ?
Inheritance applies for Declare Triggers, so if there are a range of work classes that this behaviour should be triggered for (MyCo-MyApp-Work-A, MyCo-MyApp-Work-B, MyCo-MyApp-Work-C), you can implement the trigger once with the Applies To class set to their most common superclass (MyCo-MyApp-Work) and the trigger will fire on the Committed Save of instances of any of its subclasses.
Nasco
CA
Did you find another way of achieving this ? We have a requirement to write to log each time a lock is released and declare trigger is not working. Please let me know.
Areteans
AU
I had to change the design. We were not able to design considering System-Locks.
your requirement is complex.Have you considered a scenario of soft locking? where a lock is held but if another user(user 2) tries to open assignment User 2 will get the lock.