Salesforce

Constructing a User Event (Magic xpa 3.x)

« Go Back

Information

 
Created ByKnowledge Migration User
Approval Process StatusPublished
Objective
Description

Constructing a User Event (Magic xpa 3.x)

Like logic units, you can define events in any task. The task events are created and defined in the Task User event list, which you can access by pressing Ctrl+U. Four properties define an event: its name, trigger, parameters, and level of execution.

Property

Description

Description

This column is the event’s name. It is not a mandatory column, and you can use and select a User event without a name. However, you should use a descriptive name to differentiate between the various User events.

Trigger

You can set a different event to automatically trigger your User event. The event types you can use as triggers for a User event are: System, Internal, Timer, and Expression.

If you do not use a trigger for the User event, set the trigger type to None.

Note:

The only way to trigger a User event without assigning a trigger is through the Raise Event operation.

Parameters

You can pass arguments along with the Raise Event operation on triggering an event. The passed argument values are received by the parameter variables defined in the corresponding logic unit.

Zooming from this field opens the parameters list, where you can define any number of required parameters, as shown in the figure below. For each parameter you should set the name, model or attribute, and picture. In this figure, the parameters list opened a user event definition from the Parameters field.

Automatic Creation of Parameter Variables

When creating a new logic unit for a user event, on selecting a user event set with parameter definitions, the Studio prompts you with the option of automatically creating the parameter variables in the logic unit according to the parameter definitions of the selected user event.

Force Exit

This column defines the task level from which the engine must exit before handling the event.

None – The event is handled immediately. A User event set with Force Exit=None does not exit to any level before it is handled, and it can be executed at any level of the task.

Editing – A User event set with Force Exit=Editing instructs the task to exit the edit mode of a control before executing a corresponding handler to handle the event. This means that by the time the logic unit of the event will be executed, the newly edited value of the control will be updated in the control’s variable. After all the handlers of the events are executed, the task returns back to edit mode.

This level of the Force exit parameter is useful for handling events that need to refer to newly typed values of the current control. For example, if you want to handle the Zoom event of a given control and in the task called from the Zoom logic unit you want to refer to the newly entered value, you should create a user event set to be triggered by the Zoom internal event, and set the Force Exit property to Editing.

Note:

When the Force Exit is set to None, and the logic unit that handles the event updates the current variable, the new value will be seen only on tabbing out of the control. This is because the control remains in Edit mode with the last edit value. However, when the Force Exit is set to Editing, because the engine exits the Edit mode and re-enters it, the new edit mode shows newly updated values.

Control – A User event set with Force Exit=Control instructs the task to exit the control before executing a corresponding handler to handle the event. Once the event handling is complete, the task returns to the same control. This means that the engine will execute all control level logic units pertaining to the current controls, namely the Control Verification and Control Suffix, because of exiting the control, and the Control Prefix, because of re-entering the control.

Pre Record Update – A User event set with Force Exit=Pre Record Update instructs the task to exit the current record before executing a corresponding handler to handle the event. The User event completes the handling of the event and updates the record in the active transaction. Once this sequence is complete, the task returns to the same record and executes its Record Prefix level.

In other words, the handler is executed after the Record Suffix just before it is updated in the database. Once the handling is complete, the record is updated in the database.

You can set the event with Force Exit as Pre Record Update if you want the record to be updated in the current transaction immediately after the event handling is completed.

Note:

When you set the event to Force Exit = Pre Record Update, any Update operation performed through the executed handler is also updated when the engine exits the record and updates the record in the transaction.

Post Record Update – A User event set with Force Exit = Post Record Update is similar to the Pre Record Update by being set to exit and update the record before executing a corresponding handler to handle the event. However, in Post Record Update the engine first updates the modified record in the database, re-enters the already updated record, and performs its Record Prefix logic unit. Only then does it execute the logic units of the triggered event.

You can set the event with Force Exit = Post Record Update if the event logic unit is set to call other tasks that also refer to the current record and the record must be modified in the database before calling such a task. This way the called task will get the newly updated record.

Note:

When you set the event to Force Exit = Post Record Update, any Update operation performed through the executed logic unit on the current record will be done after the record has been updated and will be reflected in the database only after the engine leaves the record once more, either implicitly or explicitly by the end user.

Related Topics

Reference
Attachment 
Attachment