How to create Step
Below steps describe how we can create a simple Step Group and run it.
Step 1: Configure Breezz Step Group
At first we need to create the Step Group - Step Group is a set of Steps that defines execution order and execution rules. To create Step Group go to Breezz App → click Breezz Setup → Dashboard → Create Group.
Provide Name, Description and select Record Level Security (record security level used in DMLs). Click save and go to the next step of configuration.
You can find more about Step Group Configuration here
Step 2: Create Step class
Now that the group has been created, we need to introduce a new class housing our logic. Each Step must extend the Step interface. To create this, utilize Generate Step Code. Go to Force Breezz Setup → Step Group → Generate Step Code.
Nnow enter class name and press Copy to Clipboard. The code generated in the window is ready for your use. The functionality will be integrated into the initRecordProcessing method, demonstrating straightforward manipulation of object data. For further details about these classes, refer here.
1// class need to extends forvendi.Step class
2public with sharing class UppercaseNameFieldStep extends forvendi.Step {
3
4 public UppercaseNameFieldStep() {
5 // public default constructor need to available
6 // for the technical reasons we have to pass the class name -
7 // without this, the framework will not be able to execute this step in async context and create correct logs
8 super(UppercaseNameFieldStep.class.getName());
9 }
10
11 public override Boolean initRecordProcessing(Object record, Object optionalOldRecord) {
12 // we can cast record parameter to SObject because step we are planning to pass list of Accounts
13 SObject sfRecord = (SObject)record;
14 String recordName = (String)sfRecord.get('Name');
15 sfRecord.put('Name', String.isBlank(recordName) ? '' : recordName.trim().toUpperCase().replace(' ', '_'));
16 // returning false - because we have all what we need to finish the process
17 return false;
18 }
19}
Provided class makes some simple changes in the SObject Name field. You can copy it, but feel free to create your own. After successfully deploying you can go to the last step.
Step 3: Add Step into the Step Group
Now, when we have a Step class we need to add it to our previously created Step Group. You can read more about Step Configuration here. Create a new Step from the Dashboard or simply go to Step Groups → Select previously created Group → Click New Step.
Choose Type of Step, for now select - Custom, select Step Class Name - provided class needs to extend forvendi.Step class (use the class name which we created in point 2). Provide a Name and create a Description of the functionality - adding accurate descriptions and clear naming scheme will simplify future development. Lastly, set order of execution. Click Save.