class ExternalDatabaseCreationActions {

    @Bean(name = "WAIT_FOR_EXTERNAL_DATABASE_STATE")
    public Action<?, ?> externalDatabaseCreation() {
        return new AbstractExternalDatabaseCreationAction<>(StackEvent.class) {
            @Override
            protected void doExecute(ExternalDatabaseContext context, StackEvent payload, Map<Object, Object> variables) {
                sendEvent(context);
            }

            @Override
            protected Selectable createRequest(ExternalDatabaseContext context) {
                Stack stack = context.getStack();
                return new CreateExternalDatabaseRequest(stack.getId(), "CreateExternalDatabaseRequest", stack.getName(), stack.getResourceCrn(), stack);
            }
        };
    }

}