Search in sources :

Example 1 with GlobalVariables

use of org.kie.workbench.common.stunner.bpmn.definition.property.diagram.GlobalVariables in project kie-wb-common by kiegroup.

the class BPMNDiagramTest method testNotEqualsAdvancedData.

@Test
public void testNotEqualsAdvancedData() {
    BPMNDiagramImpl BPMNDiagramImpl = createValidBpmnDiagram();
    BPMNDiagramImpl.setAdvancedData(new RootProcessAdvancedData(new GlobalVariables(GLOBAL_VARIABLES), new MetaDataAttributes(METADATA)));
    RootProcessAdvancedData rootProcessAdvancedData = new RootProcessAdvancedData(new GlobalVariables(), new MetaDataAttributes());
    assertNotEquals(rootProcessAdvancedData, BPMNDiagramImpl.getAdvancedData());
    assertNotEquals(rootProcessAdvancedData.getGlobalVariables(), BPMNDiagramImpl.getAdvancedData().getGlobalVariables());
    assertNotEquals(rootProcessAdvancedData.getMetaDataAttributes(), BPMNDiagramImpl.getAdvancedData().getMetaDataAttributes());
}
Also used : MetaDataAttributes(org.kie.workbench.common.stunner.bpmn.definition.property.diagram.MetaDataAttributes) RootProcessAdvancedData(org.kie.workbench.common.stunner.bpmn.definition.property.variables.RootProcessAdvancedData) GlobalVariables(org.kie.workbench.common.stunner.bpmn.definition.property.diagram.GlobalVariables) BPMNDiagramImpl(org.kie.workbench.common.stunner.bpmn.definition.BPMNDiagramImpl) Test(org.junit.Test)

Example 2 with GlobalVariables

use of org.kie.workbench.common.stunner.bpmn.definition.property.diagram.GlobalVariables in project kie-wb-common by kiegroup.

the class BPMNDiagramTest method testBPMNDiagramEquals.

@Test
public void testBPMNDiagramEquals() {
    BPMNDiagramImpl BPMNDiagramImpl = createValidBpmnDiagram();
    BPMNDiagramImpl.setAdvancedData(new RootProcessAdvancedData(new GlobalVariables(GLOBAL_VARIABLES), new MetaDataAttributes(METADATA)));
    BPMNDiagramImpl BPMNDiagramImpl2 = createValidBpmnDiagram();
    BPMNDiagramImpl2.setAdvancedData(new RootProcessAdvancedData(new GlobalVariables(GLOBAL_VARIABLES), new MetaDataAttributes(METADATA)));
    assertEquals(BPMNDiagramImpl, BPMNDiagramImpl2);
    BPMNDiagramImpl.setAdvancedData(new RootProcessAdvancedData(new GlobalVariables("id:"), new MetaDataAttributes("securityRoles3ß<![CDATA[employees,clients]]>")));
    assertNotEquals(BPMNDiagramImpl, BPMNDiagramImpl2);
    BPMNDiagramImpl.setAdvancedData(new RootProcessAdvancedData(new GlobalVariables(GLOBAL_VARIABLES), new MetaDataAttributes("securityRoles3ß<![CDATA[employees,clients]]>")));
    assertNotEquals(BPMNDiagramImpl, BPMNDiagramImpl2);
    BPMNDiagramImpl.setAdvancedData(new RootProcessAdvancedData(new GlobalVariables("id:"), new MetaDataAttributes(METADATA)));
    assertNotEquals(BPMNDiagramImpl, BPMNDiagramImpl2);
    BPMNDiagramImpl.setAdvancedData(new RootProcessAdvancedData(new GlobalVariables(GLOBAL_VARIABLES), new MetaDataAttributes(METADATA)));
    assertEquals(BPMNDiagramImpl, BPMNDiagramImpl2);
    BPMNDiagramImpl.setDimensionsSet(new RectangleDimensionsSet(10d, 10d));
    BPMNDiagramImpl2.setDimensionsSet(new RectangleDimensionsSet(20d, 20d));
    assertNotEquals(BPMNDiagramImpl, BPMNDiagramImpl2);
    BPMNDiagramImpl2.setDimensionsSet(new RectangleDimensionsSet(10d, 10d));
    assertEquals(BPMNDiagramImpl, BPMNDiagramImpl2);
}
Also used : MetaDataAttributes(org.kie.workbench.common.stunner.bpmn.definition.property.diagram.MetaDataAttributes) RootProcessAdvancedData(org.kie.workbench.common.stunner.bpmn.definition.property.variables.RootProcessAdvancedData) GlobalVariables(org.kie.workbench.common.stunner.bpmn.definition.property.diagram.GlobalVariables) BPMNDiagramImpl(org.kie.workbench.common.stunner.bpmn.definition.BPMNDiagramImpl) RectangleDimensionsSet(org.kie.workbench.common.stunner.bpmn.definition.property.dimensions.RectangleDimensionsSet) Test(org.junit.Test)

Example 3 with GlobalVariables

use of org.kie.workbench.common.stunner.bpmn.definition.property.diagram.GlobalVariables in project kie-wb-common by kiegroup.

the class BPMNDiagramTest method testNotAdvancedData.

