@Test public void addChildShape() { BPMNShape bpmnShape = di.createBPMNShape(); bpmnShape.setId("a"); p.addChildShape(bpmnShape); assertThatThrownBy(() -> p.addChildShape(bpmnShape)) .isInstanceOf(IllegalArgumentException.class) .hasMessageStartingWith("Cannot add the same shape twice"); }
public void addChildShape(BPMNShape shape) { if (shape == null) { return; } List<DiagramElement> planeElement = bpmnPlane.getPlaneElement(); if (planeElement.contains(shape)) { throw new IllegalArgumentException("Cannot add the same shape twice: " + shape.getId()); } planeElement.add(shape); }
ProcessPropertyWriter extends BasePropertyWriter implements ElementContainer { public void addChildShape(BPMNShape shape) { if (shape == null) { return; } List<DiagramElement> planeElement = bpmnPlane.getPlaneElement(); if (planeElement.contains(shape)) { throw new IllegalArgumentException("Cannot add the same shape twice: " + shape.getId()); } planeElement.add(shape); } }
ProcessPropertyWriter extends BasePropertyWriter implements ElementContainer { public void addChildShape(BPMNShape shape) { if (shape == null) { return; } List<DiagramElement> planeElement = bpmnPlane.getPlaneElement(); if (planeElement.contains(shape)) { throw new IllegalArgumentException("Cannot add the same shape twice: " + shape.getId()); } planeElement.add(shape); } ProcessPropertyWriter(Process process, VariableScope variableScope, Set<DataObject> dataObjects); }
ProcessPropertyWriter extends BasePropertyWriter implements ElementContainer { public void addChildShape(BPMNShape shape) { if (shape == null) { return; } List<DiagramElement> planeElement = bpmnPlane.getPlaneElement(); if (planeElement.contains(shape)) { throw new IllegalArgumentException("Cannot add the same shape twice: " + shape.getId()); } planeElement.add(shape); } ProcessPropertyWriter(Process process, VariableScope variableScope, Set<DataObject> dataObjects); void setId(String value); Process getProcess(); void addChildShape(BPMNShape shape); void addChildEdge(BPMNEdge edge); BPMNDiagram getBpmnDiagram(); void addChildElement(BasePropertyWriter p); @Override Collection<BasePropertyWriter> getChildElements(); BasePropertyWriter getChildElement(String id); void setName(String value); void setExecutable(Boolean value); void setPackage(String value); void setType(String value); void setVersion(String value); void setAdHoc(Boolean adHoc); void setDescription(String value); void setProcessVariables(BaseProcessVariables processVariables); void setMetadata(final MetaDataAttributes metaDataAttributes); void setCaseFileVariables(CaseFileVariables caseFileVariables); void setCaseIdPrefix(CaseIdPrefix caseIdPrefix); void setCaseRoles(CaseRoles roles); void setGlobalVariables(GlobalVariables globalVariables); void setDefaultImports(List<DefaultImport> imports); void setSlaDueDate(SLADueDate slaDueDate); void addLaneSet(Collection<LanePropertyWriter> lanes); Collection<ElementParameters> getSimulationParameters(); Relationship getRelationship(); Set<DataObject> getDataObjects(); }
ProcessPropertyWriter extends BasePropertyWriter implements ElementContainer { public void addChildShape(BPMNShape shape) { if (shape == null) { return; } List<DiagramElement> planeElement = bpmnPlane.getPlaneElement(); if (planeElement.contains(shape)) { throw new IllegalArgumentException("Cannot add the same shape twice: " + shape.getId()); } planeElement.add(shape); } ProcessPropertyWriter(Process process, VariableScope variableScope, Set<DataObject> dataObjects); void setId(String value); Process getProcess(); void addChildShape(BPMNShape shape); void addChildEdge(BPMNEdge edge); BPMNDiagram getBpmnDiagram(); void addChildElement(BasePropertyWriter p); @Override Collection<BasePropertyWriter> getChildElements(); BasePropertyWriter getChildElement(String id); void setName(String value); void setExecutable(Boolean value); void setPackage(String value); void setType(String value); void setVersion(String value); void setAdHoc(Boolean adHoc); void setDescription(String value); void setProcessVariables(BaseProcessVariables processVariables); void setMetadata(final MetaDataAttributes metaDataAttributes); void setCaseFileVariables(CaseFileVariables caseFileVariables); void setCaseIdPrefix(CaseIdPrefix caseIdPrefix); void setCaseRoles(CaseRoles roles); void setGlobalVariables(GlobalVariables globalVariables); void setDefaultImports(List<DefaultImport> imports); void setSlaDueDate(SLADueDate slaDueDate); void addLaneSet(Collection<LanePropertyWriter> lanes); Collection<ElementParameters> getSimulationParameters(); Relationship getRelationship(); Set<DataObject> getDataObjects();  }