Outgoing triggers examples
Attribute mapping triggers
When you are configuring an agent and defining the attibute mappings of a connectors, depending on the connector type, it will be able to define BeanShell scripts that will be triggered when data is loaded into the target system (outgoing triggers).
Triggers can be used to validate or perform a specific action just before performing an operation or just after performing an operation into target objects.
The trigger result will be a boolean value, true to continue or false to stop.
Use case examples
Example 1
Update or insert a user only when the user is internal (PreInsert User or PreUpdate User)
name = source{"userName"};
user = serviceLocator.getUserService().findUserByUserName(name);
if (user != null) {
if (user.userType.equals("I")) {
return true;
}
}
return false;
Example 2
Example 3
Example 4
Send an email
serviceLocator.getMailService().sendTextMail("patricia@soffid.com", "Subject", "Mail message");