Skip to content

Issue with Context Variables #239

Open
@skhan17

Description

@skhan17

Hi! So I'm a new summer intern and I was given a project in which I need your help in. For the project, I am supposed to fetch the details, put them in a Mono<Map<String, Object>>, instantiate the context variables and send it to my thymeleaf file (all in one Reactive stream) and then send all of this, into an email. Below I have attached the code as reference.

return this.getPcfOperationService().getApplications(orgName, spaceName)
                .flatMap(ApplicationDetail -> Mono.zip((Mono.just(ApplicationDetail.getName())),
                        (Mono.just(ApplicationDetail.getRequestedState().equals("STARTED") ?
                                ApplicationDetail.getInstanceDetails().get(0).getState() : ApplicationDetail.getRequestedState()
                        ))))
                .collectMap(Tuple2::getT1, objects -> (Object) objects.getT2())
                .map(contextVariables -> new Context(Locale.ENGLISH, contextVariables))
                .map(context -> this.getTemplateEngine().process("genPCFStatusEmail.html", context));

Currently, the email sends but I'm having trouble setting the context variables, meaning that the getName() and getRequestedState() variables are not being recognized/printing out . This is a very specific issue, thus google is not helpful, so please let me know if you have any insight on what the issue could be!

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions