public static WebApplicationService getService(final RequestContext context) {
        return Optional.ofNullable(context).map(requestContext
            -> (WebApplicationService) requestContext.getFlowScope().get(CasWebflowConstants.ATTRIBUTE_SERVICE)).orElse(null);
    }
Gets the service from the flow scope.

@param context the context
@return the service
core/cas-server-core-web-api/src/main/java/org/apereo/cas/web/support/WebUtils.java