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
4 changes: 2 additions & 2 deletions ProcessMaker/Http/Controllers/Api/ScriptController.php
Original file line number Diff line number Diff line change
Expand Up @@ -192,7 +192,7 @@ public function preview(Request $request, Script $script)
$code = $request->get('code');
$nonce = $request->get('nonce');

TestScript::dispatch($script, $request->user(), $code, $data, $config, $nonce)->onQueue('bpmn');
TestScript::dispatch($script, $request->user(), $code, $data, $config, $nonce);

return ['status' => 'success'];
}
Expand Down Expand Up @@ -253,7 +253,7 @@ public function execute(Request $request, ...$scriptKey)
if ($request->get('sync') === true) {
return (new ExecuteScript($script, $request->user(), $code, $data, $watcher, $config, true))->handle();
} else {
ExecuteScript::dispatch($script, $request->user(), $code, $data, $watcher, $config)->onQueue('bpmn');
ExecuteScript::dispatch($script, $request->user(), $code, $data, $watcher, $config);
}

return ['status' => 'success', 'key' => $watcher];
Expand Down
4 changes: 2 additions & 2 deletions ProcessMaker/Jobs/CatchSignalEvent.php
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ public function handle()
$this->eventDefinition,
$this->tokenId,
$this->requestId
)->onQueue('bpmn');
);
}
$count = ProcessRequest::where('status', 'ACTIVE')
->where('id', '!=', $this->requestId);
Expand Down Expand Up @@ -104,7 +104,7 @@ public function handle()
$this->eventDefinition,
$this->tokenId,
$this->requestId
)->onQueue('bpmn');
);
}
}
}
Expand Down
1 change: 0 additions & 1 deletion ProcessMaker/Jobs/ErrorHandling.php
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,6 @@ private function requeue($job)
);
}
$newJob->delay($this->retryWaitTime());
$newJob->onQueue('bpmn');
dispatch($newJob);
}

Expand Down
1 change: 0 additions & 1 deletion ProcessMaker/Jobs/RunScriptTask.php
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,6 @@ class RunScriptTask extends BpmnAction implements ShouldQueue
*/
public function __construct(Definitions $definitions, ProcessRequest $instance, ProcessRequestToken $token, array $data, $attemptNum = 1)
{
$this->onQueue('bpmn');
$this->definitionsId = $definitions->getKey();
$this->instanceId = $instance->getKey();
$this->tokenId = $token->getKey();
Expand Down
7 changes: 3 additions & 4 deletions ProcessMaker/Jobs/RunServiceTask.php
Original file line number Diff line number Diff line change
Expand Up @@ -36,9 +36,9 @@ class RunServiceTask extends BpmnAction implements ShouldQueue
/**
* Create a new job instance.
*
* @param \ProcessMaker\Models\Process $definitions
* @param \ProcessMaker\Models\ProcessRequest $instance
* @param \ProcessMaker\Models\ProcessRequestToken $token
* @param Definitions $definitions
* @param ProcessRequest $instance
* @param ProcessRequestToken $token
* @param array $data
*/
public function __construct(Definitions $definitions, ProcessRequest $instance, ProcessRequestToken $token, array $data, $attemptNum = 1)
Expand All @@ -48,7 +48,6 @@ public function __construct(Definitions $definitions, ProcessRequest $instance,
} else {
$pmConfig = [];
}
$this->onQueue($pmConfig['queue'] ?? 'bpmn');
$this->definitionsId = $definitions->getKey();
$this->instanceId = $instance->getKey();
$this->tokenId = $token->getKey();
Expand Down
2 changes: 1 addition & 1 deletion ProcessMaker/Jobs/ThrowSignalEvent.php
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ public function handle()
$chunk,
$this->signalRef,
$this->data
)->onQueue('bpmn');
);
}
}
removeTemporalData($this->data_uid);
Expand Down
10 changes: 5 additions & 5 deletions ProcessMaker/Nayra/Managers/WorkflowManagerDefault.php
Original file line number Diff line number Diff line change
Expand Up @@ -188,7 +188,7 @@ public function runScripTask(ScriptTaskInterface $scriptTask, Token $token)
Log::info('Dispatch a script task: ' . $scriptTask->getId() . ' #' . $token->getId());
$instance = $token->processRequest;
$process = $instance->process;
RunScriptTask::dispatch($process, $instance, $token, [])->onQueue('bpmn');
RunScriptTask::dispatch($process, $instance, $token, []);
}

