Search in sources :

Example 1 with KeepEndOfInstanceStrategy

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;
}
Also used : ArchiveEndOfInstanceStrategy(io.automatiko.engine.workflow.base.instance.impl.end.ArchiveEndOfInstanceStrategy) KeepEndOfInstanceStrategy(io.automatiko.engine.workflow.base.instance.impl.end.KeepEndOfInstanceStrategy) RemoveEndOfInstanceStrategy(io.automatiko.engine.workflow.base.instance.impl.end.RemoveEndOfInstanceStrategy) EndOfInstanceStrategy(io.automatiko.engine.api.workflow.EndOfInstanceStrategy) KeepEndOfInstanceStrategy(io.automatiko.engine.workflow.base.instance.impl.end.KeepEndOfInstanceStrategy) RemoveEndOfInstanceStrategy(io.automatiko.engine.workflow.base.instance.impl.end.RemoveEndOfInstanceStrategy) ArchiveEndOfInstanceStrategy(io.automatiko.engine.workflow.base.instance.impl.end.ArchiveEndOfInstanceStrategy) Type(io.automatiko.engine.api.workflow.EndOfInstanceStrategy.Type) Produces(javax.enterprise.inject.Produces)

Aggregations

EndOfInstanceStrategy (io.automatiko.engine.api.workflow.EndOfInstanceStrategy)1 Type (io.automatiko.engine.api.workflow.EndOfInstanceStrategy.Type)1 ArchiveEndOfInstanceStrategy (io.automatiko.engine.workflow.base.instance.impl.end.ArchiveEndOfInstanceStrategy)1 KeepEndOfInstanceStrategy (io.automatiko.engine.workflow.base.instance.impl.end.KeepEndOfInstanceStrategy)1 RemoveEndOfInstanceStrategy (io.automatiko.engine.workflow.base.instance.impl.end.RemoveEndOfInstanceStrategy)1 Produces (javax.enterprise.inject.Produces)1