@Test public void processDocumentation() { final BPMNDocumentation bpmnDocumentation = tested.processDocumentation(diagram); final ProcessOverview process = bpmnDocumentation.getProcess(); final General general = process.getGeneral(); assertEquals(PROCESS_PACKAGE, bpmnDocumentation.getModuleName()); assertEquals(PROCESS_DECRIPTION, general.getDescription()); assertNotEquals(PROCESS_DOCUMENTATION, general.getDocumentation()); assertEquals(PROCESS_DOCUMENTATION.replaceAll("\n", "<br/>"), general.getDocumentation()); assertEquals(PROCESS_UUID, general.getId()); assertEquals(PROCESS_IS_ADHOC.toString(), general.getIsAdhoc()); assertEquals(PROCESS_IS_EXECUTABLE.toString(), general.getIsExecutable()); assertEquals(PROCESS_NAME, general.getName()); assertEquals(PROCESS_PACKAGE, general.getPkg()); assertEquals(PROCESS_VERSION, general.getVersion()); final org.kie.workbench.common.stunner.bpmn.documentation.model.general.Imports importsDoc = process.getImports(); final org.kie.workbench.common.stunner.bpmn.documentation.model.general.Imports.DefaultImport[] defaultImportsDoc = importsDoc.getDefaultImports(); final org.kie.workbench.common.stunner.bpmn.documentation.model.general.Imports.WSDLImport[] wsdlImportsDoc = importsDoc.getWSDLImports(); assertEquals(EMPTY_VALUE, importsDoc.getDefaultImportsHidden()); assertEquals(EMPTY_VALUE, importsDoc.getWSDLImportsHidden()); assertEquals(EMPTY_VALUE, importsDoc.getImportsTableHidden()); assertEquals(HIDDEN, importsDoc.getNoImportsHidden()); assertEquals(3, importsDoc.getTotalDefaultImports(), 0); assertEquals(4, importsDoc.getTotalWSDLImports(), 0); assertEquals(defaultImportsDoc[0].getClassName(), CLASS_NAME + "1"); assertEquals(defaultImportsDoc[1].getClassName(), CLASS_NAME + "2"); assertEquals(defaultImportsDoc[2].getClassName(), CLASS_NAME + "3"); assertEquals(wsdlImportsDoc[0].getLocation(), LOCATION + "1"); assertEquals(wsdlImportsDoc[0].getNamespace(), NAMESPACE + "1"); assertEquals(wsdlImportsDoc[1].getLocation(), LOCATION + "2"); assertEquals(wsdlImportsDoc[1].getNamespace(), NAMESPACE + "2"); assertEquals(wsdlImportsDoc[2].getLocation(), LOCATION + "3"); assertEquals(wsdlImportsDoc[2].getNamespace(), NAMESPACE + "3"); assertEquals(wsdlImportsDoc[3].getLocation(), LOCATION + "4"); assertEquals(wsdlImportsDoc[3].getNamespace(), NAMESPACE + "4"); final ProcessVariablesTotal dataTotal = process.getDataTotal(); assertEquals(6, dataTotal.getTotal(), 0); assertEquals(6, dataTotal.getTotalVariables(), 0); final ProcessVariablesTotal.VariableTriplets[] variables = dataTotal.getVariablesAsTriplets(); assertEquals("GL1", variables[0].getName()); assertEquals(String.class.getName(), variables[0].getType()); assertEquals("[]", variables[0].getTags()); assertEquals("GL2", variables[1].getName()); assertEquals(Boolean.class.getName(), variables[1].getType()); assertEquals("[]", variables[1].getTags()); assertEquals("PV1", variables[2].getName()); assertEquals(String.class.getName(), variables[2].getType()); assertEquals("[internal;input]", variables[2].getTags()); assertEquals("PV2", variables[3].getName()); assertEquals(Boolean.class.getName(), variables[3].getType()); assertEquals("[customTag;output]", variables[3].getTags()); assertEquals("SUBPV1", variables[4].getName()); assertEquals(String.class.getName(), variables[4].getType()); assertEquals("[internal]", variables[4].getTags()); assertEquals("SUBPV2", variables[5].getName()); assertEquals(Boolean.class.getName(), variables[5].getType()); assertEquals("[readonly;customTag]", variables[5].getTags()); final ElementTotal[] totals = bpmnDocumentation.getElementsDetails().getTotals(); assertEquals(2, totals.length); final ElementTotal activities = totals[0]; assertEquals(BPMNCategories.ACTIVITIES, activities.getType()); assertEquals(ICON_HTML, activities.getTypeIcon()); assertEquals(1, activities.getQuantity()); final ElementTotal subprocesses = totals[1]; assertEquals(BPMNCategories.SUB_PROCESSES, subprocesses.getType()); assertEquals(ICON_HTML, subprocesses.getTypeIcon()); assertEquals(1, subprocesses.getQuantity()); final Element[] activitiesElements = activities.getElements(); final Element task = activitiesElements[0]; assertEquals(TASK_NAME, task.getTitle()); assertEquals(BPMNCategories.ACTIVITIES, task.getType()); assertEquals(ICON_HTML, task.getIcon()); assertEquals(TASK_NAME, task.getName()); final KeyValue[] taskProperties = task.getProperties(); assertProperty(taskProperties[0], ASSIGNEMNTS, ASSIGNEMNTS_CAPTION, userTask.getExecutionSet().getDescription()); assertProperty(taskProperties[1], TASK_DESCRIPTION, DESCRIPTION_CAPTION, userTask.getExecutionSet().getDescription()); assertProperty(taskProperties[2], TASK_DOCUMENTATION, DOCUMENTATION_CAPTION, userTask.getGeneral().getDocumentation()); assertProperty(taskProperties[3], TASK_GROUPID, GROUP_CAPTION, userTask.getExecutionSet().getGroupid()); assertProperty(taskProperties[4], TASK_PRIORITY, PRIORITY_CAPTION, userTask.getExecutionSet().getPriority()); assertProperty(taskProperties[5], TASK_SUBJECT, SUBJECT_CAPTION, userTask.getExecutionSet().getSubject()); final Element[] subprocessesElements = subprocesses.getElements(); final Element subprocess = subprocessesElements[0]; assertEquals(SUB_PROCESS_NAME, subprocess.getTitle()); assertEquals(BPMNCategories.SUB_PROCESSES, subprocess.getType()); assertEquals(ICON_HTML, subprocess.getIcon()); assertEquals(SUB_PROCESS_NAME, subprocess.getName()); final KeyValue[] subprocessProperties = subprocess.getProperties(); assertProperty(subprocessProperties[0], SUB_PROCESS_DOCUMENTATION, DOCUMENTATION_CAPTION, embeddedSubprocess.getGeneral().getDocumentation()); assertProperty(subprocessProperties[1], "false", ISASYNC_CAPTION, embeddedSubprocess.getExecutionSet().getIsAsync()); assertProperty(subprocessProperties[2], ON_ENTRY_ACTION, ON_ENTRY_CAPTION, embeddedSubprocess.getExecutionSet().getOnEntryAction()); assertProperty(subprocessProperties[3], ON_EXIT_ACTION, ON_EXIT_CAPTION, embeddedSubprocess.getExecutionSet().getOnEntryAction()); }
@Override public BPMNDocumentation processDocumentation(Diagram diagram) { final Graph<?, Node> graph = diagram.getGraph(); final Optional<BPMNDiagramImpl> diagramModel = getDiagramModel(graph).findFirst(); return BPMNDocumentation.create(getProcessOverview(diagramModel, graph), getElementsDetails(graph), getDiagramImage(Optional.ofNullable(sessionManager.getCurrentSession()) .map(s -> ((ClientSession) s).getCanvasHandler()) .filter(c -> c instanceof AbstractCanvasHandler) .map(c -> (AbstractCanvasHandler) c))); }
ClientBPMNDocumentationService implements BPMNDocumentationService { @Override public BPMNDocumentation processDocumentation(Diagram diagram) { final Graph<?, Node> graph = diagram.getGraph(); final Optional<BPMNDiagramImpl> diagramModel = getDiagramModel(graph).findFirst(); return BPMNDocumentation.create(getProcessOverview(diagramModel, graph), getElementsDetails(graph), getDiagramImage(Optional.ofNullable(sessionManager.getCurrentSession()) .map(s -> ((ClientSession) s).getCanvasHandler()) .filter(c -> c instanceof AbstractCanvasHandler) .map(c -> (AbstractCanvasHandler) c))); } }
ClientBPMNDocumentationService implements BPMNDocumentationService { @Override public BPMNDocumentation processDocumentation(Diagram diagram) { final Graph<?, Node> graph = diagram.getGraph(); final Optional<BPMNDiagramImpl> diagramModel = getDiagramModel(graph).findFirst(); return BPMNDocumentation.create(getProcessOverview(diagramModel, graph), getElementsDetails(graph), getDiagramImage(Optional.ofNullable(sessionManager.getCurrentSession()) .map(s -> ((ClientSession) s).getCanvasHandler()) .filter(c -> c instanceof AbstractCanvasHandler) .map(c -> (AbstractCanvasHandler) c))); } @Inject  ClientBPMNDocumentationService(final ClientMustacheTemplateRenderer mustacheTemplateRenderer,
                                          final DefinitionManager definitionManager,
                                          final DefinitionUtils definitionUtils,
                                          final BPMNShapeFactory shapeFactory,
                                          final CanvasFileExport canvasFileExport,
                                          final SessionManager sessionManager,
                                          final BPMNCategoryDefinitionProvider categoryDefinitionProvider,
                                          final DOMGlyphRenderers glyphRenderer,
                                          final ClientTranslationService translationService,
                                          final @Default ManagedInstance<WorkItemDefinitionRegistry> workItemDefinitionRegistry,
                                          final PropertyDecorators propertyDecorators

    ); }
