FI Finnish
SE Swedish
FR French
PL Polish
DE German
US English (US)

Contact Us

If you still have questions or prefer to get help directly from an agent, please submit a request.
We’ll get back to you as soon as possible.

Please fill out the contact form below and we will reply as soon as possible.

English (US)
FI Finnish
SE Swedish
FR French
PL Polish
DE German
US English (US)
  • Log in
  • Home
  • Platform
  • ESM
  • Other Technical ESM Documentation
  • Listeners

ESM Listener Lifecycle

Contact Us

If you still have questions or prefer to get help directly from an agent, please submit a request.
We’ll get back to you as soon as possible.

Please fill out the contact form below and we will reply as soon as possible.

  • Service Management
    Matrix42 Professional Solution Matrix42 Core Solution Enterprise Service Management Matrix42 Intelligence
  • Identity Governance and Administration (IGA)
    IGA overview IGA solution library
  • Platform
    ESM ESS2 ESS Efecte Chat for Service Management Integrations Add-ons
  • Release Notes for M42 Professional, IGA, Conversational AI
    2026.1 2025.3 2025.2 2025.1 2024.2 2024.1 2023.4 2023.3 2023.2 2023.1 2022.4 2022.3 Release Information and Policies
  • Other Material
    Terms & Documentation Guidelines Accessibility Statements
  • Services
+ More
    • Service Management

    • Identity Governance and Administration (IGA)

    • Platform

    • Release Notes for M42 Professional, IGA, Conversational AI

    • Other Material

    • Services

ESM Listener Lifecycle

Overview

A listener lifecycle has three or four phases, depending on whether it’s a pre save or a post save listener: 

  1. Data card save:  The listener is triggered during the save of a data card. 
  2. Checking source conditions: Source conditions are checked. 
  3. Checking target conditions (post-save listeners only): The group of target data cards is defined based on target conditions. This phase only happens if the listener is a post save listener.  
  4. Executing actions: One or more actions are executed to the target data card. 
    1. In pre save listener’s case, the target data card is the so called “source" data card, which “hosts” the listener. 

Data Card Save

The listener is triggered during the save of a data card.

Triggering Listeners

Execution Order of Handlers and Listeners

Listeners, Handlers and Visual Workflow Automation

  • Workflow actions is not executed as the last pre-save listener. It starts from the first workflow node (or last processed node) and in a single execution processes multiple nodes until it arrives at a node (such as a Timer or Approval) that will not allow it to go further. 
    • Visual Workflow Automation __initialization__ happens in the end of the pre-save part of save cycle.
    • Visual Workflow Automation __Processing__ happens in the end of the post-save part of save cycle.
 

Checking Source Conditions

Each listener has source conditions, which describe when the listener should react to the event. For example, the condition might be as follows: 

(attribute "state" old value != attribute "state" new value) && (attribute "state" new value == "closed")

Conditions can be much more complicated with "and" and "or" operators and even nested ones. If the source data card matches the conditions, the execution moves forward.

Pre-Save Listener

Post-Save Listener

AND Example

OR Example

Combined SC

Implemented Source Conditions

Name Description
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. 
AlwaysTrueSourceCondition Always true, i.e. the data card is always matched with this condition. 
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 
FolderSourceCondition Is the data card in a specific folder on in some other (operator !=).
GuiEditSourceCondition True when the source data card is edited from the ESM UI. 
NewDataCardSourceCondition  Are we about to save a new data card: yes or no
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. 
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).
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.
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.

 

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.

See more examples of source conditions in SourceConditionExamples.xml:

Checking Target Conditions

Target conditions are similar to search conditions in the ESM UI. The actions of the listener are performed on the data cards which match the conditions. Note that the source data card should be excluded using these conditions.

An example of an target condition could be the following: 

    (template == "ticket") && (reference attribute     "caused by"     target == source data card) &&     (attribute "state" value ==     "open")


 

Note:

If, during the execution of a listener, a possible infinite loop is detected → the listener execution ends and an error is displayed. 

For example, if listener A modifies data card B, it triggers listener B and listener B modifies data card A.

 

Implemented Target Conditions

Name Description
CombinedTargetCondition Combines multiple conditions (which can also be CombinedTargetConditions themselves) to one with operators AND or OR.

