Event Listener Module¶
The Event Listener Module waits for specific events and initiates new workflow instances or performs actions upon event occurrence. Events are triggered at the domain level and may originate from other processes.
In addition to the common task properties, the following properties are configurable:
Event Name:
The name of the event(s) to listen for. This can be a plain text string (e.g., Customer.New) or utilize data template expressions to incorporate data model values (e.g., "PaymentComplete.{{Id}}"). Multiple event names can be specified using semicolon delimiters (e.g., "Customer.New;Customer.Update.{{Id}}").
Handle Script:
The script executed when an event is received. This script determines the workflow's subsequent actions. If left unset, the workflow engine automatically selects the first available action. The attached event data is accessible via the $Input variable as an XML instance.
If the task is configured as a starting point, a new workflow instance is initiated, and event data is mapped to matching nodes in the current workflow's data model. If the handle script does not specify an action, the workflow instance reverts. If the task is not a starting point, the workflow instance pauses until the event occurs. In this case, if the handle script doesn't define an action, the instance remains paused awaiting the next event.
Scripting Objects¶
This script is executed in the backend environment of the Emakin and does not have an accessible a browser DOM context and therefore navigator based JavaScript libraries such as jQuery are not available.
The following objects are available:
$InputInstance of theNodedata that passed to the event.$WorkItemCurrentWorkItemthat is being processed.$InstanceInstance of theInstancecurrent workflow instance.$TestModeIndicates whether the workflow is running in test mode. In test mode, evaluates totruevalue.$PriorityPriority of the current workflow instance 0 (lowest) to 5 (highest$InitiatorIdentifies the workflow initiator. Note that this may benullfor module-type tasks.$CultureCurrent culture of the workflow instance. Originated from the initiator's culture but can be overridden. Culture is specified in the formatlanguagecode2-country/regioncode2. Example: (en-USortr-TR)$TemplatesProvides access to templates defined in the pool definition. Used for rendering the text content depending on the culture of the workflow instance.$XmlProvides access to the process data model or workflow data.$CaseInstance ofCaseinstance if workflow started on a case.$poolVariableCustom defined pool variable by name. Variables are defined in Variables$ServicesAllows calling SOAP services with JSON or XML content types.$DecisionsAllowing you to execute decision tables and models on process.$scriptModuleCustom defined script module. Script modules are defined in Script Modules$DomainProvides access to the domain information and related methods like initiating a workflow or creating a new case.$ActivityStreamAllows pushing system-generated activities to the domain activity stream.$MembershipProvides access to users and organizational database objects.$DatabaseAllows you to perform relational database operations.$CryptoProvides access to cryptographic functions such as hashing and encryption.$RestAllows interaction with REST services using JSON or XML content types.$CalendarProvides access to calendar functions like adding or subtracting date in calendar rules.$FilesAllows access to the standard file repository for basic files.$DocumentsProvides access to the document archive.$DelegationPprovides methods to manage delegations between users.$MessagesProvides functionality for sending new e-mails and parsing existing e-mail messages.$XmlRepositoryProvides access to the non-relational XML repository database.
System Events¶
Emakin automatically fires the following events for integration purposes.
User Events¶
User.Register¶
Fired when a new user registers with the system. Registration occurs upon a first-time login under the current usage terms. If tenant usage terms change, re-registration with the updated terms is automatically triggered.
This event does not include input data. It expects a new workflow instance to be created and assigned to the user. If no workflow instance is created, registration completes automatically. This event is designed to comply with GDPR consent requirements.
Case Events¶
The following events are triggered upon completion of operations on a case instance. The $Case scripting variable automatically holds the case instance data for the triggered event.
The following Case events are available:
Case.Open: Fired when a case's status changes to "Open".Case.Assign: Fired when a case is assigned to a user or assignment is cleared.Case.Update: Fired when case properties (Subject, Description, Deadline, Profile, etc.) are updated.Case.Close: Fired when a case's status changes to "Closed".Case.Delete: Fired when a case is deleted from the system.Case.Deadline: Fired when a case deadline is reached.Case.Reply: Fired when a case receives a reply (e.g., via email or another system).
Warning
Case events are processed synchronously. Any exceptions will result in a silent rollback of the transaction.
Input Data for Case Events¶
Case events provide the following example XML data, accessible via the $Input variable:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 | |
Remarks¶
If the module's script is left empty, the first available action will be automatically selected.