Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
25 commits
Select commit Hold shift + click to select a range
6b33eaf
Set default MESSAGE_BROKER_DRIVER for phpunittests
caleeli Jun 22, 2023
929eafc
Refactor triggerBoundaryEvent
caleeli Jun 22, 2023
f92b3b7
Fix typo
caleeli Jun 22, 2023
7d6024e
Fix version id for bpmn actions
caleeli Jun 23, 2023
be80665
Refactor of throwMessageEvent
caleeli Jun 23, 2023
85f0771
Implementation of Task Scheduler-Nayra
caleeli Jun 27, 2023
04fc467
Run default engine for assignment process
caleeli Jun 27, 2023
619238d
Fix duplicated route name
caleeli Jun 27, 2023
9ce1d8d
Merge remote-tracking branch 'origin/develop' into FOUR-8560
caleeli Jun 27, 2023
8d6b61b
Merge remote-tracking branch 'origin/FOUR-8177' into FOUR-8560
caleeli Jun 27, 2023
e3a7ebd
Merge pull request #4916 from ProcessMaker/FOUR-8560
caleeli Jun 27, 2023
8964b8a
Fix issue getting version id
caleeli Jun 28, 2023
cfda7de
Merge pull request #4920 from ProcessMaker/FOUR-8559
caleeli Jun 28, 2023
5863f6f
Merge remote-tracking branch 'origin/develop' into FOUR-8177
caleeli Jun 28, 2023
253f4db
FOUR-8556 Refactor runServiceTask function to use Nayra BPMN engine
julceslauhub Jun 29, 2023
f3bb520
Merge pull request #4939 from ProcessMaker/FOUR-8556
caleeli Jun 30, 2023
8e8208d
Implement Signals with NayraService
caleeli Jul 3, 2023
794d6ef
Fix sync dispatch of throwSignalEventRequest
caleeli Jul 3, 2023
889848e
Validate rabbitmq port
caleeli Jul 3, 2023
f1f53c3
Validate rabbitmq port
caleeli Jul 3, 2023
950bad1
move column next to the collaboration id
caleeli Jul 5, 2023
0b83f74
Improve upgrade script
caleeli Jul 5, 2023
aae29ea
Fix code
caleeli Jul 5, 2023
23b383e
Merge pull request #4951 from ProcessMaker/FOUR-8557
caleeli Jul 5, 2023
80f6113
Check invalid environment variable
caleeli Jul 5, 2023
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
2 changes: 2 additions & 0 deletions ProcessMaker/Facades/WorkflowManager.php
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,8 @@
* @method static mixed runServiceTask(\ProcessMaker\Nayra\Contracts\Bpmn\ServiceTaskInterface $serviceTask, Token $token)
* @method static void throwSignalEventDefinition(\ProcessMaker\Nayra\Contracts\Bpmn\EventDefinitionInterface $sourceEventDefinition, \ProcessMaker\Nayra\Contracts\Bpmn\TokenInterface $token)
* @method static void throwSignalEvent($signalRef, array $data = [], array $exclude = [])
* @method static void throwSignalEventProcess($processId, $signalRef, array $data)
* @method static void throwSignalEventRequest(\ProcessMaker\Models\ProcessRequest $request, $signalRef, array $data)
* @method static void throwMessageEvent($instanceId, $elementId, $messageRef, array $payload = [])
* @method static void onDataValidation(callable $callback)
* @method static void validateData(array $data, $definitions, $element)
Expand Down
2 changes: 1 addition & 1 deletion ProcessMaker/Jobs/BoundaryEvent.php
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ public function action(BpmnDocumentInterface $definitions, TokenInterface $token
}

/**
* Updata data for a message event
* Update data for a message event
*
* If variableName is set, then the event payload will be set to that variable name.
* If the data name exists, then the data is merged.
Expand Down
5 changes: 3 additions & 2 deletions ProcessMaker/Jobs/CatchSignalEventRequest.php
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
use Illuminate\Contracts\Queue\ShouldQueue;
use Illuminate\Foundation\Bus\Dispatchable;
use Illuminate\Queue\InteractsWithQueue;
use ProcessMaker\Facades\WorkflowManager;
use ProcessMaker\Models\ProcessRequest;

class CatchSignalEventRequest implements ShouldQueue
Expand Down Expand Up @@ -34,10 +35,10 @@ public function __construct($chunck, $signalRef, $payload)

public function handle()
{
$this->payload = unpackTemporalData($this->payload_uid);
$payload = unpackTemporalData($this->payload_uid);
foreach ($this->chunck as $requestId) {
$request = ProcessRequest::find($requestId);
CatchSignalEventInRequest::dispatchNow($request, $this->payload, $this->signalRef);
WorkflowManager::throwSignalEventRequest($request, $this->signalRef, $payload);
}
removeTemporalData($this->payload_uid);
}
Expand Down
5 changes: 3 additions & 2 deletions ProcessMaker/Jobs/ThrowSignalEvent.php
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
use Illuminate\Contracts\Queue\ShouldQueue;
use Illuminate\Foundation\Bus\Dispatchable;
use Illuminate\Queue\InteractsWithQueue;
use ProcessMaker\Facades\WorkflowManager;
use ProcessMaker\Models\Process;
use ProcessMaker\Models\ProcessRequest;

Expand Down Expand Up @@ -47,11 +48,11 @@ public function handle()
->pluck('id')
->toArray();
foreach ($processes as $process) {
CatchSignalEventProcess::dispatch(
WorkflowManager::throwSignalEventProcess(
$process,
$this->signalRef,
$this->data
)->onQueue('bpmn');
);
}
$count = ProcessRequest::whereNotIn('id', $this->excludeRequests)
->where('status', 'ACTIVE')
Expand Down
9 changes: 8 additions & 1 deletion ProcessMaker/Models/EnvironmentVariable.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

namespace ProcessMaker\Models;

use Illuminate\Support\Facades\Log;
use Illuminate\Validation\Rule;
use ProcessMaker\Traits\Exportable;

Expand Down Expand Up @@ -53,7 +54,13 @@ public function setValueAttribute($value)
*/
public function getValueAttribute()
{
return decrypt($this->attributes['value']);
try {
return decrypt($this->attributes['value']);
} catch (\Exception $e) {
Log::error('EnvironmentVariable: ' . $this->attributes['value']. "\n" . $e->getMessage());
Log::error($e->getTraceAsString());
return null;
}
}

