Search in sources :

Example 1 with MetaDataAttributes

use of org.kie.workbench.common.stunner.bpmn.definition.property.diagram.MetaDataAttributes 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 MetaDataAttributes

use of org.kie.workbench.common.stunner.bpmn.definition.property.diagram.MetaDataAttributes 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 MetaDataAttributes

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

the class BPMNDiagramTest method testSetMetaDataAttributes.

@Test
public void testSetMetaDataAttributes() {
    AdvancedData advancedData = new AdvancedData();
    assertEquals(advancedData.getMetaDataAttributes(), new MetaDataAttributes());
    advancedData.setMetaDataAttributes(new MetaDataAttributes(METADATA));
    assertEquals(advancedData.getMetaDataAttributes(), new MetaDataAttributes(METADATA));
}
Also used : MetaDataAttributes(org.kie.workbench.common.stunner.bpmn.definition.property.diagram.MetaDataAttributes) AdvancedData(org.kie.workbench.common.stunner.bpmn.definition.property.variables.AdvancedData) RootProcessAdvancedData(org.kie.workbench.common.stunner.bpmn.definition.property.variables.RootProcessAdvancedData) Test(org.junit.Test)

Example 4 with MetaDataAttributes

use of org.kie.workbench.common.stunner.bpmn.definition.property.diagram.MetaDataAttributes 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 5 with MetaDataAttributes

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

the class TaskConverterPriorityTest method setPriorityMvel.

@Test
public void setPriorityMvel() {
    propertyWriterFactory = new PropertyWriterFactory();
    taskConverter = spy(new TaskConverter(propertyWriterFactory));
    when(n.getContent()).thenReturn(view);
    when(view.getBounds()).thenReturn(Bounds.create(0, 0, 10, 10));
    when(view.getDefinition()).thenReturn(definition);
    when(general.getName()).thenReturn(new Name("Name"));
    when(general.getDocumentation()).thenReturn(new Documentation());
    when(definition.getGeneral()).thenReturn(general);
    when(definition.getSimulationSet()).thenReturn(new SimulationSet());
    when(definition.getExecutionSet()).thenReturn(baseUserTaskExecutionSet);
    when(baseUserTaskExecutionSet.getTaskName()).thenReturn(new TaskName("taskName"));
    when(baseUserTaskExecutionSet.getActors()).thenReturn(new Actors());
    when(baseUserTaskExecutionSet.getAssignmentsinfo()).thenReturn(new AssignmentsInfo());
    when(baseUserTaskExecutionSet.getReassignmentsInfo()).thenReturn(new ReassignmentsInfo());
    when(baseUserTaskExecutionSet.getNotificationsInfo()).thenReturn(new NotificationsInfo());
    when(baseUserTaskExecutionSet.getSkippable()).thenReturn(new Skippable(true));
    when(baseUserTaskExecutionSet.getGroupid()).thenReturn(new Groupid("groupId"));
    when(baseUserTaskExecutionSet.getSubject()).thenReturn(new Subject());
    when(baseUserTaskExecutionSet.getDescription()).thenReturn(new Description());
    when(baseUserTaskExecutionSet.getPriority()).thenReturn(new TaskPriority("#{varOne}"));
    when(baseUserTaskExecutionSet.getIsAsync()).thenReturn(new IsAsync(true));
    when(baseUserTaskExecutionSet.getCreatedBy()).thenReturn(new CreatedBy());
    when(baseUserTaskExecutionSet.getAdHocAutostart()).thenReturn(new AdHocAutostart());
    when(baseUserTaskExecutionSet.getIsMultipleInstance()).thenReturn(new IsMultipleInstance(false));
    when(baseUserTaskExecutionSet.getOnEntryAction()).thenReturn(new OnEntryAction(new ScriptTypeListValue().addValue(new ScriptTypeValue("java", ""))));
    when(baseUserTaskExecutionSet.getOnExitAction()).thenReturn(new OnExitAction(new ScriptTypeListValue().addValue(new ScriptTypeValue("java", ""))));
    when(baseUserTaskExecutionSet.getContent()).thenReturn(new Content());
    when(baseUserTaskExecutionSet.getSlaDueDate()).thenReturn(new SLADueDate());
    when(definition.getAdvancedData()).thenReturn(new AdvancedData(new MetaDataAttributes()));
    doCallRealMethod().when(taskConverter).userTask(any());
    final UserTaskPropertyWriter propertyWriter = (UserTaskPropertyWriter) taskConverter.userTask(n);
    assertTrue(propertyWriter.getPriority().equals("<![CDATA[#{varOne}]]>"));
    System.out.println("Priority: " + propertyWriter.getPriority());
}
Also used : Description(org.kie.workbench.common.stunner.bpmn.definition.property.task.Description) TaskPriority(org.kie.workbench.common.stunner.bpmn.definition.property.task.TaskPriority) AssignmentsInfo(org.kie.workbench.common.stunner.bpmn.definition.property.dataio.AssignmentsInfo) AdHocAutostart(org.kie.workbench.common.stunner.bpmn.definition.property.task.AdHocAutostart) PropertyWriterFactory(org.kie.workbench.common.stunner.bpmn.backend.converters.fromstunner.properties.PropertyWriterFactory) NotificationsInfo(org.kie.workbench.common.stunner.bpmn.definition.property.notification.NotificationsInfo) Name(org.kie.workbench.common.stunner.bpmn.definition.property.general.Name) TaskName(org.kie.workbench.common.stunner.bpmn.definition.property.task.TaskName) Groupid(org.kie.workbench.common.stunner.bpmn.definition.property.assignee.Groupid) SLADueDate(org.kie.workbench.common.stunner.bpmn.definition.property.general.SLADueDate) UserTaskPropertyWriter(org.kie.workbench.common.stunner.bpmn.backend.converters.fromstunner.properties.UserTaskPropertyWriter) CreatedBy(org.kie.workbench.common.stunner.bpmn.definition.property.task.CreatedBy) Documentation(org.kie.workbench.common.stunner.bpmn.definition.property.general.Documentation) Actors(org.kie.workbench.common.stunner.bpmn.definition.property.assignee.Actors) OnExitAction(org.kie.workbench.common.stunner.bpmn.definition.property.task.OnExitAction) OnEntryAction(org.kie.workbench.common.stunner.bpmn.definition.property.task.OnEntryAction) Subject(org.kie.workbench.common.stunner.bpmn.definition.property.task.Subject) MetaDataAttributes(org.kie.workbench.common.stunner.bpmn.definition.property.diagram.MetaDataAttributes) AdvancedData(org.kie.workbench.common.stunner.bpmn.definition.property.variables.AdvancedData) SimulationSet(org.kie.workbench.common.stunner.bpmn.definition.property.simulation.SimulationSet) TaskName(org.kie.workbench.common.stunner.bpmn.definition.property.task.TaskName) Content(org.kie.workbench.common.stunner.bpmn.definition.property.task.Content) ReassignmentsInfo(org.kie.workbench.common.stunner.bpmn.definition.property.reassignment.ReassignmentsInfo) IsMultipleInstance(org.kie.workbench.common.stunner.bpmn.definition.property.task.IsMultipleInstance) Skippable(org.kie.workbench.common.stunner.bpmn.definition.property.task.Skippable) IsAsync(org.kie.workbench.common.stunner.bpmn.definition.property.task.IsAsync) ScriptTypeListValue(org.kie.workbench.common.stunner.bpmn.definition.property.task.ScriptTypeListValue) ScriptTypeValue(org.kie.workbench.common.stunner.bpmn.definition.property.task.ScriptTypeValue) Test(org.junit.Test)

