An event is part of a transaction and generates a method call to the condition handler which decides, by evaluating the conditions, whether the registered action should be performed, or not. This is known as the ECA rules with ECA referring to: Event, Condition and Action.
- The event part is the trigger.
- The condition part is the logical test to determine whether the action should be carried out.
- The action part is the execution of one or more predefined and registered actions.
Read more about the conceptEvents.
Setting up an event¶
Setting up an event includes two basic steps
Register the event in an ins file using method
Event_SYS.Enable_Event. Specify information about which entity and name the event has, the description, the variables that can be used for conditions and actions, and the type of the variables (string or number).
Event_SYS.Enable_Event(<Entity_Name>, <Event_Name>, <Desc>, <Condpars>)
<Condpars> is the the name and type of parameters for conditions and actions, example:
It is recommended to add some standardized parameters. This is important to let the administrator at customer site use the Event Registry in a good way. These parameters are:
ROWKEY parameter is used in Event actions to simplify navigation to the record, for example from an IFS Task or a mail message. The standard event parameters should be followed by the primary key.
- Add the call
Event_SYS.Event_Executeto execute the Event in the business logic (plsql-file). First check if the event is enabled, if so construct an IFS_Message according to the specified Event and set the attribute values. The message is created with the same name as the event.
<iframe name="I3" src="../../../300_developer_studio_examples/f1doc_itd/f1doc/Event/Core/plsql/procedure_order_credit_blocked.md" width="1309" height="631" border="0" frameborder="0">Your browser does not support inline frames or is currently configured not to display inline frames. </iframe>
Adding Attachments to an Event¶
If you want the possibility to add Large OBjects (LOB's) to an event, e.g. as attachments to an e-mail Event action, you do that by using Event_SYS.Create_Attachment_Parameter. The Rowkey and Filename parameters must be added to the Event Parameters.
Event_SYS.Create_Attachment_Parameter(<Entity_Name>, <Event_Name>, <Event_Parameter>, <LOB_Type>, <Description>, <Filename>, <Attachment_Method>);
Example (changes in registration of events)¶
Example (changes in runtime)¶
<iframe name="I5" src="../../../300_developer_studio_examples/f1doc_itd/f1doc/Event/Core/plsql/procedure_order_credit_blocked2.md" width="1014" height="284"> Your browser does not support inline frames or is currently configured not to display inline frames. </iframe>
Custom Defined Events and Application Defined Events¶
The difference between Custom Defined Events and Application Defined Events and how to set them up in IFS Solution Manager is explained in IFS Administrators Guide.