Unofficial documentation how to do interesting things and work around problems in ProcessMaker

Moderators: ArturoRobles, ArturoRobles

Forum rules: Unofficial documentation for features which have not been tested by Quality Assurance or may change in future versions of ProcessMaker
In version 3.1.3 and later the ProcessMaker cron scripts should be executed by the Apache user, in order to avoid file permission problems with ProcessMaker's new logging feature. The Apache user varies according to the distribution of Linux/UNIX. This user is named "apache" in Red Hat/CentOS, "www-data" in Debian/Ubuntu and "wwwrun" in SUSE/openSUSE. If unsure, then check who is the owner of the PM files in the shared directory. If ProcessMaker was installed using the Bitnami Installer, then the Apache user is "daemon" in all distributions.

The Apache user doesn't have configuration files, so it not possible to login as this user. To manually execute a cron script in Linux as the Apache user, the path to the shell must be specified. For example, to manually execute the cron.php file in Red Hat/CentOS:
su -s /bin/sh apache -c "php /opt/processmaker/workflow/engine/bin/cron.php"
Where apache is the name of the Apache user and /opt is the ProcessMaker installation directory.

If using sudo instead of su to execute commands that require root access, then the command would be:
sudo -s /bin/sh apache -c "php /opt/processmaker/workflow/engine/bin/cron.php"

The crontab command can be used to configure the server to periodically execute the ProcessMaker cron scripts at scheduled times as the Apache user. This command should be used instead of directly editing the /etc/crontab file or a file in the /etc/cron.d directory (and the /etc/cron.hourly, /etc/cron.daily, /etc/cron.weekly and /etc/cron.monthly directories in Debian).

To set up the cron scheduler on the server where ProcessMaker is installed, issue the following command (as the root or using sudo):
crontab -u apache -e
Change apache to the name of the Apache user for the Linux distribution or change to daemon if using a Bitnami installation.

The cron file will be opened in the default editor for the distribution. Then, add lines to execute the different ProcessMaker cron scripts at different times in the following format:
Code: Select all
minute hour day-of-month month day-of-week command
Code: Select all
Field 	     Description
minute	     The minute of the hour when the command is executed. Can be 
             between 0 and 59.
hour	     The hour when the command is executed. Can be between 0 and 
             23. 0 is midnight.
day-of-month Day of the month when the command is executed. For example, 
             20 would be the 20th day of each month.
month	     Month when the command is executed. Can be a number between 
             1 and 12 or the first three letters of the month in English, 
             such as jan, feb, etc.
day-of-week	 Day of the week when the command is executed. Can be a 
             number between 0 and 7, where 0 and 7 are both Sunday, 1 is 
             Monday, 2 is Tuesday, etc. Alternatively, can be the first 
             three letters of the day in English such as sun, mon, etc.
Command	     Command, script or program to execute.
An * (asterisk) in the first five columns indicates all possible values. For instance, an asterisk in the minutes column indicates all the minutes in the hour. If an asterisk is divided by a number */#, then it stands for any time unit that can be cleanly divided without any remainder. For instance, in a day with 0-23 hours, */5 would execute on hours 0, 5, 10, 15 and 20.

The following example executes cron.php every 15 minutes and messageeventcron.php every 20 minutes of every even hour in an installation of ProcessMaker Community Edition:
Code: Select all
*/15 * * * * php -f /opt/processmaker/workflow/engine/bin/cron.php
*/20 */2 * * * php -f /opt/processmaker/workflow/engine/bin/messageeventcron.php
In this example, */15 in the first line means execute cron.php at 0, 15, 30, 45 minutes of every hour. Likewise, */20 */2 in the second line means execute messageeventcron.php at the minutes 0, 20 and 40 of the hours 0, 2, 4, 6, 8, 10, 12, 14, 16, 18, 20 and 22.

If needing to execute all the cron scripts, it is recommended to vary the time when they execute so that each script has time to finish processing before the next script starts. In this example, each of the cron scripts are executed twice each hour, but the cron.php script is given 10 minutes to finish processing before starting the next script, whereas the rest of the cron scripts are given 5 minutes to finish processing.
Code: Select all
0  * * * * php -f /opt/processmaker/workflow/engine/bin/cron.php
10 * * * * php -f /opt/processmaker/workflow/engine/bin/messageeventcron.php
15 * * * * php -f /opt/processmaker/workflow/engine/bin/timereventcron.php
20 * * * * php -f /opt/processmaker/workflow/engine/bin/ldapcron.php
25 * * * * php -f /opt/processmaker/workflow/engine/bin/sendnotificationscron.php
30 * * * * php -f /opt/processmaker/workflow/engine/bin/cron.php
40 * * * * php -f /opt/processmaker/workflow/engine/bin/messageeventcron.php
45 * * * * php -f /opt/processmaker/workflow/engine/bin/timereventcron.php
50 * * * * php -f /opt/processmaker/workflow/engine/bin/ldapcron.php
55 * * * * php -f /opt/processmaker/workflow/engine/bin/sendnotificationscron.php
In a Bitnami installation, the path needs to be adjusted to use the Bitnami installation of PHP:
Code: Select all
0 * * * * /opt/bitnami/php/bin/php -f /opt/bitnami/apps/processmaker/htdocs/workflow/engine/bin/cron.php
When done editing the cron file, the contents will be stored in the location /var/spool/cron/crontabs/user, such as /var/spool/cron/crontabs/apache in Red Hat/CentOS or /var/spool/cron/crontabs/www-data in Debian. If the cron daemon is running on the server, then the ProcessMaker cron scripts should be periodically executed at the scheduled times.

Maybe try increasing your thread stack size? Seems[…]

I use PM 3.4. Android push works while IOS push do[…]

[quote=ziadeh post_id=823031 time=1550759948 user_[…]

I have to support reports in processmaker 3.4. A s[…]