Source:
private void buildNavigableRepresentationsMenu(final IMenuManager navigate, final EObject designerObj, final Session session, final EditPart editpart, final TransactionalEditingDomain transDomain) { final DRepresentationElement element = (DRepresentationElement) designerObj; final Separator createGroup = new Separator(NAVIGATE_REPRESENTATION_GROUP_SEPARATOR); navigate.add(createGroup); for (RepresentationNavigationDescription navDesc : element.getMapping().getNavigationDescriptions()) { boolean append = true; if (!isFromActiveViewpoint(session, navDesc.getRepresentationDescription())) { append = false; } final IInterpreter interpreter = SiriusPlugin.getDefault().getInterpreterRegistry().getInterpreter(element.getTarget()); Option<DDiagram> diagram = new EObjectQuery(element).getParentDiagram(); if (diagram.some()) { interpreter.setVariable(IInterpreterSiriusVariables.DIAGRAM, diagram.get()); } else { interpreter.setVariable(IInterpreterSiriusVariables.DIAGRAM, null); } final Map<AbstractVariable, Object> variables = new HashMap<AbstractVariable, Object>(); variables.put(navDesc.getContainerVariable(), element.getTarget()); variables.put(navDesc.getContainerViewVariable(), element); final InitInterpreterVariablesTask init = new InitInterpreterVariablesTask(variables, interpreter, new EMFCommandFactoryUI()); init.execute(); final String precondition = navDesc.getPrecondition(); if (append && precondition != null && !StringUtil.isEmpty(precondition.trim())) { append = false; try { append = interpreter.evaluateBoolean(element.getTarget(), navDesc.getPrecondition()); } catch (final EvaluationException e) { RuntimeLoggerManager.INSTANCE.error(navDesc, ToolPackage.eINSTANCE.getAbstractToolDescription_Precondition(), e); } } if (append) { buildOpenRepresentationActions(navigate, interpreter, navDesc, element, session, editpart, transDomain); } interpreter.unSetVariable(IInterpreterSiriusVariables.DIAGRAM); } }

Target:
private void buildNavigableRepresentationsMenu(final IMenuManager navigate, final EObject designerObj, final Session session, final EditPart editpart, final TransactionalEditingDomain transDomain) { final DRepresentationElement element = (DRepresentationElement) designerObj; final Separator createGroup = new Separator(NAVIGATE_REPRESENTATION_GROUP_SEPARATOR); navigate.add(createGroup); for (RepresentationNavigationDescription navDesc : element.getMapping().getNavigationDescriptions()) { boolean append = true; if (!isFromActiveViewpoint(session, navDesc.getRepresentationDescription())) { append = false; } final IInterpreter interpreter = SiriusPlugin.getDefault().getInterpreterRegistry().getInterpreter(element.getTarget()); Option<DDiagram> diagram = new EObjectQuery(element).getParentDiagram(); if (diagram.some()) { interpreter.setVariable(IInterpreterSiriusVariables.DIAGRAM, diagram.get()); } else { interpreter.setVariable(IInterpreterSiriusVariables.DIAGRAM, null); } final Map<AbstractVariable, Object> variables = new HashMap<AbstractVariable, Object>(); variables.put(navDesc.getContainerVariable(), element.getTarget()); variables.put(navDesc.getContainerViewVariable(), element); final InitInterpreterVariablesTask init = new InitInterpreterVariablesTask(variables, interpreter, new EMFCommandFactoryUI()); init.execute(); final String precondition = navDesc.getPrecondition(); if (append && !StringUtil.isEmpty(precondition)) { append = false; try { append = interpreter.evaluateBoolean(element.getTarget(), navDesc.getPrecondition()); } catch (final EvaluationException e) { RuntimeLoggerManager.INSTANCE.error(navDesc, ToolPackage.eINSTANCE.getAbstractToolDescription_Precondition(), e); } } if (append) { buildOpenRepresentationActions(navigate, interpreter, navDesc, element, session, editpart, transDomain); } interpreter.unSetVariable(IInterpreterSiriusVariables.DIAGRAM); } }