[Clarification] GenericAgent: Event-based vs Cron-based

Moderator: crythias

Post Reply
AxBen
Znuny newbie
Posts: 7
Joined: 27 Jun 2017, 08:26
Znuny Version: 5.0 Community

[Clarification] GenericAgent: Event-based vs Cron-based

Post by AxBen »

I would like to be given a clarification on the following question:

When I create an event-based GA job (e.g. to set a dynamic field on a new ticket), is that job executed in a hook-wise fashion, i.e., does it run at the exact time when the event happens (e.g. when the agent pushes the "Submit" button), or is it executed in the course of the GA's cron job(s)?

My findings indicate that the latter is the case. Unfortunately the docs are not very clear about this...

Additional question: is there a way to export GA jobs (YAML, etc)?
reneeb
Znuny guru
Posts: 5018
Joined: 13 Mar 2011, 09:54
Znuny Version: 6.0.x
Real Name: Renée Bäcker
Company: Perl-Services.de
Contact:

Re: [Clarification] GenericAgent: Event-based vs Cron-based

Post by reneeb »

If you choose "Automatic execution" the GenericAgent job is started by the Daemon / Cronjob. If you choose the event based GenericAgent the job is run immediately after the event is triggered. So this doesn't wait until the cronjob is run.
Perl / Znuny development: http://perl-services.de
Free Znuny add ons from the community: http://opar.perl-services.de
Commercial add ons: http://feature-addons.de
AxBen
Znuny newbie
Posts: 7
Joined: 27 Jun 2017, 08:26
Znuny Version: 5.0 Community

Re: [Clarification] GenericAgent: Event-based vs Cron-based

Post by AxBen »

Thanks for the answer, but (yes, there's always a but ;-))...

I created the job as follows:

a) Automatic Execution: %
b) Event-based Execution: Type: Ticket, Event: TicketCreate
c) Select Tickets: Queue: <specific_queue>, State: new (also tried leaving out the State condition)
d) Update/Add Ticket Attributes: <specific_dyn_fields>: <specific_values>

Now, when I create a new ticket for the <specific_qeueue> queue, the specified ticket attributes do not get set.
I can trigger the job manually (lest State: new was specified), but the event doesn't seem to be triggered at the creation of the ticket...
Post Reply