diff --git a/.gitignore b/.gitignore index 7a47d39bab..8d89feb4b6 100644 --- a/.gitignore +++ b/.gitignore @@ -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 diff --git a/ProcessMaker/Managers/TaskSchedulerManager.php b/ProcessMaker/Managers/TaskSchedulerManager.php index 10e26e4fd4..a158118e37 100644 --- a/ProcessMaker/Managers/TaskSchedulerManager.php +++ b/ProcessMaker/Managers/TaskSchedulerManager.php @@ -13,6 +13,7 @@ use Illuminate\Support\Facades\Log; use Illuminate\Support\Facades\Schema; use Illuminate\Support\Str; +use InvalidArgumentException; use PDOException; use ProcessMaker\Facades\WorkflowManager; use ProcessMaker\Jobs\StartEventConditional; @@ -203,10 +204,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; @@ -888,6 +890,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, @@ -904,6 +909,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 diff --git a/composer.json b/composer.json index 27aa31c9d9..234686ee80 100644 --- a/composer.json +++ b/composer.json @@ -1,6 +1,6 @@ { "name": "processmaker/processmaker", - "version": "2026.12.1", + "version": "2026.12.1+26166", "description": "BPM PHP Software", "keywords": [ "php bpm processmaker" @@ -178,7 +178,7 @@ "package-product-analytics": "1.5.11", "package-projects": "1.12.9", "package-rpa": "1.1.2", - "package-savedsearch": "1.43.14", + "package-savedsearch": "dev-feature/FOUR-26166", "package-slideshow": "1.4.3", "package-smart-extract": "1.0.0", "package-signature": "1.15.6", diff --git a/config/filesystems.php b/config/filesystems.php index 809b4718f7..3fa45d5637 100644 --- a/config/filesystems.php +++ b/config/filesystems.php @@ -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', + ], ], /* diff --git a/package.json b/package.json index dc8db21e4c..75b35fb880 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@processmaker/processmaker", - "version": "2026.12.1", + "version": "2026.12.1+26166", "description": "ProcessMaker 4", "author": "DevOps ", "license": "ISC",