Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
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 @@ -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;
Expand Down Expand Up @@ -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;
Expand Down Expand Up @@ -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,
Expand All @@ -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
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.12.1",
"version": "2026.12.1+26166",
"description": "BPM PHP Software",
"keywords": [
"php bpm processmaker"
Expand Down Expand Up @@ -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",
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
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.12.1",
"version": "2026.12.1+26166",
"description": "ProcessMaker 4",
"author": "DevOps <devops@processmaker.com>",
"license": "ISC",
Expand Down
Loading