Aggregations

MetaDataAttributes (org.kie.workbench.common.stunner.bpmn.definition.property.diagram.MetaDataAttributes)12 Test (org.junit.Test)11 RootProcessAdvancedData (org.kie.workbench.common.stunner.bpmn.definition.property.variables.RootProcessAdvancedData)7 GlobalVariables (org.kie.workbench.common.stunner.bpmn.definition.property.diagram.GlobalVariables)6 BPMNDiagramImpl (org.kie.workbench.common.stunner.bpmn.definition.BPMNDiagramImpl)4 AdvancedData (org.kie.workbench.common.stunner.bpmn.definition.property.variables.AdvancedData)4 Actors (org.kie.workbench.common.stunner.bpmn.definition.property.assignee.Actors)3 Groupid (org.kie.workbench.common.stunner.bpmn.definition.property.assignee.Groupid)3 AssignmentsInfo (org.kie.workbench.common.stunner.bpmn.definition.property.dataio.AssignmentsInfo)3 Documentation (org.kie.workbench.common.stunner.bpmn.definition.property.general.Documentation)3 Name (org.kie.workbench.common.stunner.bpmn.definition.property.general.Name)3 SLADueDate (org.kie.workbench.common.stunner.bpmn.definition.property.general.SLADueDate)3 NotificationsInfo (org.kie.workbench.common.stunner.bpmn.definition.property.notification.NotificationsInfo)3 ReassignmentsInfo (org.kie.workbench.common.stunner.bpmn.definition.property.reassignment.ReassignmentsInfo)3 SimulationSet (org.kie.workbench.common.stunner.bpmn.definition.property.simulation.SimulationSet)3 AdHocAutostart (org.kie.workbench.common.stunner.bpmn.definition.property.task.AdHocAutostart)3 Content (org.kie.workbench.common.stunner.bpmn.definition.property.task.Content)3 CreatedBy (org.kie.workbench.common.stunner.bpmn.definition.property.task.CreatedBy)3 Description (org.kie.workbench.common.stunner.bpmn.definition.property.task.Description)3 IsAsync (org.kie.workbench.common.stunner.bpmn.definition.property.task.IsAsync)3