SHARED_CONFIG - the type of shared configurationAPPLY - the type of the apply payload for each stepROLLBACK - the type of the rollback payload for each steppublic abstract class AbstractSteppableTemplate<SHARED_CONFIG,APPLY,ROLLBACK> extends AbstractChangeTemplate<SHARED_CONFIG,APPLY,ROLLBACK>
Use this class when your template processes multiple operations, each with its own apply and optional rollback. The YAML structure for this template type is:
id: create-orders-collection
template: MongoChangeTemplate
steps:
- apply:
type: createCollection
collection: orders
rollback:
type: dropCollection
collection: orders
- apply:
type: insert
collection: orders
parameters:
documents:
- orderId: "ORD-001"
rollback:
type: delete
collection: orders
parameters:
filter: {}
The framework will automatically parse the steps from the YAML and inject
them via setSteps(java.util.List<io.flamingock.api.template.TemplateStep<APPLY, ROLLBACK>>).
Rollback Behavior:
| Modifier and Type | Field and Description |
|---|---|
protected java.util.List<TemplateStep<APPLY,ROLLBACK>> |
steps |
changeId, configuration, isTransactional| Constructor and Description |
|---|
AbstractSteppableTemplate(java.lang.Class<?>... additionalReflectiveClass) |
| Modifier and Type | Method and Description |
|---|---|
java.util.List<TemplateStep<APPLY,ROLLBACK>> |
getSteps()
Returns the list of steps.
|
void |
setSteps(java.util.List<TemplateStep<APPLY,ROLLBACK>> steps)
Sets the list of steps to execute.
|
getApplyPayloadClass, getConfigurationClass, getReflectiveClasses, getRollbackPayloadClass, setChangeId, setConfiguration, setTransactionalprotected java.util.List<TemplateStep<APPLY,ROLLBACK>> steps
public AbstractSteppableTemplate(java.lang.Class<?>... additionalReflectiveClass)
public void setSteps(java.util.List<TemplateStep<APPLY,ROLLBACK>> steps)
steps - the list of template stepspublic java.util.List<TemplateStep<APPLY,ROLLBACK>> getSteps()