28 $session = Session\Manager::getActiveSession();
30 foreach ($session->getWorkflowContexts() as $workflowContext)
32 if ($workflowContext->getWorkflowId() === $workflowId)
34 $template = Template::createByTpl($workflowContext->fillTemplateShards()->fillTemplate());
42 foreach ($template->getRobots() as $robot)
44 if ($robot->getDelayName() === $eventName)
46 $robotId = $robot->getName();
52 $this->pushEvent(
'workflowEventAdd', [
53 'workflowId' => $workflowId,
54 'eventName' => $eventName,
55 'sourceId' => $robotId,
69 $documentId = Session\Manager::getActiveSession()->getFixedDocument()->getParameterDocumentId();
70 $documentType = Session\Manager::getActiveSession()->getParameterDocumentType();
72 $documentService = \CBPRuntime::GetRuntime(
true)->getDocumentService();
73 $documentFields = $documentService->getDocumentFields($documentType);
74 $lazyList = $documentService->GetDocument($documentId);
78 $changedFields[] =
'DATE_MODIFY';
81 if (in_array(
'ASSIGNED_BY_ID', $changedFields))
83 $changedFields[] =
'ASSIGNED_BY_EMAIL';
84 $changedFields[] =
'ASSIGNED_BY_WORK_PHONE';
85 $changedFields[] =
'ASSIGNED_BY_PERSONAL_MOBILE';
88 foreach ($changedFields as $fieldId)
90 $property = $documentFields[$fieldId] ??
null;
97 $fieldType = $documentService->getFieldTypeObject($documentType, $property);
104 $fieldType->setDocumentId($documentId);
106 $rawValues[$fieldId] = $lazyList[$fieldId];
107 $values[$fieldId] = $fieldType->formatValue($rawValues[$fieldId]);
114 'rawValues' => $rawValues,