200 if (!is_array($this->currentValues))
203 $this->currentValues = [];
204 $currentActivity = \CBPWorkflowTemplateLoader::findActivityByName(
209 if (is_array($currentActivity) && isset($currentActivity[
'Properties']) && is_array($currentActivity[
'Properties']))
212 foreach ($map as $id => $property)
214 if (!isset($property[
'FieldName']))
217 $this->currentValues[$property[
'FieldName']] =
null;
219 if (isset($currentActivity[
'Properties'][$id]))
222 isset($property[
'Getter'])
223 && is_callable($property[
'Getter'])
224 && $property[
'Getter'] instanceof \Closure
227 $getter = $property[
'Getter'];
228 $property[
'Id'] = $id;
229 $this->currentValues[$property[
'FieldName']] = $getter($this, $property, $currentActivity, $compatible);
233 $this->currentValues[$property[
'FieldName']] = $currentActivity[
'Properties'][$id];
239 $this->currentValues[$property[
'FieldName']] ===
null
241 $this->currentValues[$property[
'FieldName']] ===
''
243 && isset($property[
'Default'])
246 $this->currentValues[$property[
'FieldName']] = $property[
'Default'];
252 if ($compatible && $this->currentValues)
256 foreach ($this->
getMap() as $id => $property)
258 if (!isset($property[
'FieldName']))
263 if (isset($property[
'Type']) && $property[
'Type'] ===
FieldType::USER && !isset($property[
'Getter']))
265 $compatibleValues[$property[
'FieldName']] = \CBPHelper::usersArrayToString(
266 $compatibleValues[$property[
'FieldName']],
273 return $compatibleValues;
449 if ($this->renderer !==
null)
451 return (
string)call_user_func($this->renderer, $this);
454 $runtime = \CBPRuntime::getRuntime();
455 $runtime->startRuntime();
457 return (
string)$runtime->executeResourceFile(
459 $this->dialogFileName,
464 'arCurrentValues' => $this->
getCurrentValues($this->dialogFileName ===
'properties_dialog.php'),