Question
Royal Bank Of Canada
CA
Last activity: 23 Dec 2015 19:24 EST
Pros and cons using declare trigger rule or an agent
What are the pros and cons using declare trigger rule and an agent (called activities in the agent and declare are both same)
-
Like (0)
-
Share this page Facebook Twitter LinkedIn Email Copying... Copied!
Accepted Solution
Pegasystems
US
I like the trigger better. Reasons:
1) The trigger only runs when the condition occurs. The agent needs to run every N seconds and look around to see if conditions are right.
2) If the trigger has an issue, tracing the requestor is straight-forward for analyzing the issue, whereas tracing an agent is not fun. You have to use SMA agent screen to tell the agent to delay so you can go to the requestor screen and wait to see the "delayed 60 seconds" message on a requestor, and then you have to bring up the tracer, which sometimes you can do in SMA but sometimes you have to run regular tracer and use the remote-requestor dropdown to pick the right requestor.
/Eric
Pegasystems Inc.
US
I think part of the consideration is whether the data needs to be processed immediately when the object is saved,deleted, etc or if it can be processed in the background by the agent. If there is an error in the activity when processed by the declare trigger, then that error could be displayed to the user. If that is not needed, then the agent could be used to process the item separately and report errors to an Administrator.
Accepted Solution
Pegasystems
US
I like the trigger better. Reasons:
1) The trigger only runs when the condition occurs. The agent needs to run every N seconds and look around to see if conditions are right.
2) If the trigger has an issue, tracing the requestor is straight-forward for analyzing the issue, whereas tracing an agent is not fun. You have to use SMA agent screen to tell the agent to delay so you can go to the requestor screen and wait to see the "delayed 60 seconds" message on a requestor, and then you have to bring up the tracer, which sometimes you can do in SMA but sometimes you have to run regular tracer and use the remote-requestor dropdown to pick the right requestor.
/Eric
Royal Bank Of Canada
CA
Thanks, In terms of performance wise , what is the better approach?
Virtusa
US
It depends on what actions/processing logic you will do during declare trigger. i think Agent is the best approach If you want to save entire data in workobject into different tables.
Thanks,
Kartheek
Royal Bank Of Canada
CA
Thanks , The requirement is to look a data with some flags in a table (data is inserted when a workflow goes ), then declare trigger or an agent has to pick those data from there. Match and get the relevant data from the work table (using a obj-browse, usally whole data), finally process those data and pass it a queue. In terms of saving data, it saves few data.
Pegasystems Inc.
IN
Hi Malinda,
When you say "The requirement is to look a data with some flags in a table", I am assuming declare trigger in not what you will need.
Do you need processing to happen immediately when that data is changed ?
How often will this logic be executed ?
Will this impact saving of other Work objects ?
If possible, can you please specify requirements as general business flow of what you are expecting
I echo with Eric. Additional advantage with declare trigger approach is that they automatically update the history of work item (or rule or data object) when certain properties change. For Agents, we have to take care of this with additional effort.
Updated: 23 Dec 2015 16:10 EST
Royal Bank Of Canada
CA
Thanks you all. The requirement is to look a data with some flags in a table (those data is inserted from the main workflow ),declare trigger or an agent has to pick those data from there. Then match and get the relevant data from the work table (using a obj-browse, usually take all data of that WO), finally process those data and then pass it a queue. I would like to know for this kind of requirement what is the best approach in terms of performance and troubleshooting perceptive? Since this has saving objects to that table frequently, if declare trigger use, is it affect in performance ?