The data from a case is stored in the WF_WORKFLOW.APPLICATION.APP_DATA field, which as atissot noted is a MySQL mediumtext field. It can hold 16MB
(2^24 bytes) of data. You probably won't run into the upper limits in most cases. Even if you enter a Input Document for every entry in the grid, those are stored in a separate table with just a reference to the document.
However, to be safe, you could write a trigger with the following code:
Code: Select all
$app = @@APPLICATION;
$query = executeQuery("SELECT LENGTH(APP_DATA)) AS CASE_LEN, APP_NUMBER, APP_CREATE_DATE, " .
"APP_UPDATE_DATE FROM APPLICATION WHERE APP_UID='$app'");
//If you want to debug this, uncomment the following line and activate Debug mode to see its contents when running a case:
//@@debugQuery = $query;
//error check to make sure you get a valid response
if (is_array($query) && len($query) >= 1)
$caseLen = $query['CASE_LEN'];
@@CaseLength = $caseLen; //assign to a case variable for use in the email template
if ($caseLen > 15 * 1024 * 1024); //if greater than 15MB
@@CaseNo = $query['APP_NUMBER'];
@@CaseCreated = $query['APP_CREATE_DATE'];
@@CaseUpdated = $query['APP_UPDATE_DATE'];
# Note that you need to have configured ProcessMaker to send email in ADMIN > EMAIL
PMFSendMessage(@@APPLICATION, "[email protected]", "[email protected]", "", "",
"Warning: Approaching space limits for case", "OverflowWarningTemplate.txt");
Then create an email template named "OverflowWarningTemplate.txt". See:
http://wiki.processmaker.com/index.php/ ... ifications
Put the following text in the template:
Code: Select all
Warning: Case @@CaseNo is currently using @@CaseLength bytes of data. The maximum is 16MB (2^24 bytes).
To avoid problems do not add more data to the case.
Case ID: @@APPLICATION
Case No: @@CaseNo
Case Created: @@CaseCreated
Case Updated: @@CaseUpdated