|
17 | 17 | use ProcessMaker\Exception\TaskDoesNotHaveUsersException; |
18 | 18 | use ProcessMaker\Exception\UserOrGroupAssignmentEmptyException; |
19 | 19 | use ProcessMaker\Nayra\Contracts\Bpmn\ActivityInterface; |
20 | | -use ProcessMaker\Nayra\Contracts\Bpmn\ProcessInterface; |
21 | 20 | use ProcessMaker\Nayra\Contracts\Bpmn\ScriptTaskInterface; |
22 | 21 | use ProcessMaker\Nayra\Contracts\Bpmn\ServiceTaskInterface; |
23 | 22 | use ProcessMaker\Nayra\Contracts\Storage\BpmnDocumentInterface; |
|
45 | 44 | * @property string $description |
46 | 45 | * @property string $name |
47 | 46 | * @property string $status |
48 | | - * @property string start_events |
| 47 | + * @property array start_events |
49 | 48 | * @property \Carbon\Carbon $updated_at |
50 | 49 | * @property \Carbon\Carbon $created_at |
51 | 50 | * |
|
65 | 64 | * @OA\Property(property="warnings", type="string"), |
66 | 65 | * @OA\Property(property="self_service_tasks", type="array", @OA\Items(type="object")), |
67 | 66 | * @OA\Property(property="signal_events", type="array", @OA\Items(type="object")), |
68 | | - |
| 67 | +
|
69 | 68 | * ), |
70 | 69 | * @OA\Schema( |
71 | 70 | * schema="Process", |
@@ -214,6 +213,7 @@ class Process extends Model implements HasMedia, ProcessModelInterface |
214 | 213 | 'warnings' => 'array', |
215 | 214 | 'self_service_tasks' => 'array', |
216 | 215 | 'signal_events' => 'array', |
| 216 | + 'conditional_events' => 'array', |
217 | 217 | ]; |
218 | 218 |
|
219 | 219 | /** |
@@ -1119,4 +1119,18 @@ public function getUpdatedStartEventsSignalEvents(): array |
1119 | 1119 |
|
1120 | 1120 | return $signalReferences->toArray(); |
1121 | 1121 | } |
| 1122 | + |
| 1123 | + /** |
| 1124 | + * Get the unique Conditional Start Events. |
| 1125 | + * |
| 1126 | + * @return array |
| 1127 | + */ |
| 1128 | + public function getUpdatedConditionalStartEvents() |
| 1129 | + { |
| 1130 | + return collect($this->start_events)->filter(function ($startEvent) { |
| 1131 | + return collect($startEvent['eventDefinitions'])->search(function ($event) { |
| 1132 | + return $event['$type'] === 'conditionalEventDefinition'; |
| 1133 | + }) !== false; |
| 1134 | + })->pluck('id'); |
| 1135 | + } |
1122 | 1136 | } |
0 commit comments