ClientBPMNDocumentationService implements BPMNDocumentationService { @Override public BPMNDocumentation processDocumentation(Diagram diagram) { final Graph<?, Node> graph = diagram.getGraph(); final Optional<BPMNDiagramImpl> diagramModel = getDiagramModel(graph).findFirst(); return BPMNDocumentation.create(getProcessOverview(diagramModel, graph), getElementsDetails(graph), getDiagramImage(Optional.ofNullable(sessionManager.getCurrentSession()) .map(s -> ((ClientSession) s).getCanvasHandler()) .filter(c -> c instanceof AbstractCanvasHandler) .map(c -> (AbstractCanvasHandler) c))); } @Inject  ClientBPMNDocumentationService(final ClientMustacheTemplateRenderer mustacheTemplateRenderer,
                                          final DefinitionManager definitionManager,
                                          final DefinitionUtils definitionUtils,
                                          final BPMNShapeFactory shapeFactory,
                                          final CanvasFileExport canvasFileExport,
                                          final SessionManager sessionManager,
                                          final BPMNCategoryDefinitionProvider categoryDefinitionProvider,
                                          final DOMGlyphRenderers glyphRenderer,
                                          final ClientTranslationService translationService,
                                          final @Default ManagedInstance<WorkItemDefinitionRegistry> workItemDefinitionRegistry,
                                          final PropertyDecorators propertyDecorators

    ); @Override BPMNDocumentation processDocumentation(Diagram diagram); @Override HTMLDocumentationTemplate getDocumentationTemplate(); @Override DocumentationOutput buildDocumentation(HTMLDocumentationTemplate template, BPMNDocumentation diagramDocumentation); @Override DocumentationOutput generate(Diagram diagram); }
