@TransactionPolicy(TransactionControl.EXPLICIT)
@Override
public void initialize(WorkflowContext context) throws Exception {
super.initialize(context);
postActions = new LinkedHashMap<>();
BatchPipelineSpec batchPipelineSpec =
GSON.fromJson(context.getWorkflowSpecification().getProperty("pipeline.spec"), BatchPipelineSpec.class);
MacroEvaluator macroEvaluator = new DefaultMacroEvaluator(new BasicArguments(context.getToken(),
context.getRuntimeArguments()),
context.getLogicalStartTime(), context,
context.getNamespace());
postActionSpecs = new HashMap<>();
for (ActionSpec actionSpec : batchPipelineSpec.getEndingActions()) {
String name = actionSpec.getName();
postActions.put(name, (PostAction) context.newPluginInstance(name, macroEvaluator));
postActionSpecs.put(name, StageSpec.builder(name, actionSpec.getPluginSpec())
.setProcessTimingEnabled(batchPipelineSpec.isProcessTimingEnabled())
.setStageLoggingEnabled(batchPipelineSpec.isStageLoggingEnabled())
.build());
}
}