Bitrix-D7 23.9
 
Загрузка...
Поиск...
Не найдено
deletestepper.php
1<?php
2
4
6
8{
9 protected static $moduleId = 'bizproc';
10 private static $delay = 0;
11
12 private const STEP_ROWS_LIMIT = 10;
13
14 public function execute(array &$option)
15 {
16 $documentId = $this->getOuterParams();
17 $ids = \CBPStateService::getIdsByDocument($documentId, self::STEP_ROWS_LIMIT);
18
19 if (empty($ids))
20 {
21 \CBPHistoryService::DeleteByDocument($documentId);
23 }
24
25 foreach ($ids as $id)
26 {
27 \CBPDocument::killWorkflow($id, false);
28 }
29
31 }
32
33 public static function bindDocument(array $documentId): void
34 {
35 $ids = \CBPStateService::getIdsByDocument($documentId, 1);
36 if (empty($ids))
37 {
38 return;
39 }
40
41 self::$delay += 60;
42 static::bind(self::$delay, $documentId);
43 }
44}