Documentation
BATCH
usage
<BATCH ID="number">
<INFO>
<ID>number</ID>
<ACTIVITY>1</ACTIVITY>
<ISLOCKED>0</ISLOCKED>
<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 -->
<TYPE>{url,nql,shell}</TYPE>
<DOMAIN>text</DOMAIN>
<DENOMINATION>text</DENOMINATION>
<COMMAND>text</COMMAND>
<STATUS>{edition,pending,running,finished}</STATUS>
<RESPONSE>text</RESPONSE><!-- automatically filled by Sushee -->
<CALLBACK/>
<WISHEDSTART>YYYY-MM-DD hh:mm:ss</WISHEDSTART>
<START>YYYY-MM-DD hh:mm:ss</START><!-- automatically filled by Sushee -->
<END>YYYY-MM-DD hh:mm:ss</END><!-- automatically filled by Sushee -->
<NOTES>text</NOTES>
</INFO>
</BATCH>
Batch is a module intended for developpers (no user interface is currently provided) to schedule programmed delayed task.
Batch queue
The queue of batches is consulted by Sushee every minute. The most urgent pending batch is executed if no other batch is currently running. The urgency of a batch is determined by its WISHEDSTART field. The lower the wished start, the higher the urgency. If two batches have the same wished start, the first arrived is executed.
A batch in status edition will NOT be executed.
Batch type
A batch can be of three types : url, nql or shell.
A batch of type url is an internet adress to be called in orded to execute the scheduled task.
A batch of type nql is a set of NQL commands to execute on the Officity where the batch was programmed.
A batch of type shell is a unix shell command to execute.
Whether the batch is url, nql or shell, the command itself is encoded in the COMMAND field.
Response
The response of your command (output of the url adresse called, result of NQL command, output of shell command) will be saved in the RESPONSE field.
Other fields
The DOMAIN, DENOMINATION and NOTES fields are purely indicative fields, they are only there for the developer's purpose, to classify and annotate its batches.
exemples
<CREATE>
<BATCH>
<INFO>
<DOMAIN>Import</DOMAIN>
<DENOMINATION>/tmp/25.csv</DENOMINATION>
<TYPE>url</TYPE>
<COMMAND>http://presite.silence.com/Public/import_csv.php?path=/tmp/25.csv&list=list1</COMMAND>
<STATUS>pending</STATUS>
</INFO>
</BATCH>
</CREATE>
Creates a batch calling a PHP script.
<CREATE>
<BATCH>
<INFO>
<DOMAIN>Import</DOMAIN>
<DENOMINATION>Mail warning</DENOMINATION>
<TYPE>nql</TYPE>
<COMMAND>
<CREATE>
<SERVERMAIL>
<SENDER email="importer@silence.com">Importer</SENDER>
<RECIPIENT>feedback@nectil.com</RECIPIENT>
<SUBJECT>Import finished</SUBJECT>
<BODY>Import finished</BODY>
</SERVERMAIL>
</CREATE>
</COMMAND>
<STATUS>pending</STATUS>
</INFO>
</BATCH>
</CREATE>
Creates a batch sending an e-mail using the SERVERMAIL NQL command.
<SEARCH>
<BATCH status="pending" />
<SORT select="INFO/WISHEDSTART" order="ascending" />
</SEARCH>
Returns the queue of pending batches.