Documentation
DEPENDENCIES_PROCESSOR
usage
<DEPENDENCIES_PROCESSOR ID="number">
<INFO>
<ID>number</ID>
<CREATORID>contactID</CREATORID>
<OWNERID>contactID</OWNERID>
<GROUPID>groupID</GROUPID>
<MODIFIERID>contactID</MODIFIERID>
<CREATIONDATE>YYYY-MM-DD hh:mm:ss</CREATIONDATE><!-- automatically filled by Sushee -->
<MODIFICATIONDATE>YYYY-MM-DD hh:mm:ss</MODIFICATIONDATE><!-- automatically filled by Sushee -->
<DEPENDENCYTYPE>text</DEPENDENCYTYPE>
<TYPE>{preprocessor,postprocessor}</TYPE>
<DEPOPERATION>{create,update,create/update,remove}</DEPOPERATION>
<PATH>text</PATH>
<CLASSNAME>text</CLASSNAME>
<METHOD>text</METHOD>
<ORDERING>0</ORDERING>
</INFO>
</DEPENDENCIES_PROCESSOR>
paramètres
DEPENDENCYTYPE: the dependencytype for which the processor will be called
TYPE : the processor type. It can be a preprocessor, executed before the dependency operation, a postprocessor, executed after the dependency operation.
DEPOPERATION: the type of operation. A dependency creation, a dependency update, a dependency remove. The "create/update" value can be used for the processor to be executed on creation and on update.
PATH : the path to a PHP file. This file must contain the class indicated in CLASSNAME.
CLASSNAME : the name of the class which contains the function/method to execute.
METHOD : the name of the method to execute.
ORDERING : in which order the different processors should be executed.
Processors allow to add customized behaviours when sushee commands are executed on objects. A dependencies processor can be triggered when an dependency between two object is created, updated, deleted.
Processors can interact with the NQL and the datas of the object through a PHP object called sushee_DependencyProcessorData. This object is given as argument to the method called.
Once the processor job is over, it should return an object SusheeProcessorMessage if the process was successful or an object SusheeProcessorException if the process failed.
SusheeProcessorException are returned - so that the command is interrupted but the NQL execution continues and further commands can be executed.
return new SusheeProcessorException("NQL execution continues");
But this object can also be thrown if you want to completely stop the NQL execution when your processor fails.
throw new SusheeProcessorException("NQL completely interrupted");
exemples
<CREATE>
<DEPENDENCIES_PROCESSOR>
<INFO>
<DEPENDENCYTYPE>contactWork</DEPENDENCYTYPE>
<TYPE>preprocessor</TYPE>
<DEPOPERATION>create/update</DEPOPERATION>
<PATH>/Public/processors.class.php</PATH>
<CLASSNAME>DepProcessor</CLASSNAME>
<METHOD>workFor</METHOD>
</INFO>
</DEPENDENCIES_PROCESSOR>
</CREATE>