Search in sources :

Example 1 with Id

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());
}
Also used : ConstraintViolation(javax.validation.ConstraintViolation) BPMNDiagramImpl(org.kie.workbench.common.stunner.bpmn.definition.BPMNDiagramImpl) Id(org.kie.workbench.common.stunner.bpmn.definition.property.diagram.Id) Test(org.junit.Test)

Example 2 with Id

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);
}
Also used : Documentation(org.kie.workbench.common.stunner.bpmn.definition.property.general.Documentation) ProcessInstanceDescription(org.kie.workbench.common.stunner.bpmn.definition.property.diagram.ProcessInstanceDescription) View(org.kie.workbench.common.stunner.core.graph.content.view.View) ProcessData(org.kie.workbench.common.stunner.bpmn.definition.property.variables.ProcessData) Name(org.kie.workbench.common.stunner.bpmn.definition.property.general.Name) ProcessVariables(org.kie.workbench.common.stunner.bpmn.definition.property.variables.ProcessVariables) Version(org.kie.workbench.common.stunner.bpmn.definition.property.diagram.Version) DiagramSet(org.kie.workbench.common.stunner.bpmn.definition.property.diagram.DiagramSet) BPMNDiagramImpl(org.kie.workbench.common.stunner.bpmn.definition.BPMNDiagramImpl) Id(org.kie.workbench.common.stunner.bpmn.definition.property.diagram.Id) Package(org.kie.workbench.common.stunner.bpmn.definition.property.diagram.Package) AdHoc(org.kie.workbench.common.stunner.bpmn.definition.property.diagram.AdHoc) Executable(org.kie.workbench.common.stunner.bpmn.definition.property.diagram.Executable) Edge(org.kie.workbench.common.stunner.core.graph.Edge) ProcessPropertyReader(org.kie.workbench.common.stunner.bpmn.backend.converters.tostunner.properties.ProcessPropertyReader)

Example 3 with Id

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;
}
Also used : Version(org.kie.workbench.common.stunner.bpmn.definition.property.diagram.Version) DiagramSet(org.kie.workbench.common.stunner.bpmn.definition.property.diagram.DiagramSet) BPMNDiagramImpl(org.kie.workbench.common.stunner.bpmn.definition.BPMNDiagramImpl) Id(org.kie.workbench.common.stunner.bpmn.definition.property.diagram.Id) Package(org.kie.workbench.common.stunner.bpmn.definition.property.diagram.Package) Name(org.kie.workbench.common.stunner.bpmn.definition.property.general.Name)

Aggregations

BPMNDiagramImpl (org.kie.workbench.common.stunner.bpmn.definition.BPMNDiagramImpl)3 Id (org.kie.workbench.common.stunner.bpmn.definition.property.diagram.Id)3 DiagramSet (org.kie.workbench.common.stunner.bpmn.definition.property.diagram.DiagramSet)2 Package (org.kie.workbench.common.stunner.bpmn.definition.property.diagram.Package)2 Version (org.kie.workbench.common.stunner.bpmn.definition.property.diagram.Version)2 Name (org.kie.workbench.common.stunner.bpmn.definition.property.general.Name)2 ConstraintViolation (javax.validation.ConstraintViolation)1 Test (org.junit.Test)1 ProcessPropertyReader (org.kie.workbench.common.stunner.bpmn.backend.converters.tostunner.properties.ProcessPropertyReader)1 AdHoc (org.kie.workbench.common.stunner.bpmn.definition.property.diagram.AdHoc)1 Executable (org.kie.workbench.common.stunner.bpmn.definition.property.diagram.Executable)1 ProcessInstanceDescription (org.kie.workbench.common.stunner.bpmn.definition.property.diagram.ProcessInstanceDescription)1 Documentation (org.kie.workbench.common.stunner.bpmn.definition.property.general.Documentation)1 ProcessData (org.kie.workbench.common.stunner.bpmn.definition.property.variables.ProcessData)1 ProcessVariables (org.kie.workbench.common.stunner.bpmn.definition.property.variables.ProcessVariables)1 Edge (org.kie.workbench.common.stunner.core.graph.Edge)1 View (org.kie.workbench.common.stunner.core.graph.content.view.View)1