use of org.kie.workbench.common.stunner.core.graph.content.view.ViewImpl in project kie-wb-common by kiegroup.
the class InputDataConverterTest method testDMNFromWB.
@Test
public void testDMNFromWB() {
final InputData wb = new InputData();
final InformationItemPrimary informationItem = new InformationItemPrimary();
wb.getId().setValue(INPUT_DATA_UUID);
wb.getName().setValue(INPUT_DATA_NAME);
wb.getDescription().setValue(INPUT_DATA_DESCRIPTION);
wb.setVariable(informationItem);
final Node<View<InputData>, ?> node = new NodeImpl<>(UUID.uuid());
final View<InputData> view = new ViewImpl<>(wb, Bounds.create());
node.setContent(view);
final org.kie.dmn.model.api.InputData dmn = converter.dmnFromNode(node, componentWidthsConsumer);
assertThat(dmn).isNotNull();
assertThat(dmn.getId()).isNotNull();
assertThat(dmn.getId()).isEqualTo(INPUT_DATA_UUID);
assertThat(dmn.getName()).isNotNull();
assertThat(dmn.getName()).isEqualTo(INPUT_DATA_NAME);
assertThat(dmn.getDescription()).isNotNull();
assertThat(dmn.getDescription()).isEqualTo(INPUT_DATA_DESCRIPTION);
assertThat(dmn.getVariable()).isNotNull();
assertThat(dmn.getVariable().getName()).isEqualTo(INPUT_DATA_NAME);
verifyNoMoreInteractions(componentWidthsConsumer);
}
use of org.kie.workbench.common.stunner.core.graph.content.view.ViewImpl 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());
}
use of org.kie.workbench.common.stunner.core.graph.content.view.ViewImpl 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());
}
use of org.kie.workbench.common.stunner.core.graph.content.view.ViewImpl 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));
}
use of org.kie.workbench.common.stunner.core.graph.content.view.ViewImpl in project kie-wb-common by kiegroup.
the class ReusableSubprocessConverterTest method testToFlowElement_process.
@Test
public void testToFlowElement_process() {
final BaseReusableSubprocess definition = new ReusableSubprocess();
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.isCase.of(propertyWriter.getFlowElement()).get());
}
Aggregations