3namespace Bitrix\Bizproc\Workflow\Entity;
33 return 'b_bp_workflow_instance';
43 'data_type' =>
'string',
47 'data_type' =>
'string'
50 'data_type' =>
'string'
52 'DOCUMENT_ID' =>
array(
53 'data_type' =>
'string'
55 'WORKFLOW_TEMPLATE_ID' =>
array(
56 'data_type' =>
'integer'
59 'data_type' =>
'string'
61 'WORKFLOW_RO' =>
array(
62 'data_type' =>
'string'
65 'data_type' =>
'datetime'
67 'STARTED_BY' =>
array(
68 'data_type' =>
'integer'
70 'STARTED_USER' =>
array(
71 'data_type' =>
'\Bitrix\Main\UserTable',
73 '=this.STARTED_BY' =>
'ref.ID'
75 'join_type' =>
'LEFT',
77 'STARTED_EVENT_TYPE' =>
array(
78 'data_type' =>
'integer'
81 'data_type' =>
'integer'
84 'data_type' =>
'datetime'
87 'data_type' =>
'string'
89 'OWNED_UNTIL' =>
array(
90 'data_type' =>
'datetime'
93 'data_type' =>
'\Bitrix\Bizproc\Workflow\Entity\WorkflowStateTable',
95 '=this.ID' =>
'ref.ID'
97 'join_type' =>
'LEFT',
100 'data_type' =>
'\Bitrix\Bizproc\WorkflowTemplateTable',
101 'reference' =>
array(
102 '=this.WORKFLOW_TEMPLATE_ID' =>
'ref.ID'
104 'join_type' =>
'LEFT'
109 public static function exists(
string $workflowId)
111 return static::getCount([
'=ID' => $workflowId]) > 0;
116 $documentId = \CBPHelper::ParseDocumentId($documentId);
117 $rows = static::getList([
120 '=MODULE_ID' => $documentId[0],
121 '=ENTITY' => $documentId[1],
122 '=DOCUMENT_ID' => $documentId[2]
126 return array_column(
$rows,
'ID');
131 $documentId = \CBPHelper::ParseDocumentId($documentId);
132 $cnt = static::getCount([
133 '=MODULE_ID' => $documentId[0],
134 '=ENTITY' => $documentId[1],
135 '=DOCUMENT_ID' => $documentId[2]
143 $filterKeyPrefix =
count($tplIds) < 2 ?
'=' :
'@';
144 if (
count($tplIds) < 2)
146 $tplIds = reset($tplIds);
149 $rows = static::getList([
152 $filterKeyPrefix.
'WORKFLOW_TEMPLATE_ID' => $tplIds,
156 return array_column(
$rows,
'ID');
161 $firstDocumentId = \CBPHelper::parseDocumentId($paramFirstDocumentId);
162 $secondDocumentId = \CBPHelper::parseDocumentId($paramSecondDocumentId);
166 $table = $sqlHelper->forSql(static::getTableName());
168 $firstDocId = $sqlHelper->forSql($firstDocumentId[2]);
169 $firstEntity = $sqlHelper->forSql($firstDocumentId[1]);
170 $firstModule = $sqlHelper->forSql($firstDocumentId[0]);
172 $secondDocId = $sqlHelper->forSql($secondDocumentId[2]);
173 $secondEntity = $sqlHelper->forSql($secondDocumentId[1]);
174 $secondModule = $sqlHelper->forSql($secondDocumentId[0]);
178 DOCUMENT_ID = '{$firstDocId}',
179 ENTITY = '{$firstEntity}',
180 MODULE_ID = '{$firstModule}'
182 DOCUMENT_ID = '{$secondDocId}'
183 AND ENTITY = '{$secondEntity}'
184 AND MODULE_ID = '{$secondModule}'
192 $oldType = \CBPHelper::parseDocumentId($paramOldType);
193 $newType = \CBPHelper::parseDocumentId($paramNewType);
197 $table = $sqlHelper->forSql(static::getTableName());
199 $firstEntity = $sqlHelper->forSql($oldType[1]);
200 $firstModule = $sqlHelper->forSql($oldType[0]);
202 $secondEntity = $sqlHelper->forSql($newType[1]);
203 $secondModule = $sqlHelper->forSql($newType[0]);
205 $templates = implode(
",", array_map(
'intval', $workflowTemplateIds));
209 ENTITY = '{$firstEntity}',
210 MODULE_ID = '{$firstModule}'
212 ENTITY = '{$secondEntity}'
213 AND MODULE_ID = '{$secondModule}'
214 AND WORKFLOW_TEMPLATE_ID IN ({$templates})
222 $row = static::getList([
223 'select' => [
'STARTED_EVENT_TYPE'],
225 '=ID' => $workflowId,
static getIdsByDocument(array $documentId)
static countByDocument(array $documentId)
static getIdsByTemplateId(int ... $tplIds)
static mergeByDocument($paramFirstDocumentId, $paramSecondDocumentId)
static isDebugWorkflow(string $workflowId)
const LOCKED_TIME_INTERVAL
static exists(string $workflowId)
static migrateDocumentType($paramOldType, $paramNewType, $workflowTemplateIds)
static update($primary, array $data)
static getConnection($name="")
</td ></tr ></table ></td ></tr >< tr >< td class="bx-popup-label bx-width30"><?=GetMessage("PAGE_NEW_TAGS")?> array( $site)
</p ></td >< td valign=top style='border-top:none;border-left:none;border-bottom:solid windowtext 1.0pt;border-right:solid windowtext 1.0pt;padding:0cm 2.0pt 0cm 2.0pt;height:9.0pt'>< p class=Normal align=center style='margin:0cm;margin-bottom:.0001pt;text-align:center;line-height:normal'>< a name=ТекстовоеПоле54 ></a ><?=($taxRate > count( $arTaxList) > 0) ? $taxRate."%"