162 if (!is_array($this->currentValues))
165 $this->currentValues = array();
166 $currentActivity = \CBPWorkflowTemplateLoader::findActivityByName(
171 if (is_array($currentActivity) && isset($currentActivity[
'Properties']) && is_array($currentActivity[
'Properties']))
174 foreach (
$map as $id => $property)
176 if (!isset($property[
'FieldName']))
179 $this->currentValues[$property[
'FieldName']] =
null;
181 if (isset($currentActivity[
'Properties'][$id]))
184 isset($property[
'Getter'])
185 && is_callable($property[
'Getter'])
186 && $property[
'Getter'] instanceof \Closure
189 $getter = $property[
'Getter'];
190 $property[
'Id'] = $id;
191 $this->currentValues[$property[
'FieldName']] = $getter($this, $property, $currentActivity, $compatible);
195 $this->currentValues[$property[
'FieldName']] = $currentActivity[
'Properties'][$id];
201 $this->currentValues[$property[
'FieldName']] ===
null
203 $this->currentValues[$property[
'FieldName']] ===
''
205 && isset($property[
'Default'])
208 $this->currentValues[$property[
'FieldName']] = $property[
'Default'];
214 if ($compatible && $this->currentValues)
218 foreach ($this->
getMap() as $id => $property)
220 if (!isset($property[
'FieldName']))
225 if (isset($property[
'Type']) && $property[
'Type'] ===
FieldType::USER && !isset($property[
'Getter']))
227 $compatibleValues[$property[
'FieldName']] = \CBPHelper::usersArrayToString(
228 $compatibleValues[$property[
'FieldName']],
235 return $compatibleValues;
405 if ($this->renderer !==
null)
407 return call_user_func($this->renderer, $this);
410 $runtime = \CBPRuntime::getRuntime();
411 $runtime->startRuntime();
413 return (
string)$runtime->executeResourceFile(
415 $this->dialogFileName,
419 'arCurrentValues' => $this->
getCurrentValues($this->dialogFileName ===
'properties_dialog.php'),