Source:
protected String getProcessVariables() { Diagram diagram = canvasSessionManager.getCurrentSession().getCanvasHandler().getDiagram(); Node selectedElement = getSelectedElement(); Element parent = null; if (selectedElement != null) { parent = graphUtils.getParent(selectedElement); } Iterator<Element> it = diagram.getGraph().nodes().iterator(); StringBuffer variables = new StringBuffer(); while (it.hasNext()) { Element element = it.next(); if (element.getContent() instanceof View) { Object oDefinition = ((View) element.getContent()).getDefinition(); if ((oDefinition instanceof BPMNDiagramImpl)) { BPMNDiagramImpl bpmnDiagram = (BPMNDiagramImpl) oDefinition; ProcessVariables processVariables = bpmnDiagram.getProcessData().getProcessVariables(); if (processVariables != null) { if (variables.length() > 0) { variables.append(","); } variables.append(processVariables.getValue()); } } if (parent != null) { if (parent.equals(element)) { ProcessVariables subprocessVariables = null; if (oDefinition instanceof EventSubprocess) { EventSubprocess subprocess = (EventSubprocess) oDefinition; subprocessVariables = subprocess.getProcessData().getProcessVariables(); } else if (oDefinition instanceof AdHocSubprocess) { AdHocSubprocess subprocess = (AdHocSubprocess) oDefinition; subprocessVariables = subprocess.getProcessData().getProcessVariables(); } else if (oDefinition instanceof MultipleInstanceSubprocess) { MultipleInstanceSubprocess subprocess = (MultipleInstanceSubprocess) oDefinition; subprocessVariables = subprocess.getProcessData().getProcessVariables(); } else if (oDefinition instanceof EmbeddedSubprocess) { EmbeddedSubprocess subprocess = (EmbeddedSubprocess) oDefinition; subprocessVariables = subprocess.getProcessData().getProcessVariables(); } if (subprocessVariables != null) { if (variables.length() > 0) { variables.append(","); } variables.append(subprocessVariables.getValue()); } } } } } return variables.toString(); }

Target:
protected String getProcessVariables() { Diagram diagram = canvasSessionManager.getCurrentSession().getCanvasHandler().getDiagram(); Node selectedElement = getSelectedElement(); Element parent = null; if (selectedElement != null) { parent = graphUtils.getParent(selectedElement); } Iterator<Element> it = diagram.getGraph().nodes().iterator(); StringBuffer variables = new StringBuffer(); while (it.hasNext()) { Element element = it.next(); if (element.getContent() instanceof View) { Object oDefinition = ((View) element.getContent()).getDefinition(); if ((oDefinition instanceof BPMNDiagramImpl)) { BPMNDiagramImpl bpmnDiagram = (BPMNDiagramImpl) oDefinition; ProcessVariables processVariables = bpmnDiagram.getProcessData().getProcessVariables(); if (processVariables != null) { if (variables.length() > 0) { variables.append(","); } variables.append(processVariables.getValue()); } } if (Objects.equals(parent, element)) { ProcessVariables subprocessVariables = null; if (oDefinition instanceof EventSubprocess) { EventSubprocess subprocess = (EventSubprocess) oDefinition; subprocessVariables = subprocess.getProcessData().getProcessVariables(); } else if (oDefinition instanceof AdHocSubprocess) { AdHocSubprocess subprocess = (AdHocSubprocess) oDefinition; subprocessVariables = subprocess.getProcessData().getProcessVariables(); } else if (oDefinition instanceof MultipleInstanceSubprocess) { MultipleInstanceSubprocess subprocess = (MultipleInstanceSubprocess) oDefinition; subprocessVariables = subprocess.getProcessData().getProcessVariables(); } else if (oDefinition instanceof EmbeddedSubprocess) { EmbeddedSubprocess subprocess = (EmbeddedSubprocess) oDefinition; subprocessVariables = subprocess.getProcessData().getProcessVariables(); } if (subprocessVariables != null) { if (variables.length() > 0) { variables.append(","); } variables.append(subprocessVariables.getValue()); } } } } return variables.toString(); }