private void visitLanes(WorkflowProcess process, StringBuilder xmlDump) { // lanes Collection<Swimlane> swimlanes = ((SwimlaneContext) ((org.jbpm.workflow.core.WorkflowProcess) process) .getDefaultContext(SwimlaneContext.SWIMLANE_SCOPE)).getSwimlanes(); if (!swimlanes.isEmpty()) { xmlDump.append(" <laneSet>" + EOL); for (Swimlane swimlane: swimlanes) { xmlDump.append(" <lane name=\"" + XmlBPMNProcessDumper.replaceIllegalCharsAttribute(swimlane.getName()) + "\" >" + EOL); visitLane(process, swimlane.getName(), xmlDump); xmlDump.append(" </lane>" + EOL); } xmlDump.append(" </laneSet>" + EOL); } }
protected void visitHeader(WorkflowProcess process, StringBuilder xmlDump, boolean includeMeta) { xmlDump.append(" <header>" + EOL); visitImports(((org.jbpm.process.core.Process) process).getImports(), xmlDump); visitGlobals(((org.jbpm.process.core.Process) process).getGlobals(), xmlDump); visitFunctionImports(((org.jbpm.process.core.Process) process).getFunctionImports(), xmlDump); VariableScope variableScope = (VariableScope) ((org.jbpm.process.core.Process) process).getDefaultContext(VariableScope.VARIABLE_SCOPE); if (variableScope != null) { visitVariables(variableScope.getVariables(), xmlDump); } SwimlaneContext swimlaneContext = (SwimlaneContext) ((org.jbpm.process.core.Process) process).getDefaultContext(SwimlaneContext.SWIMLANE_SCOPE); if (swimlaneContext != null) { visitSwimlanes(swimlaneContext.getSwimlanes(), xmlDump); } ExceptionScope exceptionScope = (ExceptionScope) ((org.jbpm.process.core.Process) process).getDefaultContext(ExceptionScope.EXCEPTION_SCOPE); if (exceptionScope != null) { visitExceptionHandlers(exceptionScope.getExceptionHandlers(), xmlDump); } xmlDump.append(" </header>" + EOL + EOL); }
assertEquals(2, process.getGlobals().size()); assertEquals(4, process.getVariableScope().getVariables().size()); assertEquals(2, process.getSwimlaneContext().getSwimlanes().size()); assertEquals(2, process.getExceptionScope().getExceptionHandlers().size());
private void visitLanes(WorkflowProcess process, StringBuilder xmlDump) { // lanes Collection<Swimlane> swimlanes = ((SwimlaneContext) ((org.jbpm.workflow.core.WorkflowProcess) process) .getDefaultContext(SwimlaneContext.SWIMLANE_SCOPE)).getSwimlanes(); if (!swimlanes.isEmpty()) { xmlDump.append(" <laneSet>" + EOL); for (Swimlane swimlane: swimlanes) { xmlDump.append(" <lane name=\"" + XmlBPMNProcessDumper.replaceIllegalCharsAttribute(swimlane.getName()) + "\" >" + EOL); visitLane(process, swimlane.getName(), xmlDump); xmlDump.append(" </lane>" + EOL); } xmlDump.append(" </laneSet>" + EOL); } }
protected void visitHeader(WorkflowProcess process, StringBuilder xmlDump, boolean includeMeta) { xmlDump.append(" <header>" + EOL); visitImports(((org.jbpm.process.core.Process) process).getImports(), xmlDump); visitGlobals(((org.jbpm.process.core.Process) process).getGlobals(), xmlDump); visitFunctionImports(((org.jbpm.process.core.Process) process).getFunctionImports(), xmlDump); VariableScope variableScope = (VariableScope) ((org.jbpm.process.core.Process) process).getDefaultContext(VariableScope.VARIABLE_SCOPE); if (variableScope != null) { visitVariables(variableScope.getVariables(), xmlDump); } SwimlaneContext swimlaneContext = (SwimlaneContext) ((org.jbpm.process.core.Process) process).getDefaultContext(SwimlaneContext.SWIMLANE_SCOPE); if (swimlaneContext != null) { visitSwimlanes(swimlaneContext.getSwimlanes(), xmlDump); } ExceptionScope exceptionScope = (ExceptionScope) ((org.jbpm.process.core.Process) process).getDefaultContext(ExceptionScope.EXCEPTION_SCOPE); if (exceptionScope != null) { visitExceptionHandlers(exceptionScope.getExceptionHandlers(), xmlDump); } xmlDump.append(" </header>" + EOL + EOL); }