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());
}
use of org.kie.workbench.common.stunner.core.graph.content.view.ViewImpl in project kie-wb-common by kiegroup.
the class ReusableSubprocessConverterTest method setUp.
@Before
public void setUp() {
when(propertyWriterFactory.of(any(CallActivity.class))).thenReturn(propertyWriter);
DataIOSet ioSet = mock(DataIOSet.class);
when(ioSet.getAssignmentsinfo()).thenReturn(ASSIGNMENTS_INFO);
final ReusableSubprocess definition = new ReusableSubprocess(new BPMNGeneralSet(NAME, DOCUMENTATION), new ReusableSubprocessTaskExecutionSet(new CalledElement(CALLED_ELEMENT), new IsCase(IS_CASE), new Independent(INDEPENDENT), new AbortParent(ABORT_PARENT), new WaitForCompletion(WAIT_FOR_COMPLETION), new IsAsync(IS_ASYNC), new AdHocAutostart(IS_ADHOC_AUTOSTART), new IsMultipleInstance(IS_MULTIPLE_INSTANCE), new MultipleInstanceExecutionMode(SEQUENTIAL), new MultipleInstanceCollectionInput(COLLECTION_INPUT), new MultipleInstanceDataInput(DATA_INPUT), new MultipleInstanceCollectionOutput(COLLECTION_OUTPUT), new MultipleInstanceDataOutput(DATA_OUTPUT), new MultipleInstanceCompletionCondition(COMPLETION_CONDITION), ON_ENTRY_ACTION, ON_EXIT_ACTION, new SLADueDate(SLA_DUE_DATE)), ioSet, new BackgroundSet(), new FontSet(), new RectangleDimensionsSet(), SIMULATION_SET, new AdvancedData());
final View<BaseReusableSubprocess> view = new ViewImpl<>(definition, BOUNDS);
node = new NodeImpl<>(UUID);
node.setContent(view);
converter = new ReusableSubprocessConverter(propertyWriterFactory);
}
Aggregations