ValueTargetCondition

  • By value
  • By reference to source
  • By reference from source
Compares an attribute value from data card to some constant with some operator. Supported operators depend on the data type, for example references can't be compared to data card name or id. An exception to this is a reference to source or reference from source (configured with attribute code).
PropertyTargetCondition Compares data card's attribute's value to some other attribute's value with some operator. Supported operators depend on the data types used. 
SourcePropertyTargetCondition Compares target data card's attribute's value to an attribute's value on the source data card with some operator. Supported operators depend on the data types used.
EntityTargetCondition
  • Can be used to check if data card is removed (in the trashcan): true or false
  • Can be used to check if data card is hidden: true or false 
SpecialTargetCondition

This condition can be used to define/check the following properties: 

  • A template, which the source data card is (special condition required in root condition in XML).
  • Is the data card in a specific folder (folder code) or some where else.
  • Is the data card same or different than source (for example when target conditions refer to same template as source data card, one may exclude the source data card from possible target data cards).
  • Does the target data card refer to source through a specified path of references (target_refers_to_source). The path is defined using attribute codes as follows: template_code1:attribute_code1$template_code2:attribute_code2... 
    • The first template code is the code of the target template and the attribute code is a code of such attribute, which can refer to the data cards which are next in the path. 
    • The last template and attribute code pair is used to mark an attribute which refers directly to the source data card.

See examples of target conditions in TargetConditionExamples.xml:

Executing Actions

One or more actions are executed to the target data card. In pre save listener’s case, the target data card is the so called “source" data card, which “hosts” the listener. 

Implemented Actions

Name Pre save Post Save Description
AlwaysFailDataCard (Action) Yes No Prevents saving the data card.
ChangeDataCardValues Yes Yes  Sets a value to a field.
CopyDataCardValues Yes Yes Copies a value from source data card to another attribute's value or to a value of an attribute in the target data card. Can also copy values behind references. If multivalue, existing values will be REPLACED. Multivalues work only on host data card, not behind references. 
CopySourceReference Yes No Creates a reference from target data cards to source data card.
CreateDataCard No Yes Creates a new Data card, based on configured template and in configured folder. Optionally adds references between the creator and the created data cards, and sets any attribute values in the created card. As a special case, can add the time when editing in the Efecte GUI was started
EntityDataCard Yes No Moves a data card to trashcan, restores it from the trashcan, permanently deletes, hides or makes a data card visible.
Expression(Action)  Yes Yes Will execute a defined Python script on target data cards.
FolderDataCard Yes Yes Moves a data card to a specific folder.
SaveDataCard No Yes Saves the data card. This enables calculating new values to attributes containing a handler (ExpressionHandler or such).
SaveDataCardXmlToFile No Yes Saves the data card in XML form to a specified file and folder. Note that this action operates only on the source data card that is saved. If the file exists, it will be overwritten (file is deleted before writing new file). Action tries first to write the XML to a temporary file and then renames the temporary file to the specified file. This is to prevent anyone reading the result file before it's completely written.
SendDataCardXmlToWebService No Yes NOTE: No “Action” in the name. Sends data card in XML form to configured SOAP web service. Note that this action operates only on the source data card that is saved. 
SendMailAction No Yes Sends mail.
SendSourceChangedJMSMessage(Action)  Yes Yes Action will send a JMS message to queue when the data card is saved. The contents of the message is the data card in whole in Efecte XML format. 
TargetedSccmUpdate No Yes Triggers a targeted SCCM update. Only used together with SccmIntegrationTask. 
TransformDataCard No Yes Action transforms currently edited data card to another data card. Uses transform rules and target folder defined in transforms in template editor.
SendDataCardXmlToHttpAction No Yes Sends data card in XML form to a chosen web service. Note that this action operates only on the source data card that is saved.

See examples of target conditions in TargetConditionExamples.xml:


 

listener lifecycle esm

Was this article helpful?

Yes
No
Give feedback about this article

Table of Contents

Related Articles

  • ESM Listener Overview
  • Self-Service: Create New Users, Update User and Departing User Information

Copyright 2026 – Matrix42 Professional.

Matrix42 homepage


Knowledge Base Software powered by Helpjuice

0
0
Expand