private Iterable<Node<Content, Edge>> getMockNodes(final String... uuids) { final List<Node<Content, Edge>> nodes = new ArrayList<>(); for (String uuid : uuids) { final Node<Content, Edge> node = new NodeImpl<>(uuid); node.setContent(new Content()); nodes.add(node); } return nodes; }
@SuppressWarnings("unchecked") private Node<View<BPMNViewDefinition>, Edge> makeNode(final String uuid, final CaseManagementShape shape) { final Node<View<BPMNViewDefinition>, Edge> node = new NodeImpl<>(uuid); node.setContent(new ViewImpl(new CaseManagementDiagram(), Bounds.create(0d, 0d, 10d, 20d))); when(canvas.getShape(eq(uuid))).thenReturn(shape); when(clientDefinitionManager.adapters()).thenReturn(adapterManager); when(adapterManager.forDefinition()).thenReturn(definitionAdapter); when(adapterManager.forProperty()).thenReturn(propertyAdapter); when(definitionAdapter.getMetaProperty(eq(PropertyMetaTypes.NAME), anyObject())).thenReturn(PropertyMetaTypes.NAME); when(propertyAdapter.getValue(eq(PropertyMetaTypes.NAME))).thenReturn("name"); return node; }
public static Node<View<?>, Edge> makeNode(final String uuid, final String content, final double x, final double y, final double w, final double h) { final Bounds bounds = Bounds.create(x, y, x + w, y + h); final Node<View<?>, Edge> node = new NodeImpl<>(uuid); node.setContent(new ViewImpl<>(content, bounds)); return node; } }
private Node<View, Edge> newNode(final Object definition) { final Node<View, Edge> node = new NodeImpl<>(UUID.uuid()); final View<Object> content = new ViewImpl<>(definition, bounds); node.setContent(content); return node; }
@Before public void setUp() { super.setUp(); candidate = graphInstance.containerNode; parent = graphInstance.parentNode; candidate.setContent(candidateContent); this.position = new Point2D(1, 1); this.cloneNodeCommand = new CloneNodeCommand(candidate, parent.getUUID(), position, null, childrenTraverseProcessorManagedInstance); }
@Test public void testToFlowElement_process() throws Exception { final BaseCaseManagementReusableSubprocess definition = new ProcessReusableSubprocess(); final View<BaseCaseManagementReusableSubprocess> view = new ViewImpl<>(definition, Bounds.create()); final Node<View<BaseCaseManagementReusableSubprocess>, ?> node = new NodeImpl<>(UUID.randomUUID().toString()); node.setContent(view); final PropertyWriter propertyWriter = tested.toFlowElement(node); assertTrue(propertyWriter instanceof CaseManagementCallActivityPropertyWriter); assertFalse(CaseManagementCustomElement.isCase.of(propertyWriter.getFlowElement()).get()); } }
@Test public void testToFlowElement_case() throws Exception { final BaseCaseManagementReusableSubprocess definition = new CaseReusableSubprocess(); final View<BaseCaseManagementReusableSubprocess> view = new ViewImpl<>(definition, Bounds.create()); final Node<View<BaseCaseManagementReusableSubprocess>, ?> node = new NodeImpl<>(UUID.randomUUID().toString()); node.setContent(view); final PropertyWriter propertyWriter = tested.toFlowElement(node); assertTrue(propertyWriter instanceof CaseManagementCallActivityPropertyWriter); assertTrue(CaseManagementCustomElement.isCase.of(propertyWriter.getFlowElement()).get()); }
@Test public void testConvertSubProcess() { final Node<View<? extends BPMNViewDefinition>, ?> node = new NodeImpl<>("n"); final AdHocSubprocess subProcessNode = new AdHocSubprocess(); subProcessNode.getExecutionSet().setAdHocOrdering(new AdHocOrdering("Sequential")); node.setContent(new ViewImpl<>(subProcessNode, Bounds.create())); final Activity activity = tested.convertSubProcess(node).value().getFlowElement(); assertEquals("<![CDATA[Stage]]>", CustomElement.name.of(activity).get()); }
rootNode.getLabels().addAll(root.getLabels()); rootNode.getLabels().add("org.kie.workbench.common.stunner.cm.definition.CaseManagementDiagram"); rootNode.setContent(rootContent); stage1Node.getLabels().addAll(stage1.getLabels()); stage1Node.getLabels().add("org.kie.workbench.common.stunner.cm.definition.AdHocSubprocess"); stage1Node.setContent(stage1Content); task1Node.getLabels().addAll(task1.getLabels()); task1Node.getLabels().add("org.kie.workbench.common.stunner.bpmn.definition.UserTask"); task1Node.setContent(task1Content); case1Node.getLabels().addAll(case1.getLabels()); case1Node.getLabels().add("org.kie.workbench.common.stunner.cm.definition.CaseReusableSubprocess"); case1Node.setContent(case1Content); stage2Node.getLabels().addAll(stage2.getLabels()); stage2Node.getLabels().add("org.kie.workbench.common.stunner.cm.definition.AdHocSubprocess"); stage2Node.setContent(stage2Content); case2Node.getLabels().addAll(case2.getLabels()); case2Node.getLabels().add("org.kie.workbench.common.stunner.cm.definition.CaseReusableSubprocess"); case2Node.setContent(case2Content); process2Node.getLabels().addAll(process2.getLabels()); process2Node.getLabels().add("org.kie.workbench.common.stunner.cm.definition.CaseReusableSubprocess"); process2Node.setContent(process2Content);
rootNode.getLabels().addAll(root.getLabels()); rootNode.getLabels().add("org.kie.workbench.common.stunner.cm.definition.CaseManagementDiagram"); rootNode.setContent(rootContent); stageNode.getLabels().addAll(stage.getLabels()); stageNode.getLabels().add("org.kie.workbench.common.stunner.cm.definition.AdHocSubprocess"); stageNode.setContent(stageContent); subcaseNode.getLabels().addAll(subcase.getLabels()); subcaseNode.getLabels().add("org.kie.workbench.common.stunner.cm.definition.CaseReusableSubprocess"); subcaseNode.setContent(subcaseContent);
rootNode.getLabels().addAll(root.getLabels()); rootNode.getLabels().add("org.kie.workbench.common.stunner.cm.definition.CaseManagementDiagram"); rootNode.setContent(rootContent); stageNode.getLabels().addAll(stage.getLabels()); stageNode.getLabels().add("org.kie.workbench.common.stunner.cm.definition.AdHocSubprocess"); stageNode.setContent(stageContent); subprocessNode.getLabels().addAll(subprocess.getLabels()); subprocessNode.getLabels().add("org.kie.workbench.common.stunner.cm.definition.ProcessReusableSubprocess"); subprocessNode.setContent(subprocessContent);
rootNode.getLabels().addAll(root.getLabels()); rootNode.getLabels().add("org.kie.workbench.common.stunner.cm.definition.CaseManagementDiagram"); rootNode.setContent(rootContent); stageNode.getLabels().addAll(stage.getLabels()); stageNode.getLabels().add("org.kie.workbench.common.stunner.cm.definition.AdHocSubprocess"); stageNode.setContent(stageContent);
rootNode.getLabels().addAll(root.getLabels()); rootNode.getLabels().add("org.kie.workbench.common.stunner.cm.definition.CaseManagementDiagram"); rootNode.setContent(rootContent); stageNode.getLabels().addAll(stage.getLabels()); stageNode.getLabels().add("org.kie.workbench.common.stunner.cm.definition.AdHocSubprocess"); stageNode.setContent(stageContent); taskNode.getLabels().addAll(task.getLabels()); taskNode.getLabels().add("org.kie.workbench.common.stunner.bpmn.definition.UserTask"); taskNode.setContent(taskContent);
rootNode.getLabels().addAll(root.getLabels()); rootNode.getLabels().add("org.kie.workbench.common.stunner.cm.definition.CaseManagementDiagram"); rootNode.setContent(rootContent);