Getting started with Atom.apex
Step
A step is the basic component of an Atom. Here is how we chain the steps into an Atom.
new Atom()
.then(step1)
.then(step2)
.fork();
We have different kinds of steps in Atom.apex.
- Simple Step
A simple step is one that contains a compute. The only job for a simple step is to execute that compute.
new Atom()
.then(new Atom.SimpleStep(new CustomCompute()))
.then(new CustomCompute()) // equivalent to above
.fork();
- Composite Step
A composite step is one that can contain multiple steps. It executes the children steps one by one.
new Atom()
.then(
new Atom.CompositeStep()
.then(...)
)
.fork();
- ForEach Step
A ForEachStep is one that executes the 'for-each' loop with the given step. It looks up for the collection data with the given name from the Atom state, and creates a new looping item before invoking the looping step.
Map initialData = new Map{ 'items' => new List