Skip to content
Nicho edited this page Oct 24, 2024 · 12 revisions

MTG Companion embed a Qwartz server to automa some job

At first startup, a $HOME/.mtgdeskcompanion/data/quartz-config.xml will be created

This config file can be edited to manage your different job.

Announce Job

This embedded job is used for Announce management, and change the status of announce with the expiration date.

		<job>
			<name>Job-Announce</name>
			<group>Group-Announce</group>
			<description>Announces status updates</description>
			<job-class>org.magic.services.jobs.AnnouncesUpdaterJob</job-class>
		</job>

		<trigger>
			<cron>
				<name>Trigger-Announce</name>
				<job-name>Job-Announce</job-name>
				<job-group>Group-Announce</job-group>
				<!-- It will run every 59 seconds -->
				<cron-expression>0/59 * * * * ?</cron-expression>
			</cron>
		</trigger>

Script Jobs

you can integrate your script in a job to run them periodicaly . See Create Scripting tools


                 <job>
			<name>JobA</name>
			<group>Group1</group>
			<description>This is Job A</description>
			<job-class>org.magic.services.jobs.ScripterJob</job-class>
			<job-data-map>
				<entry>
				  <key>SCRIPT_NAME</key>
				  <value>scriptName.groovy</value>
<!-- the script need to be in directory $USER_HOME/.magicDeskCompanion/data/scripts directory -->
				</entry>
			</job-data-map>
		</job>

		<trigger>
			<cron>
				<name>TriggerA</name>
				<job-name>JobA</job-name>
				<job-group>Group1</job-group>
				<cron-expression>0/10 * * * * ?</cron-expression>
			</cron>
		</trigger>

Cron

You can use this link to help you to build your cron syntax https://www.freeformatter.com/cron-expression-generator-quartz.html#cronexpressionexamples

Clone this wiki locally