Search in sources :

Example 1 with DataObjectTypeValue

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

the class DataObjectTest method setType.

@Test
public void setType() {
    DataObjectType type = new DataObjectType(new DataObjectTypeValue(this.getClass().getSimpleName()));
    dataObject.setType(type);
    assertEquals(type, dataObject.getType());
}
Also used : DataObjectTypeValue(org.kie.workbench.common.stunner.bpmn.definition.property.artifacts.DataObjectTypeValue) DataObjectType(org.kie.workbench.common.stunner.bpmn.definition.property.artifacts.DataObjectType) Test(org.junit.Test)

Example 2 with DataObjectTypeValue

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

the class DataObjectTypeWidget method notifyModelChanged.

@Override
public void notifyModelChanged() {
    String currentValue = dataType.getValue();
    if (currentValue != null && !currentValue.equals(oldValue)) {
        setValue(new DataObjectTypeValue(currentValue), true);
    }
    oldValue = currentValue;
}
Also used : DataObjectTypeValue(org.kie.workbench.common.stunner.bpmn.definition.property.artifacts.DataObjectTypeValue)

Example 3 with DataObjectTypeValue

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

the class ArtifactsConverterTest method toDataObjectElement.

@Test
public void toDataObjectElement() {
    DataObject dataObject = new DataObject();
    dataObject.getGeneral().getDocumentation().setValue(DOC);
    dataObject.setName(new Name(NAME));
    dataObject.setType(new DataObjectType(new DataObjectTypeValue(NAME)));
    dataObjectNode = new NodeImpl<>(UUID.uuid());
    dataObjectNode.setContent(dataObjectView);
    when(dataObjectView.getDefinition()).thenReturn(dataObject);
    when(propertyWriterFactory.of(any(org.eclipse.bpmn2.DataObjectReference.class))).thenReturn(dataObjectWriter);
    artifactsConverter = new ArtifactsConverter(propertyWriterFactory);
    PropertyWriter propertyWriter = artifactsConverter.toElement(((NodeImpl) dataObjectNode));
    verify(dataObjectWriter).setName(NAME);
    verify(dataObjectWriter).setType(NAME);
    verify(dataObjectWriter).setAbsoluteBounds(dataObjectNode);
    assertEquals(dataObjectWriter, propertyWriter);
}
Also used : DataObject(org.kie.workbench.common.stunner.bpmn.definition.DataObject) NodeImpl(org.kie.workbench.common.stunner.core.graph.impl.NodeImpl) DataObjectTypeValue(org.kie.workbench.common.stunner.bpmn.definition.property.artifacts.DataObjectTypeValue) DataObjectType(org.kie.workbench.common.stunner.bpmn.definition.property.artifacts.DataObjectType) Name(org.kie.workbench.common.stunner.bpmn.definition.property.general.Name) TextAnnotationPropertyWriter(org.kie.workbench.common.stunner.bpmn.backend.converters.fromstunner.properties.TextAnnotationPropertyWriter) PropertyWriter(org.kie.workbench.common.stunner.bpmn.backend.converters.fromstunner.properties.PropertyWriter) DataObjectPropertyWriter(org.kie.workbench.common.stunner.bpmn.backend.converters.fromstunner.properties.DataObjectPropertyWriter) Test(org.junit.Test)

Example 4 with DataObjectTypeValue

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

the class AssignmentsEditorWidgetProcessVariablesTest method testGetProcessVariableFromDataObjects.

@Test
public void testGetProcessVariableFromDataObjects() {
    DataObject dataObject = new DataObject();
    dataObject.getGeneral().getDocumentation().setValue("doc");
    dataObject.setName(new Name("name"));
    dataObject.setType(new DataObjectType(new DataObjectTypeValue("com.myType.dataObject")));
    final String uuid = UUID.uuid();
    when(dataObjectNode.getUUID()).thenReturn("uuid");
    when(dataObjectNode.getContent()).thenReturn(dataObjectView);
    when(dataObjectView.getDefinition()).thenReturn(dataObject);
    graphNodes.clear();
    graphNodes.add(dataObjectNode);
    graphNodes.add(parentNode);
    when(parentNodeView.getDefinition()).thenReturn(dataObjectNode);
    when(dataObjectNode.getUUID()).thenReturn("rootId");
    createWidget();
    assertEquals(dataObject.getName().getValue() + ":" + dataObject.getType().getValue().getType(), widget.getProcessVariables());
}
Also used : DataObject(org.kie.workbench.common.stunner.bpmn.definition.DataObject) DataObjectTypeValue(org.kie.workbench.common.stunner.bpmn.definition.property.artifacts.DataObjectTypeValue) DataObjectType(org.kie.workbench.common.stunner.bpmn.definition.property.artifacts.DataObjectType) Name(org.kie.workbench.common.stunner.bpmn.definition.property.general.Name) Test(org.junit.Test)

Example 5 with DataObjectTypeValue

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

the class DataObjectTypeWidgetTest method testSetTextBoxModelValueCustomDataType.

@Test
public void testSetTextBoxModelValueCustomDataType() {
    final DataObjectTypeValue myValue = new DataObjectTypeValue("com.custom.myClass");
    DataObjectTypeWidget.doneLoading = true;
    widget.setValue(myValue);
    verify(dataType, times(1)).setValue("com.custom.myClass");
}
Also used : DataObjectTypeValue(org.kie.workbench.common.stunner.bpmn.definition.property.artifacts.DataObjectTypeValue) Test(org.junit.Test)

Aggregations

DataObjectTypeValue (org.kie.workbench.common.stunner.bpmn.definition.property.artifacts.DataObjectTypeValue)11 DataObjectType (org.kie.workbench.common.stunner.bpmn.definition.property.artifacts.DataObjectType)8 Test (org.junit.Test)7 Name (org.kie.workbench.common.stunner.bpmn.definition.property.general.Name)7 DataObject (org.kie.workbench.common.stunner.bpmn.definition.DataObject)6 View (org.kie.workbench.common.stunner.core.graph.content.view.View)4 Element (org.kie.workbench.common.stunner.core.graph.Element)3 NodeImpl (org.kie.workbench.common.stunner.core.graph.impl.NodeImpl)3 ArrayList (java.util.ArrayList)1 DataObjectPropertyWriter (org.kie.workbench.common.stunner.bpmn.backend.converters.fromstunner.properties.DataObjectPropertyWriter)1 PropertyWriter (org.kie.workbench.common.stunner.bpmn.backend.converters.fromstunner.properties.PropertyWriter)1 TextAnnotationPropertyWriter (org.kie.workbench.common.stunner.bpmn.backend.converters.fromstunner.properties.TextAnnotationPropertyWriter)1 DataObjectPropertyReader (org.kie.workbench.common.stunner.bpmn.backend.converters.tostunner.properties.DataObjectPropertyReader)1 BackgroundSet (org.kie.workbench.common.stunner.bpmn.definition.property.background.BackgroundSet)1 BgColor (org.kie.workbench.common.stunner.bpmn.definition.property.background.BgColor)1 RectangleDimensionsSet (org.kie.workbench.common.stunner.bpmn.definition.property.dimensions.RectangleDimensionsSet)1 FontSet (org.kie.workbench.common.stunner.bpmn.definition.property.font.FontSet)1 FontSize (org.kie.workbench.common.stunner.bpmn.definition.property.font.FontSize)1 BPMNGeneralSet (org.kie.workbench.common.stunner.bpmn.definition.property.general.BPMNGeneralSet)1 AdvancedData (org.kie.workbench.common.stunner.bpmn.definition.property.variables.AdvancedData)1