Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
17 commits
Select commit Hold shift + click to select a range
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@ storage/ssl
storage/api/*
storage/data-sources/logs/*
storage/decision-tables/*
storage/saved_search_advanced_configuration/*
npm.sh
laravel-echo-server.lock
public/.htaccess
Expand Down
41 changes: 38 additions & 3 deletions ProcessMaker/Managers/TaskSchedulerManager.php
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
use Illuminate\Support\Facades\DB;
use Illuminate\Support\Facades\Log;
use Illuminate\Support\Facades\Schema;
use InvalidArgumentException;
use Illuminate\Support\Str;
use PDOException;
use ProcessMaker\Facades\WorkflowManager;
Expand Down Expand Up @@ -201,10 +202,11 @@ private function processTaskWithAtomicClaim(ScheduledTask $task, DateTime $today
{
try {
$config = json_decode($task->configuration);
$lastExecution = new DateTime($task->last_execution, new DateTimeZone('UTC'));

if ($lastExecution === null) {
return;
// SCHEDULED_JOB rows use last_execution = null until first run; BPMN timers always set last_execution.
$lastExecution = null;
if ($task->last_execution !== null && $task->last_execution !== '') {
$lastExecution = new DateTime($task->last_execution, new DateTimeZone('UTC'));
}

$owner = $task->processRequestToken ?: $task->processRequest ?: $task->process;
Expand Down Expand Up @@ -688,6 +690,9 @@ public function scheduleCycle(
*/
public function scheduleCycleJob($interval, array $config): ScheduledTask
{
if (!isset($config['job'])) {
throw new InvalidArgumentException('$config["job"] is required');
}
$configuration = [
'type' => 'TimeCycle',
'interval' => $interval,
Expand All @@ -704,6 +709,36 @@ public function scheduleCycleJob($interval, array $config): ScheduledTask
return $scheduledTask;
}

/**
* Schedule a job for a specific datetime
*
* @param string $datetime in ISO-8601 format
* @param array $config configuration
*
* @return ScheduledTask
*/
public function scheduleDateJob($datetime, array $config): ScheduledTask
{
if (!isset($config['job'])) {
throw new InvalidArgumentException('$config["job"] is required');
}

// Must use "interval" so nextDate(TimeDate) picks up the target datetime (same shape as BPMN timer tasks).
$configuration = [
'type' => 'TimeDate',
...$config,
'interval' => $datetime,
];

$scheduledTask = new ScheduledTask();
$scheduledTask->configuration = json_encode($configuration);
$scheduledTask->type = 'SCHEDULED_JOB';
$scheduledTask->last_execution = null;
$scheduledTask->save();

return $scheduledTask;
}

/**
* Schedule a job execution after a time duration for the given BPMN element,
* event definition and an optional Token object
Expand Down
4 changes: 2 additions & 2 deletions composer.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "processmaker/processmaker",
"version": "2026.9.3",
"version": "2026.9.4-RC1",
"description": "BPM PHP Software",
"keywords": [
"php bpm processmaker"
Expand Down Expand Up @@ -176,7 +176,7 @@
"package-product-analytics": "1.5.11",
"package-projects": "1.12.9",
"package-rpa": "1.1.2",
"package-savedsearch": "1.43.13",
"package-savedsearch": "1.43.12-RC1",
"package-slideshow": "1.4.3",
"package-smart-extract": "0.0.6",
"package-signature": "1.15.5",
Expand Down
7 changes: 7 additions & 0 deletions config/filesystems.php
Original file line number Diff line number Diff line change
Expand Up @@ -136,6 +136,13 @@
// Others declared in packages
// - translations - package-translations
// - 'filesystems.disks.install' configured on the fly

'saved_search_advanced_configuration' => [
'driver' => 'local',
'root' => storage_path('saved_search_advanced_configuration'),
'url' => env('APP_URL') . '/storage/saved_search_advanced_configuration',
'visibility' => 'private',
],
],

/*
Expand Down
4 changes: 2 additions & 2 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@processmaker/processmaker",
"version": "2026.9.3",
"version": "2026.9.4-RC1",
"description": "ProcessMaker 4",
"author": "DevOps <devops@processmaker.com>",
"license": "ISC",
Expand Down
Loading