See also: Writing Registry Plugins
Some additional conventions are required when writing a Job Plugin.
FooJob
. The prefix (eg: Foo
) will be used as the job_type
in cm_co_jobs.Model/FooJob.php
.execute($coId, $CoJob, $params)
, which will be passed the relevant CO ID, a CoJob object, and an (optional) array of parameters in accordance with the Plugin's configuration.$CoJob->update()
(with appropriate arguments).$CoJob->canceled($jobid)
after each iteration, and immediately terminate processing if the Job has been canceled.$CoJob->finish()
, with appropriate arguments. (The Job will be set to started when dispatched, before the Plugin is invoked.)parameterFormat()
, which returns an array of parameters supported by the plugin. Each entry in the array has a key of the parameter name and a value of an array with the following keys:choices
: An array of permitted values for the parameter (when type
is select
)help
: Help text for the parameterrequired
: Boolean indicating whether or not this parameter is requiredtype
: One of int
, select
, or string
.