/**
Expand Down Expand Up @@ -266,7 +266,7 @@ public function throwSignalEventDefinition(EventDefinitionInterface $sourceEvent
$excludeProcesses = [$token->getInstance()->getModel()->process_id];

$excludeRequests = $this->getCollaboratingInstanceIds($token->getInstance());
ThrowSignalEvent::dispatch($signalRef, $data, $excludeProcesses, $excludeRequests)->onQueue('bpmn');
ThrowSignalEvent::dispatch($signalRef, $data, $excludeProcesses, $excludeRequests);
}

/**
Expand Down Expand Up @@ -298,7 +298,7 @@ protected function getCollaboratingInstanceIds($instance)
*/
public function throwSignalEvent($signalRef, array $data = [], array $exclude = [])
{
ThrowSignalEvent::dispatch($signalRef, $data, $exclude)->onQueue('bpmn');
ThrowSignalEvent::dispatch($signalRef, $data, $exclude);
}

/**
Expand All @@ -314,7 +314,7 @@ public function throwSignalEventProcess($processId, $signalRef, array $data)
$processId,
$signalRef,
$data
)->onQueue('bpmn');
);
}

/**
Expand All @@ -341,7 +341,7 @@ public function throwSignalEventRequest(ProcessRequest $request, $signalRef, arr
*/
public function throwMessageEvent($instanceId, $elementId, $messageRef, array $payload = [])
{
ThrowMessageEvent::dispatch($instanceId, $elementId, $messageRef, $payload)->onQueue('bpmn');
ThrowMessageEvent::dispatch($instanceId, $elementId, $messageRef, $payload);
}

/**
Expand Down
2 changes: 1 addition & 1 deletion ProcessMaker/Nayra/Managers/WorkflowManagerRabbitMq.php
Original file line number Diff line number Diff line change
Expand Up @@ -275,7 +275,7 @@ public function runServiceTask(ServiceTaskInterface $serviceTask, TokenInterface
// Log execution
Log::info('Dispatch a service task: ' . $serviceTask->getId());

RunNayraServiceTask::dispatch($token)->onQueue('bpmn');
RunNayraServiceTask::dispatch($token);
}

/**
Expand Down
2 changes: 1 addition & 1 deletion ProcessMaker/Nayra/Repositories/PersistenceHandler.php
Original file line number Diff line number Diff line change
Expand Up @@ -152,7 +152,7 @@ public function save(array $transaction)
$token = $this->deserializer->unserializeToken($transaction['token']);

// Trigger script task executor
RunNayraScriptTask::dispatch($token)->onQueue('bpmn');
RunNayraScriptTask::dispatch($token);
break;
default:
throw new Exception('Unknown transaction type ' . $transaction['type']);
Expand Down
2 changes: 1 addition & 1 deletion ProcessMaker/Providers/RecommendationsServiceProvider.php
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ public function register(): void

// Dispatch the job to the low-priority queue
if (RecommendationEngine::shouldGenerateFor($processRequestToken->user)) {
GenerateUserRecommendations::dispatch($processRequestToken->user_id)->onQueue('low');
GenerateUserRecommendations::dispatch($processRequestToken->user_id);
}
});
}
Expand Down
2 changes: 1 addition & 1 deletion ProcessMaker/Services/ScriptMicroserviceService.php
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ public function handle(Request $request)
$instance = ProcessRequest::find($response['metadata']['script_task']['instance_id']);
$token = ProcessRequestToken::find($response['metadata']['script_task']['token_id']);
if ($response['status'] === 'success') {
CompleteActivity::dispatch($definitions, $instance, $token, $response['output'])->onQueue('bpmn');
CompleteActivity::dispatch($definitions, $instance, $token, $response['output']);
}
}
}
Expand Down
8 changes: 3 additions & 5 deletions upgrades/2022_04_19_164837_sanitize_usernames.php
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ class SanitizeUsernames extends Upgrade
*
* @return void
*
* @throws \RuntimeException
* @throws RuntimeException
*/
public function preflightChecks()
{
Expand All @@ -39,14 +39,13 @@ public function preflightChecks()
*/
public function up()
{
DB::table('users')->select(['id','username'])->orderBy('id')->chunk(250,
DB::table('users')->select(['id', 'username'])->orderBy('id')->chunk(250,
static function ($users) {
dispatch(new SanitizeUsernamesJob($users))->onQueue('high');
dispatch(new SanitizeUsernamesJob($users));
}
);
}


/**
* Reverse the upgrade migrations.
*
Expand All @@ -57,4 +56,3 @@ public function down()
//
}
}

Loading