use of org.kie.workbench.common.stunner.bpmn.definition.property.diagram.Id in project kie-wb-common by kiegroup.
the class BPMNDiagramTest method testIDInvalid.
@Test
public void testIDInvalid() {
BPMNDiagramImpl BPMNDiagramImpl = createValidBpmnDiagram();
BPMNDiagramImpl.getDiagramSet().setId(new Id(ID_INVALID));
Set<ConstraintViolation<BPMNDiagramImpl>> violations = this.validator.validate(BPMNDiagramImpl);
assertEquals(1, violations.size());
}
use of org.kie.workbench.common.stunner.bpmn.definition.property.diagram.Id in project kie-wb-common by kiegroup.
the class RootProcessConverter method convertProcessNode.
private BpmnNode convertProcessNode(String id, Process process) {
Node<View<BPMNDiagramImpl>, Edge> diagramNode = factoryManager.newNode(id, BPMNDiagramImpl.class);
BPMNDiagramImpl definition = diagramNode.getContent().getDefinition();
ProcessPropertyReader e = propertyReaderFactory.of(process);
definition.setDiagramSet(new DiagramSet(new Name(process.getName()), new Documentation(e.getDocumentation()), new Id(process.getId()), new Package(e.getPackage()), new Version(e.getVersion()), new AdHoc(e.isAdHoc()), new ProcessInstanceDescription(e.getDescription()), new Executable(process.isIsExecutable())));
definition.setProcessData(new ProcessData(new ProcessVariables(e.getProcessVariables())));
diagramNode.getContent().setBounds(e.getBounds());
definition.setFontSet(e.getFontSet());
definition.setBackgroundSet(e.getBackgroundSet());
return BpmnNode.of(diagramNode);
}
use of org.kie.workbench.common.stunner.bpmn.definition.property.diagram.Id in project kie-wb-common by kiegroup.
the class BPMNDiagramTest method createValidBpmnDiagram.
public BPMNDiagramImpl createValidBpmnDiagram() {
BPMNDiagramImpl BPMNDiagramImpl = new BPMNDiagramImpl.BPMNDiagramBuilder().build();
DiagramSet diagramSet = BPMNDiagramImpl.getDiagramSet();
diagramSet.setName(new Name(NAME_VALID));
diagramSet.setId(new Id(ID_VALID));
diagramSet.setPackageProperty(new Package(PACKAGE_VALID));
diagramSet.setVersion(new Version(VERSION_VALID));
return BPMNDiagramImpl;
}
Aggregations