use of io.automatiko.engine.workflow.base.instance.impl.end.KeepEndOfInstanceStrategy in project automatiko-engine by automatiko-io.
the class EndOfInstanceStrategyProducer method produce.
@Produces
public EndOfInstanceStrategy produce(@ConfigProperty(name = "quarkus.automatiko.on-instance-end", defaultValue = "REMOVE") String type, Instance<ArchiveStore> storage) {
EndOfInstanceStrategy.Type strategyType = Type.valueOf(type.toUpperCase());
EndOfInstanceStrategy strategy = null;
switch(strategyType) {
case REMOVE:
strategy = new RemoveEndOfInstanceStrategy();
break;
case KEEP:
strategy = new KeepEndOfInstanceStrategy();
break;
case ARCHIVE:
strategy = new ArchiveEndOfInstanceStrategy(storage.get());
break;
default:
break;
}
return strategy;
}
Aggregations