@Test
public void testNotAdvancedData() {
    ProcessData processData = new ProcessData(GLOBAL_VARIABLES);
    RootProcessAdvancedData rootProcessAdvancedData = new RootProcessAdvancedData(new GlobalVariables(GLOBAL_VARIABLES), new MetaDataAttributes(METADATA));
    assertNotEquals(rootProcessAdvancedData, processData);
}
Also used : MetaDataAttributes(org.kie.workbench.common.stunner.bpmn.definition.property.diagram.MetaDataAttributes) RootProcessAdvancedData(org.kie.workbench.common.stunner.bpmn.definition.property.variables.RootProcessAdvancedData) GlobalVariables(org.kie.workbench.common.stunner.bpmn.definition.property.diagram.GlobalVariables) ProcessData(org.kie.workbench.common.stunner.bpmn.definition.property.variables.ProcessData) Test(org.junit.Test)

Example 4 with GlobalVariables

use of org.kie.workbench.common.stunner.bpmn.definition.property.diagram.GlobalVariables in project kie-wb-common by kiegroup.

the class BPMNDirectDiagramMarshallerTest method testUnmarshallGlobalVariables.

@Test
@SuppressWarnings("unchecked")
public void testUnmarshallGlobalVariables() throws Exception {
    Diagram<Graph, Metadata> diagram = unmarshall(BPMN_GLOBALVARIABLES);
    assertDiagram(diagram, 1);
    assertEquals("Global Variables", diagram.getMetadata().getTitle());
    BPMNDiagramImpl bpmnDiagram = getBpmnDiagram(diagram);
    GlobalVariables variables = bpmnDiagram.getAdvancedData().getGlobalVariables();
    assertEquals("GV1:Boolean,GV2:Boolean,GV3:Integer", variables.getValue());
    Node<? extends Definition, ?> diagramNode = diagram.getGraph().getNode("__-CvwCveEemCffTTkSwXXQ");
    assertTrue(diagramNode.getContent().getDefinition() instanceof BPMNDiagram);
    bpmnDiagram = (BPMNDiagramImpl) diagramNode.getContent().getDefinition();
    assertTrue(bpmnDiagram.getDiagramSet() != null);
    assertTrue(bpmnDiagram.getAdvancedData().getGlobalVariables() != null);
    variables = bpmnDiagram.getAdvancedData().getGlobalVariables();
    assertEquals("GV1:Boolean,GV2:Boolean,GV3:Integer", variables.getValue());
}
Also used : BPMNDiagram(org.kie.workbench.common.stunner.bpmn.definition.BPMNDiagram) Graph(org.kie.workbench.common.stunner.core.graph.Graph) GlobalVariables(org.kie.workbench.common.stunner.bpmn.definition.property.diagram.GlobalVariables) Metadata(org.kie.workbench.common.stunner.core.diagram.Metadata) BPMNDiagramImpl(org.kie.workbench.common.stunner.bpmn.definition.BPMNDiagramImpl) Test(org.junit.Test)

Example 5 with GlobalVariables

use of org.kie.workbench.common.stunner.bpmn.definition.property.diagram.GlobalVariables in project kie-wb-common by kiegroup.

the class ProcessPropertyWriterTest method globalVariables.

@Test
public void globalVariables() {
    GlobalVariables globalVariables = new GlobalVariables("GV1:Boolean,GV2:Boolean,GV3:Integer");
    p.setGlobalVariables(globalVariables);
    String globalVariablesString = CustomElement.globalVariables.of(p.getProcess()).get();
    assertThat(globalVariablesString).isEqualTo("GV1:Boolean,GV2:Boolean,GV3:Integer");
}
Also used : GlobalVariables(org.kie.workbench.common.stunner.bpmn.definition.property.diagram.GlobalVariables) Test(org.junit.Test)

Aggregations

GlobalVariables (org.kie.workbench.common.stunner.bpmn.definition.property.diagram.GlobalVariables)9 Test (org.junit.Test)8 RootProcessAdvancedData (org.kie.workbench.common.stunner.bpmn.definition.property.variables.RootProcessAdvancedData)7 MetaDataAttributes (org.kie.workbench.common.stunner.bpmn.definition.property.diagram.MetaDataAttributes)6 BPMNDiagramImpl (org.kie.workbench.common.stunner.bpmn.definition.BPMNDiagramImpl)5 RectangleDimensionsSet (org.kie.workbench.common.stunner.bpmn.definition.property.dimensions.RectangleDimensionsSet)2 Before (org.junit.Before)1 BPMNDiagram (org.kie.workbench.common.stunner.bpmn.definition.BPMNDiagram)1 EmbeddedSubprocess (org.kie.workbench.common.stunner.bpmn.definition.EmbeddedSubprocess)1 UserTask (org.kie.workbench.common.stunner.bpmn.definition.UserTask)1 Actors (org.kie.workbench.common.stunner.bpmn.definition.property.assignee.Actors)1 Groupid (org.kie.workbench.common.stunner.bpmn.definition.property.assignee.Groupid)1 BackgroundSet (org.kie.workbench.common.stunner.bpmn.definition.property.background.BackgroundSet)1 CaseManagementSet (org.kie.workbench.common.stunner.bpmn.definition.property.cm.CaseManagementSet)1 AssignmentsInfo (org.kie.workbench.common.stunner.bpmn.definition.property.dataio.AssignmentsInfo)1 AdHoc (org.kie.workbench.common.stunner.bpmn.definition.property.diagram.AdHoc)1 DiagramSet (org.kie.workbench.common.stunner.bpmn.definition.property.diagram.DiagramSet)1 Executable (org.kie.workbench.common.stunner.bpmn.definition.property.diagram.Executable)1 Id (org.kie.workbench.common.stunner.bpmn.definition.property.diagram.Id)1 Package (org.kie.workbench.common.stunner.bpmn.definition.property.diagram.Package)1