Ответ на вопрос «какие значения можно использовать внутри шаблона бизнес-процесса» можно получить, изучив исходный код метода CBPActivity::GetRealParameterValue($objectName, $fieldName, &$result)
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 |
private function GetRealParameterValue($objectName, $fieldName, &$result) { $return = false; if ($objectName == "Document") { $rootActivity = $this->GetRootActivity(); $documentId = $rootActivity->GetDocumentId(); $documentService = $this->workflow->GetService("DocumentService"); $document = $documentService->GetDocument($documentId); if (array_key_exists($fieldName, $document)) { $result = $document[$fieldName]; $return = true; } } elseif ($objectName == "Template") { $rootActivity = $this->GetRootActivity(); if (substr($fieldName, -strlen("_printable")) == "_printable") { $fieldNameTmp = substr($fieldName, 0, strlen($fieldName) - strlen("_printable")); $result = $rootActivity->{$fieldNameTmp}; $rootActivity = $this->GetRootActivity(); $documentId = $rootActivity->GetDocumentId(); $documentService = $this->workflow->GetService("DocumentService"); $result = $documentService->GetFieldValuePrintable($documentId, $fieldNameTmp, $rootActivity->arPropertiesTypes[$fieldNameTmp]["Type"], $result, $rootActivity->arPropertiesTypes[$fieldNameTmp]); if (is_array($result)) $result = implode(", ", $result); } else { $result = $rootActivity->{$fieldName}; } $return = true; } elseif ($objectName == "Variable") { $rootActivity = $this->GetRootActivity(); if (substr($fieldName, -strlen("_printable")) == "_printable") { $fieldNameTmp = substr($fieldName, 0, strlen($fieldName) - strlen("_printable")); $result = $rootActivity->GetVariable($fieldNameTmp); $rootActivity = $this->GetRootActivity(); $documentId = $rootActivity->GetDocumentId(); $documentService = $this->workflow->GetService("DocumentService"); $result = $documentService->GetFieldValuePrintable($documentId, $fieldNameTmp, $rootActivity->arVariablesTypes[$fieldNameTmp]["Type"], $result, $rootActivity->arVariablesTypes[$fieldNameTmp]); if (is_array($result)) $result = implode(", ", $result); } else { $result = $rootActivity->GetVariable($fieldName); } $return = true; } elseif ($objectName == "Workflow") { $result = $this->GetWorkflowInstanceId(); $return = true; } elseif ($objectName == "User") { $result = 0; if ($GLOBALS["USER"]->IsAuthorized()) $result = "user_".$GLOBALS["USER"]->GetID(); $return = true; } elseif ($objectName == "System") { global $DB; $result = null; if ($fieldName == "Now") $result = date($DB->DateFormatToPHP(CSite::GetDateFormat("FULL"))); elseif ($fieldName == "Date") $result = date($DB->DateFormatToPHP(CSite::GetDateFormat("SHORT"))); if ($result !== null) $return = true; } elseif ($objectName) { $activity = $this->workflow->GetActivityByName($objectName); if ($activity) { // _printable is not supported because mapping between activity property types // and document property types is not supported $result = $activity->{$fieldName}; $return = true; } } return $return; } |
Итого получим табличку
{=Document:?} |
Недоступно получение «_printable»-значений Если значение — массив, то оно преобразуется в строку через запятую. Это проявляется для свойств инфоблока с типом «HTML/Текст». |
{=Template:?} | Доступно получение «_printable»-значений |
{=Variable:?} | Доступно получение «_printable»-значений |
{=Workflow} | ID бизнес-процесса в формате «511cb357458d85.98117228» |
{=User} | Текущий пользователь в формате «user_ID» |
{=System:?} |
{=System:Now} — текущая дата со временем {=System:Date} — текущая дата |
{=?:?} | {=ActivityName:ActivityMember} |