1C-Bitrix
25.700.0
Загрузка...
Поиск...
Не найдено
templatesscheme.php
См. документацию.
1
<?php
2
3
namespace
Bitrix\Bizproc\Automation\Engine;
4
5
use Bitrix\Main\Error;
6
use Bitrix\Main\Localization\Loc;
7
use Bitrix\Main\Result;
8
9
abstract
class
TemplatesScheme
10
{
11
public
const
ERROR_CODE_MISSING_TEMPLATE_ERROR
=
'TEMPLATES_SCHEME_ERROR_CODE_TEMPLATE_ERROR'
;
12
public
const
ERROR_CODE_GETTING_TEMPLATE_ERROR
=
'TEMPLATES_SCHEME_ERROR_CODE_TEMPLATE_ERROR'
;
13
15
private
$scheme = [];
16
17
public
function
isAutomationAvailable
(
array
$complexDocumentType): bool
18
{
19
return
true
;
20
}
21
22
public
function
addTemplate
(
TemplateScope
$scope)
23
{
24
$this->scheme[$scope->
getId
()] = $scope;
25
}
26
27
public
function
getTemplate
(
TemplateScope
$scope): ?
Template
28
{
29
if
($this->
hasTemplate
($scope))
30
{
31
return
new
Template
($scope->
getComplexDocumentType
(), $scope->
getStatusId
());
32
}
33
34
return
null
;
35
}
36
37
public
function
toArray
():
array
38
{
39
$scheme = [];
40
foreach
($this->scheme as $scopeId => $scope)
41
{
42
$scheme[$scopeId] = $scope->toArray();
43
}
44
45
return
$scheme;
46
}
47
48
protected
function
hasTemplate
(
TemplateScope
$scope): bool
49
{
50
return
isset($this->scheme[$scope->
getId
()]);
51
}
52
53
public
function
createTemplatesTunnel
(
TemplateScope
$srcScope,
TemplateScope
$dstScope):
Result
54
{
55
$result
=
new
Result
();
56
if
(!$this->
hasTemplate
($srcScope) || !$this->
hasTemplate
($dstScope))
57
{
58
$errorMessage
= Loc::getMessage(
'BIZPROC_AUTOMATION_SCHEME_TEMPLATE_ERROR'
);
59
$result
->addError(
new
Error
(
$errorMessage
, self::ERROR_CODE_MISSING_TEMPLATE_ERROR));
60
}
61
62
$srcTemplate = $srcScope->
getTemplate
();
63
$dstTemplate = $dstScope->
getTemplate
();
64
65
if
(
66
is_null($srcTemplate)
67
|| is_null($dstTemplate)
68
)
69
{
70
$errorMessage
= Loc::getMessage(
'BIZPROC_AUTOMATION_SCHEME_TEMPLATE_ERROR'
);
71
$result
->addError(
new
Error
(
$errorMessage
, self::ERROR_CODE_GETTING_TEMPLATE_ERROR));
72
}
73
elseif
(
$result
->isSuccess())
74
{
75
$result
->setData([
'templatesTunnel'
=>
new
TemplatesTunnel
($srcTemplate, $dstTemplate)]);
76
}
77
78
return
$result
;
79
}
80
81
abstract
public
function
build
(): void;
82
}
Bitrix\Bizproc\Automation\Engine\Template
Определения
template.php:22
Bitrix\Bizproc\Automation\Engine\TemplateScope
Определения
templatescope.php:11
Bitrix\Bizproc\Automation\Engine\TemplateScope\getId
getId()
Определения
templatescope.php:62
Bitrix\Bizproc\Automation\Engine\TemplateScope\getStatusId
getStatusId()
Определения
templatescope.php:92
Bitrix\Bizproc\Automation\Engine\TemplateScope\getTemplate
getTemplate()
Определения
templatescope.php:33
Bitrix\Bizproc\Automation\Engine\TemplateScope\getComplexDocumentType
getComplexDocumentType()
Определения
templatescope.php:82
Bitrix\Bizproc\Automation\Engine\TemplatesScheme
Определения
templatesscheme.php:10
Bitrix\Bizproc\Automation\Engine\TemplatesScheme\ERROR_CODE_GETTING_TEMPLATE_ERROR
const ERROR_CODE_GETTING_TEMPLATE_ERROR
Определения
templatesscheme.php:12
Bitrix\Bizproc\Automation\Engine\TemplatesScheme\isAutomationAvailable
isAutomationAvailable(array $complexDocumentType)
Определения
templatesscheme.php:17
Bitrix\Bizproc\Automation\Engine\TemplatesScheme\ERROR_CODE_MISSING_TEMPLATE_ERROR
const ERROR_CODE_MISSING_TEMPLATE_ERROR
Определения
templatesscheme.php:11
Bitrix\Bizproc\Automation\Engine\TemplatesScheme\build
build()
Bitrix\Bizproc\Automation\Engine\TemplatesScheme\hasTemplate
hasTemplate(TemplateScope $scope)
Определения
templatesscheme.php:48
Bitrix\Bizproc\Automation\Engine\TemplatesScheme\createTemplatesTunnel
createTemplatesTunnel(TemplateScope $srcScope, TemplateScope $dstScope)
Определения
templatesscheme.php:53
Bitrix\Bizproc\Automation\Engine\TemplatesScheme\toArray
toArray()
Определения
templatesscheme.php:37
Bitrix\Bizproc\Automation\Engine\TemplatesScheme\addTemplate
addTemplate(TemplateScope $scope)
Определения
templatesscheme.php:22
Bitrix\Bizproc\Automation\Engine\TemplatesScheme\getTemplate
getTemplate(TemplateScope $scope)
Определения
templatesscheme.php:27
Bitrix\Bizproc\Automation\Engine\TemplatesTunnel
Определения
templatestunnel.php:10
Bitrix\Main\Error
Определения
error.php:15
array
</td ></tr ></table ></td ></tr >< tr >< td class="bx-popup-label bx-width30"><?=GetMessage("PAGE_NEW_TAGS")?> array( $site)
Определения
file_new.php:804
$result
$result
Определения
get_property_values.php:14
$errorMessage
while($arParentIBlockProperty=$dbParentIBlockProperty->Fetch()) $errorMessage
Определения
iblock_subelement_generator.php:275
Bitrix\Bizproc\Result
Определения
DeviceResultHandler.php:3
elseif
if( $daysToExpire >=0 &&$daysToExpire< 60 elseif)( $daysToExpire< 0)
Определения
prolog_main_admin.php:393
bitrix
modules
bizproc
lib
automation
engine
templatesscheme.php
Создано системой
1.14.0