Questions and discussion about developing processes and programming in PHP, JavaScript, web services & REST API.
Forum rules: Please search to see if a question has already asked before creating a new topic. Please don't post the same question in multiple forums.
#822634
To start new cases automatically, you can create a process which has a Start Timer Event:
processWithStartTimerEvent.png
processWithStartTimerEvent.png (15.49 KiB) Viewed 3089 times

Set the "Properties" of the Start Timer Event for how often you want the new case to start. For example:
timerEventProperties.png
timerEventProperties.png (54.69 KiB) Viewed 3089 times

Then, set the timereventcron.php script to periodically execute on your ProcessMaker server. See: https://wiki.processmaker.com/3.2/Executing_cron.php

Another way to do it, is to create a separate process which loops periodically to execute a script task. The script task will
execute a trigger which calls PMFNewCase() and PMFPauseCase().

For example, here is the looping process that runs forever:
endlessLoopProcess.png
endlessLoopProcess.png (25.21 KiB) Viewed 3089 times

Then, the following trigger is executed by the script task:
Code: Select all
$processId   = '6772746095c4ece126bd7a8016893611'; 
$firstTaskId = '5280627375c4ece3ed269e6050127087';
$userId      = '00000000000000000000000000000001';

$caseId = PMFNewCase($processId, $userId, $taskId, array());

if (!empty($caseId)) {
	//pause the new case until the end of the month:
	$endOfMonth = date("Y-m-t 08:00:00"); //ex: "2019-01-31 08:00:00"
	@@ret = PMFPauseCase($caseId, 1, $userId, $endOfMonth);
}
Here is the process:
(38.06 KiB) Downloaded 266 times
Remember to set timereventcron.php to periodically execute on your ProcessMaker server, so that the process will loop. You can start one case and let it run forever.

If you need to find cases to pause, then your trigger can use executeQuery() to search the APPLICATION or APP_CACHE_VIEW tables for cases.
#822650
Hi Amos,

Timer Event Cron works when I work it in "command prompt", but It doesn't work when I make it in "task timer". Actually it works in task timer but I can't see it in cron file in logs. When I work it in "command prompt", I can see it in cron in logs.
Attachments
4.PNG
4.PNG (18.75 KiB) Viewed 3081 times
3.PNG
3.PNG (89.59 KiB) Viewed 3081 times
#822663
Did you add C:\Bitnami\processmaker-3.X.X-X\php\ to your system's Path environment variable, as explained in the documentation? Bitnami installs don't execute the ProcessMaker cron scripts correctly if php.exe's directory isn't in the Path.

Then, the command in your Windows Scheduled Task should be:
php.exe C:\Bitnami\processmaker-3.X.X-X\apps\processmaker\htdocs\workflow\engine\bin\cron.php

DO we have to pay tax for trade https://www.getfir[…]

Mosquito Zapper Reviews

https://www.facebook.com/sammosquitozapper https:[…]

https://www.facebook.com/sammosquitozapper https:[…]

Are you looking for a simple method to import EML […]