ClientBPMNDocumentationService implements BPMNDocumentationService { @Override public BPMNDocumentation processDocumentation(Diagram diagram) { final Graph<?, Node> graph = diagram.getGraph(); final Optional<BPMNDiagramImpl> diagramModel = getDiagramModel(graph).findFirst(); return BPMNDocumentation.create(getProcessOverview(diagramModel, graph), getElementsDetails(graph), getDiagramImage(Optional.ofNullable(sessionManager.getCurrentSession()) .map(s -> ((ClientSession) s).getCanvasHandler()) .filter(c -> c instanceof AbstractCanvasHandler) .map(c -> (AbstractCanvasHandler) c))); } @Inject  ClientBPMNDocumentationService(final ClientMustacheTemplateRenderer mustacheTemplateRenderer,
                                          final DefinitionManager definitionManager,
                                          final DefinitionUtils definitionUtils,
                                          final BPMNShapeFactory shapeFactory,
                                          final CanvasFileExport canvasFileExport,
                                          final SessionManager sessionManager,
                                          final BPMNCategoryDefinitionProvider categoryDefinitionProvider,
                                          final DOMGlyphRenderers glyphRenderer,
                                          final ClientTranslationService translationService,
                                          final @Default ManagedInstance<WorkItemDefinitionRegistry> workItemDefinitionRegistry,
                                          final PropertyDecorators propertyDecorators

    ); @Override BPMNDocumentation processDocumentation(Diagram diagram); @Override HTMLDocumentationTemplate getDocumentationTemplate(); @Override DocumentationOutput buildDocumentation(HTMLDocumentationTemplate template, BPMNDocumentation diagramDocumentation); @Override DocumentationOutput generate(Diagram diagram); static final int ICON_HEIGHT; static final int ICON_WIDTH; }