Search in sources :

Example 6 with PropertyWriter

use of org.kie.workbench.common.stunner.bpmn.backend.converters.fromstunner.properties.PropertyWriter in project kie-wb-common by kiegroup.

the class IntermediateThrowEventConverterTest method compensationEvent.

@Test
public void compensationEvent() {
    Node node = createIntermediateCompensationEventThrowingNode();
    PropertyWriter propertyWriter = tested.compensationEvent(node);
    assertNotNull(propertyWriter);
    verifyCommonProperties(node);
    verify(throwEventPropertyWriter).addCompensation();
}
Also used : Node(org.kie.workbench.common.stunner.core.graph.Node) PropertyWriter(org.kie.workbench.common.stunner.bpmn.backend.converters.fromstunner.properties.PropertyWriter) ThrowEventPropertyWriter(org.kie.workbench.common.stunner.bpmn.backend.converters.fromstunner.properties.ThrowEventPropertyWriter) Test(org.junit.Test)

Example 7 with PropertyWriter

use of org.kie.workbench.common.stunner.bpmn.backend.converters.fromstunner.properties.PropertyWriter in project kie-wb-common by kiegroup.

the class IntermediateThrowEventConverterTest method linkEvent.

@Test
public void linkEvent() {
    Node node = createIntermediateLinkEventThrowingNode();
    PropertyWriter propertyWriter = tested.linkEvent(node);
    assertNotNull(propertyWriter);
    verifyCommonProperties(node);
    verify(throwEventPropertyWriter).addLink(linkRef);
}
Also used : Node(org.kie.workbench.common.stunner.core.graph.Node) PropertyWriter(org.kie.workbench.common.stunner.bpmn.backend.converters.fromstunner.properties.PropertyWriter) ThrowEventPropertyWriter(org.kie.workbench.common.stunner.bpmn.backend.converters.fromstunner.properties.ThrowEventPropertyWriter) Test(org.junit.Test)

Example 8 with PropertyWriter

use of org.kie.workbench.common.stunner.bpmn.backend.converters.fromstunner.properties.PropertyWriter in project kie-wb-common by kiegroup.

the class IntermediateThrowEventConverterTest method escalationEvent.

@Test
public void escalationEvent() {
    Node node = createIntermediateEscalationEventThrowingNode();
    PropertyWriter propertyWriter = tested.escalationEvent(node);
    assertNotNull(propertyWriter);
    verifyCommonProperties(node);
    verify(throwEventPropertyWriter).addEscalation(escalationRef);
}
Also used : Node(org.kie.workbench.common.stunner.core.graph.Node) PropertyWriter(org.kie.workbench.common.stunner.bpmn.backend.converters.fromstunner.properties.PropertyWriter) ThrowEventPropertyWriter(org.kie.workbench.common.stunner.bpmn.backend.converters.fromstunner.properties.ThrowEventPropertyWriter) Test(org.junit.Test)

Example 9 with PropertyWriter

use of org.kie.workbench.common.stunner.bpmn.backend.converters.fromstunner.properties.PropertyWriter in project kie-wb-common by kiegroup.

the class ArtifactsConverterTest method toTextAnnotationElement.

@Test
public void toTextAnnotationElement() {
    TextAnnotation textAnnotation = new TextAnnotation();
    textAnnotation.getGeneral().getDocumentation().setValue(DOC);
    textAnnotation.getGeneral().getName().setValue(NAME);
    textAnnotationNode = new NodeImpl<>(UUID.uuid());
    textAnnotationNode.setContent(textAnnotationView);
    when(textAnnotationView.getDefinition()).thenReturn(textAnnotation);
    when(propertyWriterFactory.of(any(org.eclipse.bpmn2.TextAnnotation.class))).thenReturn(textAnnotationWriter);
    artifactsConverter = new ArtifactsConverter(propertyWriterFactory);
    PropertyWriter propertyWriter = artifactsConverter.toElement(((NodeImpl) textAnnotationNode));
    verify(textAnnotationWriter).setName(NAME);
    verify(textAnnotationWriter).setDocumentation(DOC);
    verify(textAnnotationWriter).setAbsoluteBounds(textAnnotationNode);
    assertEquals(textAnnotationWriter, propertyWriter);
}
Also used : NodeImpl(org.kie.workbench.common.stunner.core.graph.impl.NodeImpl) TextAnnotation(org.kie.workbench.common.stunner.bpmn.definition.TextAnnotation) 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 10 with PropertyWriter

use of org.kie.workbench.common.stunner.bpmn.backend.converters.fromstunner.properties.PropertyWriter 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)

Aggregations

PropertyWriter (org.kie.workbench.common.stunner.bpmn.backend.converters.fromstunner.properties.PropertyWriter)21 Test (org.junit.Test)20 Node (org.kie.workbench.common.stunner.core.graph.Node)13 BoundaryEventPropertyWriter (org.kie.workbench.common.stunner.bpmn.backend.converters.fromstunner.properties.BoundaryEventPropertyWriter)8 CatchEventPropertyWriter (org.kie.workbench.common.stunner.bpmn.backend.converters.fromstunner.properties.CatchEventPropertyWriter)8 NodeImpl (org.kie.workbench.common.stunner.core.graph.impl.NodeImpl)8 CallActivityPropertyWriter (org.kie.workbench.common.stunner.bpmn.backend.converters.fromstunner.properties.CallActivityPropertyWriter)6 BaseReusableSubprocess (org.kie.workbench.common.stunner.bpmn.definition.BaseReusableSubprocess)6 ReusableSubprocess (org.kie.workbench.common.stunner.bpmn.definition.ReusableSubprocess)6 View (org.kie.workbench.common.stunner.core.graph.content.view.View)6 ViewImpl (org.kie.workbench.common.stunner.core.graph.content.view.ViewImpl)6 ThrowEventPropertyWriter (org.kie.workbench.common.stunner.bpmn.backend.converters.fromstunner.properties.ThrowEventPropertyWriter)5 DataObjectPropertyWriter (org.kie.workbench.common.stunner.bpmn.backend.converters.fromstunner.properties.DataObjectPropertyWriter)2 TextAnnotationPropertyWriter (org.kie.workbench.common.stunner.bpmn.backend.converters.fromstunner.properties.TextAnnotationPropertyWriter)2 AdHocAutostart (org.kie.workbench.common.stunner.bpmn.definition.property.task.AdHocAutostart)2 DataObject (org.kie.workbench.common.stunner.bpmn.definition.DataObject)1 TextAnnotation (org.kie.workbench.common.stunner.bpmn.definition.TextAnnotation)1 DataObjectType (org.kie.workbench.common.stunner.bpmn.definition.property.artifacts.DataObjectType)1 DataObjectTypeValue (org.kie.workbench.common.stunner.bpmn.definition.property.artifacts.DataObjectTypeValue)1 Name (org.kie.workbench.common.stunner.bpmn.definition.property.general.Name)1