Determine the operation that triggered the business rule

You can write a script for a business rule that is triggered on more than one database action.

If you want the business rule script to dynamically branch depending on the action that triggered the event, you can use the operation() function. For example:
if(current.operation() == "update") {
  current.updates ++; } 
  if(current.operation() == "insert") {
    current.updates = 0; }