
If the next task in the process uses Value Based Assignment, this is a good point to set the variable used to determine the next user. To set the trigger to always fire, then set the trigger to fire before the next step in the task (or before assignment if at the last step in the task). If no file is uploaded to an Input Document, then a trigger set to be fired after the Input Document will not be fired. Note: Clicking on Next Step does not run the trigger. Therefore, it isn't possible to prevent the file from being saved with trigger code, but it is possible to look up the latest file that was added to the APP_DOCUMENT table and call AppDocument::remove() to eliminate the latest file from the Input Document. The trigger is fired after the new file has already been added to the database and saved in the server's file system. ) to save the variables in the current case before calling die() or exit().Ī trigger set to fire after an Input Document step is fired every time another file is added to the Input Document, so it may be fired multiple times.

To use die() or exit() in a trigger, set the trigger to fire before the next step (or before assignment if at the last step in the task). Warning: If the die(), exit() or some other function is called that stops the completion of the trigger, it will prevent the data and files in the Dynaform from being saved to the database. This a good point to alter the data before it gets submitted. If the step is an Output Document, then case variables can be set to be used in the Output Document's template.Īfter a Dynaform step, the data from the Dynaform's fields exists as case variables, but hasn't yet been submitted to the database and any files uploaded to File fields have not yet been saved to the file system. If the step is a Dynaform, this is a good point to set any case variables that will be displayed in the Dynaform's fields. After a case is routed to the next task in the process.įor example, a process whose first task contains a Dynaform step and an Input Document step will fire the triggers in the following order: Before step trigger Dynaform step After step triggerīefore step trigger Input Document step After step triggerīefore assignment trigger Assignment of user for next taskīefore routing trigger Routing to next task After routing trigger.Before a case is routed to the next task in the process.Before a user is assigned (designated) to work on the next task in the process.Before a step is run (i.e., Dynaforms, Input Documents and Output Documents).

Triggers can be fired at many points during the process: Triggers provide the appropriate framework to perform complex calculations and add additional functionality to processes.Ī ProcessMaker trigger is parsed like a PHP script, so normal PHP variables and functions can be used inside triggers, along with ProcessMaker's case variables and system variables.
#Case clicker 2 codes code#
