-
What is Bitrix Framework?
-
Production Architecture
-
Production Architecture
-
Structure of files
-
Access Rights
-
A Site in Terms of Bitrix Framework
-
-
Processing Techniques
-
Core D7
-
Modules
-
Name Spaces
-
Core Parameter Setup
-
Exceptions
-
Events
-
Code Writing Rules
-
Applications and Context
-
Errors
-
ORM
-
API
-
Highloadblock
-
-
Design Integration
-
Using Access Rights
-
Site Design Template
-
Using message files for localization
-
Editable areas
-
Navigation tools
-
Advertisement
-
Managing Template Service Data
-
Editing Service Areas
-
Managing Page Encoding
-
Managing Document Header
-
Managing Metadata Values
-
CSS management
-
-
Setup of External Appearance of Additional Elements of the Site Design
-
-
Information Blocks
-
Working with Infoblocks Using Standard Means
-
Infoblocks 2.0
-
Action Plan in Case of Problems
-
Sorting
-
Work with Infoblocks through API
-
Examples
-
-
Components
-
Simple and composite components
-
Location of a Component in the System and Its Connection
-
Component Structure
-
Composite Component Structure
-
Component Description
-
Component Parameters
-
Component Templates
-
Support of Component Classes
-
result_modifier.php
-
component_epilog.php
-
Operation of a Composite Component in a SEF Mode
-
Frequent Errors
-
Component Caching
-
Working with Components
-
Template Customization
-
Component Customization
-
Creating Components
-
Additional Methods
-
Redefinition of Incoming Variables
-
User-Defined Templating Engines
-
Operation of a Composite Component in SEF Mode
-
Ways of Data Transmission among Components
-
A Simple Example of a Component Creation
-
Component Creation Example
-
TinyMCE Visual Editor Integration Component
-
Caching in own components
-
-
CUSTOM Parameter Type
-
More examples
-
Errors When Working with Components
-
-
-
Modules
-
Programming in Bitrix Framework
-
Golden Rules
-
The file init.php
-
UTF-8 or a National Encoding?
-
Working with Databases
-
Setup of SEF for URLs
-
Language Files
-
JS Library
-
Interface of the Control Panel Toolbar as Seen by a Developer
-
Some Theory
-
Performance
-
Security
-
Examples, tricks, and advice
-
Custom Fields
-
Gadgets
-
Project Testing
-
Project Quality Control
-
Debugging Web Applications
-
-
Push and Pull module
-
Version Control System
-
-
Multiple Sites
-
Introduction
-
Use of Multiple Site Version
-
How many sites can I create?
-
Language versions (mirrors)
-
Sharing visitors between sites
-
Configuring the multisite system
-
Working with the Data in a Multiple Site Configuration
-
Frequent Questions Arising When Working with a Multiple Site Configuration
-
-
Business Processes for Developer
-
Template of a Business Process
-
Business Process
-
Activities
-
Executing a business process activity using API
-
Arbitrary PHP Code in a Business Process
-
-
Additional Information and Examples
Properties of Activities
Lesson 240 out of 253
An activity may have properties which values are set up when adding activities to a business process template. Both constants and links to properties of other activities of a business process may constitute property values.
Activity properties are described in the activity class designer by defining an array in the arProperties class members:
public function __construct($name) { parent::__construct($name); $this->arProperties = array("Title" => "", "MyProperty" => ""); }
The names of the properties constitute the keys in the property definition array and default values of the properties constitute the values.
When executing an activity, the properties are available as class members:
$this->MyProperty
Input parameters (properties) of a business process are available as properties of a root activity of the business process. Any activity of a business process may access input parameters of a business process.
For example, if a business process was launched using the code:
// Business process template code $workflowTemplateId = 12; // Business process is launched for the document which is an infoblock element with code 358 $documentId = array("iblock", "CIBlockDocument", 358); // Input parameters of the business process $arParameters = array("MyProperty" => "red"); $runtime = CBPRuntime::GetRuntime(); $wi = $runtime->CreateWorkflow($workflowTemplateId, $documentId, $arParameters); $wi->Start();
then in any activity of this business process a parameter value can be obtained using the following code:
$rootActivity = $this->GetRootActivity(); if ($rootActivity->IsPropertyExists("MyProperty")) $val = $rootActivity->MyProperty; // $val == "red"
Developer describes activity properties when writing activity code. Income parameters of a business process (a.k.a. properties of root activity of a business process) are described by users when creating a business process template.
Both constants and links to properties of other business process activities may constitute property values, provided that these activities were executed previously.
In order to make sure that at the time of a business process execution the property value of one activity is the property value of another activity executed above, the following array must be set as a property value of the first activity at the stage of creating the template for such business process:
array("name of the activity which properties are referred to", "property name")
In case of simple types of these properties, the following string must be set as a property value of the first activity:
"{=activity_name, property_name}"
In order to refer to an input parameter (property) of a business process which is available as a property of a root activity of a business process, the word Template should be used as the name of the activity:
array("Template", "property name")
"{=Template, property_name}"
In general terms, the following words can be used as an activity name:
- Document – to access an arbitrary field of the document for which a business process is started;
- Template – to access an input parameter (property) of a business process (root activity);
- Variable – to access a business process variable;
- User – to obtain the code of the current user ("ID" must be indicated as the property name);
- System – accessing system variables, presently only the property Now (current date in the website format) is available;
- Any other name – to access an action property with this name.
For example, if during development the following string is set as a property value:
"Document [url={=Template:PathTemplate}]{=Document:NAME}[/url] was approved"
and the workflow is launched with the input parameter PathTemplate equal to file.php for the document named Chart of Accounts, the following string will constitute the property value during activity execution:
"Document [url=file.php]Chart of Accounts[/url] was approved"