Preparation
Before coding a new trigger from scratch, the best is to duplicate the "void" template provided in the SDK:Let's assume we want to create a "acme_trigger" trigger. The preparation process is pretty simple and consist in doing the following:
- Copy the folder
src/com/xqual/trigger/template
insrc/com/xqual/trigger/acme_trigger
- Modify the package and the static variable TRACE_HEADER in the
CTriggerImpl.java
source file - Copy and rename
build/buildTemplateTrigger.bat
inbuild/buildMyAcmeTrigger.bat
- Edit the build script
buildMyAcmeTrigger.bat
and change
- the variableJAVA_HOME
to point to your JDK.
- the name of the trigger in the scriptXSTUDIO_TRIGGER_NAME=my_acme
- Run
buildMyAcmeTrigger.bat
- You should get a file
my_acme.jar
in the bin folder...
Congrats! you compiled your void trigger.