public static function rules($existing = null)
Expand Down
3 changes: 2 additions & 1 deletion ProcessMaker/Models/Process.php
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@
use ProcessMaker\Nayra\Contracts\Bpmn\ServiceTaskInterface;
use ProcessMaker\Nayra\Contracts\Bpmn\StartEventInterface;
use ProcessMaker\Nayra\Contracts\Storage\BpmnDocumentInterface;
use ProcessMaker\Nayra\Managers\WorkflowManagerDefault;
use ProcessMaker\Nayra\Storage\BpmnDocument;
use ProcessMaker\Package\WebEntry\Models\WebentryRoute;
use ProcessMaker\Rules\BPMNValidation;
Expand Down Expand Up @@ -584,7 +585,7 @@ private function scalateToManagerIfEnabled($user, $activity, $token, $assignment
if ($escalateToManager) {
$user = WorkflowUserManager::escalateToManager($token, $user);
} else {
$res = WorkflowManager::runProcess($assignmentProcess, 'assign', [
$res = (new WorkflowManagerDefault)->runProcess($assignmentProcess, 'assign', [
'user_id' => $user,
'process_id' => $this->id,
'request_id' => $token->getInstance()->getId(),
Expand Down
4 changes: 4 additions & 0 deletions ProcessMaker/Models/ProcessCollaboration.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@

namespace ProcessMaker\Models;

use ProcessMaker\Traits\HasUuids;

/**
* Represents an Eloquent model of a Request which is an instance of a Process.
*
Expand All @@ -12,6 +14,8 @@
*/
class ProcessCollaboration extends ProcessMakerModel
{
use HasUuids;

protected $connection = 'processmaker';

/**
Expand Down
1 change: 1 addition & 0 deletions ProcessMaker/Models/ProcessRequest.php
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,7 @@
* @property string $name
* @property string $status
* @property string $data
* @property string $collaboration_uuid
* @property \Carbon\Carbon $initiated_at
* @property \Carbon\Carbon $completed_at
* @property \Carbon\Carbon $updated_at
Expand Down
36 changes: 36 additions & 0 deletions ProcessMaker/Nayra/Managers/WorkflowManagerDefault.php
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,8 @@
use ProcessMaker\Jobs\BoundaryEvent;
use ProcessMaker\Jobs\CallProcess;
use ProcessMaker\Jobs\CatchEvent;
use ProcessMaker\Jobs\CatchSignalEventInRequest;
use ProcessMaker\Jobs\CatchSignalEventProcess;
use ProcessMaker\Jobs\CompleteActivity;
use ProcessMaker\Jobs\RunScriptTask;
use ProcessMaker\Jobs\RunServiceTask;
Expand All @@ -18,6 +20,7 @@
use ProcessMaker\Jobs\ThrowSignalEvent;
use ProcessMaker\Models\FormalExpression;
use ProcessMaker\Models\Process as Definitions;
use ProcessMaker\Models\ProcessRequest;
use ProcessMaker\Models\ProcessRequestToken as Token;
use ProcessMaker\Nayra\Contracts\Bpmn\BoundaryEventInterface;
use ProcessMaker\Nayra\Contracts\Bpmn\EntityInterface;
Expand All @@ -29,6 +32,7 @@
use ProcessMaker\Nayra\Contracts\Bpmn\ThrowEventInterface;
use ProcessMaker\Nayra\Contracts\Bpmn\TokenInterface;
use ProcessMaker\Nayra\Contracts\Engine\ExecutionInstanceInterface;
use ProcessMaker\Repositories\DefinitionsRepository;

class WorkflowManagerDefault implements WorkflowManagerInterface
{
Expand Down Expand Up @@ -255,6 +259,38 @@ public function throwSignalEvent($signalRef, array $data = [], array $exclude =
ThrowSignalEvent::dispatch($signalRef, $data, $exclude)->onQueue('bpmn');
}

/**
* Throw a signal event by signalRef into a specific process.
*
* @param int $process
* @param string $signalRef
* @param array $data
*/
public function throwSignalEventProcess($processId, $signalRef, array $data)
{
CatchSignalEventProcess::dispatch(
$processId,
$signalRef,
$data
)->onQueue('bpmn');
}

/**
* Throw a signal event by signalRef into a specific request.
*
* @param ProcessRequest $request
* @param string $signalRef
* @param array $data
*/
public function throwSignalEventRequest(ProcessRequest $request, $signalRef, array $data)
{
CatchSignalEventInRequest::dispatchSync(
$request,
$data,
$signalRef
);
}

/**
* Catch a signal event.
*
Expand Down
Loading