ok so i ll just pass on the Key then to the ajax method and there i ll get the conversationId out of the Key using pattern matching.
Code:
Pattern pattern = Pattern.compile("^_s(.*)_c(.*)$");
Matcher matcher = pattern.matcher(flowExecutionKeyString);
String conversationId = null;
if ( matcher.matches() )
conversationId = matcher.group(1);
WebContext ctx = WebContextFactory.get();
ExternalContext externalContext = new ServletExternalContext(
ctx.getServletContext(),
ctx.getHttpServletRequest(),
ctx.getHttpServletResponse());
FlowExecutionRepository flowExecutionRepository =
flowExecutionRepositoryFactory.getRepository(externalContext);
FlowExecutionKey flowExecutionKey =
flowExecutionRepository.getCurrentFlowExecutionKey(conversationId);
logger.debug("flowExecutionKey " + flowExecutionKey);
FlowExecution flowExecution =
flowExecutionRepository.getFlowExecution(flowExecutionKey);
logger.debug("flowExecution " + flowExecution.getCaption());
AttributeMap scope = flowExecution.getScope();
logger.debug("scope size" + scope.size());
the debugger output gives ...
Code:
- <flowExecutionKey [FlowExecutionKey@96bf47 conversationId = '93D40ED5-B669-2AE8-0C14-7CCC197B97E4', continuationId = '2FB2877E-54B8-F424-C170-FDB4B5EE86EB']>
- <flowExecution FlowExecution:flow=[upgradedowngradeWebflow]>
- <scope size0>
so it finds the Key ( with the right continuationId ... ) and it finds the right FlowExecution.
but why is the scope size 0 ???
while in the formAction i have put objects into the FlowScope ...
Code:
requestContext.getFlowScope().put("myOptions", myOptions);
and i was able to retrieve that object in the view from the model.
am i accessing the wrong 'scope' here ??