Getting Started


  1. Complete
  2. Complete
  3. Complete
  4. Active
    Create Atarc Process Apex Helper
  5. Active
    Add Atarc Process Record to Atarc Process Setting
  6. Active
    Unit Test for Apex Helper
  7. Active
    Next Steps
Progress: 0%

Create Atarc Process Apex Helper

Let's create a new apex class, for now it will have one special method, execute which will receive a context parameter and the only thing it will do is write to the debug log:


/*
Created By : anyei
ATARC Process: ChangeAccountName
Created Date : 2020-03-02
*/
public class AccountNameChanger extends AsyncTriggerArc.AsyncTriggerArcProcessBase {
    
    protected override object execute(AsyncTriggerArc.AsyncTriggerArcContext context){
        context.debug('ChangeAccountName..');

    }
    
}
  

It is mandatory to extend from a base class, we are extending AsyncTriggerArc.AsyncTriggerArcProcessBase for this example.

The "execute" method will be invoked by the ATARC engine so there is where all the logic should be added.

Now let's add more logic to the apex helper class, we will add code so that we change the account name field to "Yo" if name equals to "Hey":


/*
Created By : anyei
ATARC Process: ChangeAccountName
Created Date : 2020-03-02
*/
public class AccountNameChanger extends AsyncTriggerArc.AsyncTriggerArcProcessBase {
    
    protected override object execute(AsyncTriggerArc.AsyncTriggerArcContext context){
        context.debug('Running ChangeAccountName...');
        List accounts = (List) context.newList;
        
        for(Account acc: accounts){
            if(acc.Name == 'Hey') acc.Name = 'Yo';
        }
        
        return null;
            
    }
    
}
  
Next - Add Atarc Process Record to Atarc Process Setting