Search in sources :

Example 11 with PropertyWriter

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

the class ReusableSubprocessConverterTest method testToFlowElement_autostart.

@Test
public void testToFlowElement_autostart() {
    final ReusableSubprocess definition = new ReusableSubprocess();
    definition.getExecutionSet().setAdHocAutostart(new AdHocAutostart(true));
    final View<BaseReusableSubprocess> view = new ViewImpl<>(definition, Bounds.create());
    final Node<View<BaseReusableSubprocess>, ?> node = new NodeImpl<>(java.util.UUID.randomUUID().toString());
    node.setContent(view);
    final PropertyWriter propertyWriter = tested.toFlowElement(node);
    assertTrue(CallActivityPropertyWriter.class.isInstance(propertyWriter));
    assertTrue(CustomElement.autoStart.of(propertyWriter.getFlowElement()).get());
}
Also used : CallActivityPropertyWriter(org.kie.workbench.common.stunner.bpmn.backend.converters.fromstunner.properties.CallActivityPropertyWriter) BaseReusableSubprocess(org.kie.workbench.common.stunner.bpmn.definition.BaseReusableSubprocess) NodeImpl(org.kie.workbench.common.stunner.core.graph.impl.NodeImpl) ReusableSubprocess(org.kie.workbench.common.stunner.bpmn.definition.ReusableSubprocess) BaseReusableSubprocess(org.kie.workbench.common.stunner.bpmn.definition.BaseReusableSubprocess) ViewImpl(org.kie.workbench.common.stunner.core.graph.content.view.ViewImpl) AdHocAutostart(org.kie.workbench.common.stunner.bpmn.definition.property.task.AdHocAutostart) View(org.kie.workbench.common.stunner.core.graph.content.view.View) CallActivityPropertyWriter(org.kie.workbench.common.stunner.bpmn.backend.converters.fromstunner.properties.CallActivityPropertyWriter) PropertyWriter(org.kie.workbench.common.stunner.bpmn.backend.converters.fromstunner.properties.PropertyWriter) Test(org.junit.Test)

Example 12 with PropertyWriter

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

the class ReusableSubprocessConverterTest method testToFlowElementForAbortParent.

private void testToFlowElementForAbortParent(boolean independent, boolean abortParent, boolean expectedAbortParent) {
    final ReusableSubprocess definition = new ReusableSubprocess();
    definition.getExecutionSet().setIndependent(new Independent(independent));
    definition.getExecutionSet().setAbortParent(new AbortParent(abortParent));
    final View<BaseReusableSubprocess> view = new ViewImpl<>(definition, Bounds.create());
    final Node<View<BaseReusableSubprocess>, ?> node = new NodeImpl<>(java.util.UUID.randomUUID().toString());
    node.setContent(view);
    final PropertyWriter propertyWriter = tested.toFlowElement(node);
    assertEquals(expectedAbortParent, CustomElement.abortParent.of(propertyWriter.getFlowElement()).get());
}
Also used : BaseReusableSubprocess(org.kie.workbench.common.stunner.bpmn.definition.BaseReusableSubprocess) Independent(org.kie.workbench.common.stunner.bpmn.definition.property.task.Independent) NodeImpl(org.kie.workbench.common.stunner.core.graph.impl.NodeImpl) ReusableSubprocess(org.kie.workbench.common.stunner.bpmn.definition.ReusableSubprocess) BaseReusableSubprocess(org.kie.workbench.common.stunner.bpmn.definition.BaseReusableSubprocess) AbortParent(org.kie.workbench.common.stunner.bpmn.definition.property.task.AbortParent) ViewImpl(org.kie.workbench.common.stunner.core.graph.content.view.ViewImpl) View(org.kie.workbench.common.stunner.core.graph.content.view.View) CallActivityPropertyWriter(org.kie.workbench.common.stunner.bpmn.backend.converters.fromstunner.properties.CallActivityPropertyWriter) PropertyWriter(org.kie.workbench.common.stunner.bpmn.backend.converters.fromstunner.properties.PropertyWriter)

Example 13 with PropertyWriter

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

the class ReusableSubprocessConverterTest method testToFlowElement_case.

@Test
public void testToFlowElement_case() {
    final BaseReusableSubprocess definition = new ReusableSubprocess();
    definition.getExecutionSet().setIsCase(new IsCase(true));
    final View<BaseReusableSubprocess> view = new ViewImpl<>(definition, Bounds.create());
    final Node<View<BaseReusableSubprocess>, ?> node = new NodeImpl<>(java.util.UUID.randomUUID().toString());
    node.setContent(view);
    final PropertyWriter propertyWriter = tested.toFlowElement(node);
    assertTrue(CallActivityPropertyWriter.class.isInstance(propertyWriter));
    assertTrue(CustomElement.isCase.of(propertyWriter.getFlowElement()).get());
}
Also used : CallActivityPropertyWriter(org.kie.workbench.common.stunner.bpmn.backend.converters.fromstunner.properties.CallActivityPropertyWriter) BaseReusableSubprocess(org.kie.workbench.common.stunner.bpmn.definition.BaseReusableSubprocess) NodeImpl(org.kie.workbench.common.stunner.core.graph.impl.NodeImpl) ReusableSubprocess(org.kie.workbench.common.stunner.bpmn.definition.ReusableSubprocess) BaseReusableSubprocess(org.kie.workbench.common.stunner.bpmn.definition.BaseReusableSubprocess) ViewImpl(org.kie.workbench.common.stunner.core.graph.content.view.ViewImpl) IsCase(org.kie.workbench.common.stunner.bpmn.definition.property.subProcess.IsCase) View(org.kie.workbench.common.stunner.core.graph.content.view.View) CallActivityPropertyWriter(org.kie.workbench.common.stunner.bpmn.backend.converters.fromstunner.properties.CallActivityPropertyWriter) PropertyWriter(org.kie.workbench.common.stunner.bpmn.backend.converters.fromstunner.properties.PropertyWriter) Test(org.junit.Test)

