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.
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.
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.
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.
Posted: 5 years ago
Updated: 5 years ago
Posted: 23 Dec 2015 16:04 EST Updated: 23 Dec 2015 16:10 EST
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 ?