Hello iliusha,
You can achieve this by calling your trigger from a script, which can be scheduled to run periodically on your server. Create the following script on your ProcessMaker server:
Code: Select all<?php
$serverAddress = "http://example.com"; //set to the server's address
$workspace = 'workflow'; //set to the workspace which is 'workflow' by default
$user = 'admin'; //set to user who is assigned to a case in the process to run trigger
$password = 'p4sSw0rD'; //set to password of the user
$caseId = 'XXXXXXXXXXXXXXXXXXXXXXXXXXXX'; //set to case's ID
$triggerId = 'XXXXXXXXXXXXXXXXXXXXXXXXXXXX'; //set to the trigger's ID
ini_set("soap.wsdl_cache_enabled", "0");
ini_set('error_reporting', E_ALL);
ini_set('display_errors', True);
$client = new SoapClient("$serverAddress/sys$workspace/en/neoclassic/services/wsdl2");
$params = array(array('userid'=>$user, 'password'=>$password));
$result = $client->__SoapCall('login', $params);
if ($result->status_code == 0)
$sessionId = $result->message;
else
print "Unable to connect to ProcessMaker.\nError Number: $result->status_code\n" .
"Error Message: $result->message\n";
#look up the caseId and delIndex with the caseList() web service and the triggerIndex in MySQL
$params = array(array(
'sessionId' => $sessionId,
'caseId' => $caseId,
'triggerIndex' => $triggerId,
'delIndex' => '1' //assuming first task in case
));
$result = $client->__SoapCall('executeTrigger', $params);
if ($result->status_code != 0)
print "Error: $result->message \n";
else
print_r($result);
?>
Now follow these steps:
1. Edit your process to enable the Debug Mode.
2. Start a case in your process, but do not complete it.
3. Note down the Case ID from the debug mode.
4. Open your process and note down the Trigger UID of the trigger.
5. Replace these values in your script task.
6. Save the script and test it by executing the following command:
Code: Select allphp -f /opt/processmaker-3/shared/script.php
7. If it works perfectly, edit your crontab file /etc/crontab, add the following line:
Code: Select all0 1 * * * root php -f /opt/processmaker-3/shared/script.php
In my case, script.php is located in /opt/processmaker-3/shared directory
Hope this helps.
Best Regards,
Zainab Sabunwala