Example 14 with PropertyWriter

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

the class ReusableSubprocessConverterTest method testToFlowElement_notautostart.

@Test
public void testToFlowElement_notautostart() {
    final ReusableSubprocess definition = new ReusableSubprocess();
    definition.getExecutionSet().setAdHocAutostart(new AdHocAutostart(false));
    final View<BaseReusableSubprocess> view = new ViewImpl<>(definition, Bounds.create());
    final Node<View<BaseReusableSubprocess>, ?> node = new NodeImpl<>(java.util.UUID.randomUUID().toString());
    node.setContent(view);
    final PropertyWriter propertyWriter = tested.toFlowElement(node);
    assertTrue(CallActivityPropertyWriter.class.isInstance(propertyWriter));
    assertFalse(CustomElement.autoStart.of(propertyWriter.getFlowElement()).get());
}
Also used : CallActivityPropertyWriter(org.kie.workbench.common.stunner.bpmn.backend.converters.fromstunner.properties.CallActivityPropertyWriter) BaseReusableSubprocess(org.kie.workbench.common.stunner.bpmn.definition.BaseReusableSubprocess) NodeImpl(org.kie.workbench.common.stunner.core.graph.impl.NodeImpl) ReusableSubprocess(org.kie.workbench.common.stunner.bpmn.definition.ReusableSubprocess) BaseReusableSubprocess(org.kie.workbench.common.stunner.bpmn.definition.BaseReusableSubprocess) ViewImpl(org.kie.workbench.common.stunner.core.graph.content.view.ViewImpl) AdHocAutostart(org.kie.workbench.common.stunner.bpmn.definition.property.task.AdHocAutostart) View(org.kie.workbench.common.stunner.core.graph.content.view.View) CallActivityPropertyWriter(org.kie.workbench.common.stunner.bpmn.backend.converters.fromstunner.properties.CallActivityPropertyWriter) PropertyWriter(org.kie.workbench.common.stunner.bpmn.backend.converters.fromstunner.properties.PropertyWriter) Test(org.junit.Test)

Example 15 with PropertyWriter

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

the class ReusableSubprocessConverterTest method testToFlowElement.

@Test
public void testToFlowElement() {
    final ReusableSubprocess definition = new ReusableSubprocess();
    definition.getExecutionSet().setSlaDueDate(new SLADueDate(SLA_DUE_DATE));
    definition.getExecutionSet().setIsAsync(new IsAsync(Boolean.TRUE));
    final View<BaseReusableSubprocess> view = new ViewImpl<>(definition, Bounds.create());
    final Node<View<BaseReusableSubprocess>, ?> node = new NodeImpl<>(java.util.UUID.randomUUID().toString());
    node.setContent(view);
    final PropertyWriter propertyWriter = tested.toFlowElement(node);
    assertTrue(CallActivityPropertyWriter.class.isInstance(propertyWriter));
    assertTrue(CustomElement.async.of(propertyWriter.getFlowElement()).get());
    assertTrue(CallActivityPropertyWriter.class.isInstance(propertyWriter));
    assertTrue(CustomElement.slaDueDate.of(propertyWriter.getFlowElement()).get().contains(SLA_DUE_DATE));
}
Also used : CallActivityPropertyWriter(org.kie.workbench.common.stunner.bpmn.backend.converters.fromstunner.properties.CallActivityPropertyWriter) SLADueDate(org.kie.workbench.common.stunner.bpmn.definition.property.general.SLADueDate) BaseReusableSubprocess(org.kie.workbench.common.stunner.bpmn.definition.BaseReusableSubprocess) NodeImpl(org.kie.workbench.common.stunner.core.graph.impl.NodeImpl) ReusableSubprocess(org.kie.workbench.common.stunner.bpmn.definition.ReusableSubprocess) BaseReusableSubprocess(org.kie.workbench.common.stunner.bpmn.definition.BaseReusableSubprocess) ViewImpl(org.kie.workbench.common.stunner.core.graph.content.view.ViewImpl) IsAsync(org.kie.workbench.common.stunner.bpmn.definition.property.task.IsAsync) View(org.kie.workbench.common.stunner.core.graph.content.view.View) CallActivityPropertyWriter(org.kie.workbench.common.stunner.bpmn.backend.converters.fromstunner.properties.CallActivityPropertyWriter) PropertyWriter(org.kie.workbench.common.stunner.bpmn.backend.converters.fromstunner.properties.PropertyWriter) 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