ESM Listener Implemented Source Conditions
ESM Listener Implemented Source Conditions
CombinedSourceCondition
Combines conditions (which also can be CombinedSourceConditions) with AND or OR operators. In the XML the outermost source_conditions element itself is an CombinedSourceCondition.
<source_conditions boolean="AND">
<combined_source_condition boolean="OR">
<source_condition>
...
</source_condition>
<source_condition>
...
</source_condition>
</combined_source_condition>
<source_condition>
...
</source_condition>
</source_conditions>AlwaysTrueSourceCondition
Always true, i.e. the data card is always matched with this condition.
<source_condition>
<always_true/>
</source_condition>In version 4105 and before
<source_condition>
<alwaysTrue/>
</source_condition>Actually, you don't need to use this condition at all. The listener will be executed always also if you leave source_conditions out.
EntitySourceCondition
Is the data card hidden before saving or after saving (current_value): yes or no
Is the data card removed (in the trashcan) before saving or after saving: yes or no
<!-- Source condition that matches a data card which was in the trashcan before saving (restored from trashcan?) -->
<source_condition>
<entity>
<state>entityIsDeleted</state>
<value>true</value>
<current_value>false</current_value>
</entity>
</source_condition>
<!-- Source condition that matches a data card which was hidden in saving -->
<source_condition>
<entity>
<state>entityIsHidden</state>
<value>false</value>
<current_value>false</current_value>
</entity>
</source_condition>
<source_condition>
<entity>
<state>entityIsHidden</state>
<value>true</value>
<current_value>true</current_value>
</entity>
</source_condition>FolderSourceCondition
Is the data card in a specific folder on in some other (operator !=). Use folder codes, not id's.
<source_condition>
<folder>
<code>computers</code>
<operator>=</operator>
</folder>
</source_condition>GuiEditSourceCondition
True when the source data card is edited from the Efecte GUI editor.
<source_condition>
<gui_edit/>
</source_condition>NewDataCardSourceCondition
Are we about to save a new data card: yes or no
<source_condition>
<new_datacard>
<value>true</value>
</new_datacard>
</source_condition>PropertySourceCondition
Compare some field in the data card (attribute) before saving or after saving (current_value true or false) to another field value before saving or after saving with some operator. Supported operators depend on the datatype.
<!-- Source condition that tests if the name attribute's old value is not the same as the new value -->
<source_condition>
<property>
<attribute>
<code>name</code>
<current_value>false</current_value>
</attribute>
<operator><></operator>
<compared_attribute>
<code>name</code>
<current_value>true</current_value>
</compared_attribute>
</property>
</source_condition>ValueSourceCondition
Compare some field (attribute) before saving or after saving (current_value true or false) to some constant value with some operator. Supported operators depend on the datatype, e.g. you can't compare a reference to constant (like data card's id or name).
<!-- Source condition that tests if the status attribute's value is "Closed" -->
<source_condition>
<value>
<attribute>
<code>status</code>
<current_value>true</current_value>
</attribute>
<operator>=</operator>
<compared_value>Closed</compared_value>
</value>
</source_condition>
<!-- Source condition that tests if the status attribute's value is not empty -->
<source_condition>
<value>
<attribute>
<code>status</code>
<current_value>true</current_value>
</attribute>
<operator>IS NOT NULL</operator>
<compared_value></compared_value>
</value>
</source_condition>ReferencePathValueSourceCondition
Compare some value found in a reference path ($code1:code2:code3$) before saving or after saving (current_value true or false) to some constant value with some operator. Supported operators depend on the datatype, e.g. you can't compare a reference to constant (like data card's id or name).
<source_condition>
<reference_path_value>
<reference>
<path>$code1:code2$</path>
<current_value>true</current_value>
</reference>
<operator>=</operator>
<compared_value>Removed</compared_value>
</reference_path_value>
</source_condition>Above condition will match if the current data card's attribute "code1" references to data card, which has an attribute with code "code2" and value "Removed".
Note:
Current implementation works in a such way that even the referenced template doesn't have attribute with code "code2" or "code1" is empty reference, the execution continues normally. For example, if the operator is != and the compared value is some constant, whole source condition is still true in this case.
ReferencePathPropertySourceCondition
With this source condition it is possible to compare to values of two such attributes which one or both can be reference. The first of these may be a reference to local (non-reference) attribute, but the other must be some referenced data card's attribute. Both attributes must have the same datatype. This source condition also supports multivalue attributes in way defined below.
Multivalue attributes and matching of the condition
- If all values must match, this means that all values of the first attribute must match some values of the second attribute.
- If first attribute or second attribute has no value, condition does not match.
- If not all values doesn't need to match, then it is enough that any of many values in the first attribute match to some of the many values in the second attribute.
In the example below there's a reference to data card's own field and field on other data card:
<reference_path_property>
<reference>
<path>$code1$</path>
<current_value>true</current_value>
</reference>
<operator>!=</operator>
<compared_reference>
<path>$code2:code3$</path>
</compared_reference>
<require_all_values_match>false</require_all_values_match>
</reference_path_property>In the example below there's references to two fields in other data card:
<reference_path_property>
<reference>
<path>$code1:code4$</path>
<current_value>true</current_value>
</reference>
<operator>!=</operator>
<compared_reference>
<path>$code2:code3$</path>
</compared_reference>
<require_all_values_match>false</require_all_values_match>
</reference_path_property>Table of Contents