use of org.kie.workbench.common.stunner.bpmn.definition.BaseReusableSubprocess 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.bpmn.definition.BaseReusableSubprocess 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.bpmn.definition.BaseReusableSubprocess 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);
}
use of org.kie.workbench.common.stunner.bpmn.definition.BaseReusableSubprocess in project kie-wb-common by kiegroup.
the class VariableUtilsTest method mockReusableSubprocess.
private BaseReusableSubprocess mockReusableSubprocess(String name, String assignmentsInfoValue, String inputCollection, String outputCollection) {
ReusableSubprocess result = mock(ReusableSubprocess.class);
BPMNGeneralSet generalSet = mockGeneralSet(name);
when(result.getGeneral()).thenReturn(generalSet);
AssignmentsInfo assignmentsInfo = mockAssignmentsInfo(assignmentsInfoValue);
DataIOSet dataIOSet = mockIOSet(assignmentsInfo);
when(result.getDataIOSet()).thenReturn(dataIOSet);
ReusableSubprocessTaskExecutionSet executionSet = mock(ReusableSubprocessTaskExecutionSet.class);
when(result.getExecutionSet()).thenReturn(executionSet);
IsMultipleInstance isMultipleInstance = mock(IsMultipleInstance.class);
when(isMultipleInstance.getValue()).thenReturn(true);
MultipleInstanceCollectionInput miInputCollection = mock(MultipleInstanceCollectionInput.class);
when(miInputCollection.getValue()).thenReturn(inputCollection);
MultipleInstanceDataInput miDataInput = mock(MultipleInstanceDataInput.class);
MultipleInstanceCollectionOutput miOutputCollection = mock(MultipleInstanceCollectionOutput.class);
MultipleInstanceDataOutput miDataOutput = mock(MultipleInstanceDataOutput.class);
when(miOutputCollection.getValue()).thenReturn(outputCollection);
when(executionSet.getIsMultipleInstance()).thenReturn(isMultipleInstance);
when(executionSet.getMultipleInstanceCollectionInput()).thenReturn(miInputCollection);
when(executionSet.getMultipleInstanceDataInput()).thenReturn(miDataInput);
when(executionSet.getMultipleInstanceCollectionOutput()).thenReturn(miOutputCollection);
when(executionSet.getMultipleInstanceDataOutput()).thenReturn(miDataOutput);
return result;
}
Aggregations