use of org.kie.workbench.common.stunner.bpmn.definition.property.task.IsMultipleInstance in project kie-wb-common by kiegroup.
the class GenericServiceTaskExecutionSetTest method testEqualTrue.
@Test
public void testEqualTrue() {
GenericServiceTaskExecutionSet a = new GenericServiceTaskExecutionSet();
GenericServiceTaskExecutionSet b = new GenericServiceTaskExecutionSet();
a.setGenericServiceTaskInfo(new GenericServiceTaskInfo());
assertEquals(a, b);
GenericServiceTaskExecutionSet c = new GenericServiceTaskExecutionSet(new GenericServiceTaskInfo(), new AssignmentsInfo(), new AdHocAutostart(), new IsAsync(), new IsMultipleInstance(false), new MultipleInstanceExecutionMode(false), new MultipleInstanceCollectionInput(), new MultipleInstanceDataInput(), new MultipleInstanceCollectionOutput(), new MultipleInstanceDataOutput(), new MultipleInstanceCompletionCondition(), new OnEntryAction(new ScriptTypeListValue().addValue(new ScriptTypeValue("java", ""))), new OnExitAction(new ScriptTypeListValue().addValue(new ScriptTypeValue("java", ""))), new SLADueDate(SLA_DUE_DATE_1));
GenericServiceTaskExecutionSet d = new GenericServiceTaskExecutionSet(new GenericServiceTaskInfo(), new AssignmentsInfo(), new AdHocAutostart(), new IsAsync(), new IsMultipleInstance(false), new MultipleInstanceExecutionMode(false), new MultipleInstanceCollectionInput(), new MultipleInstanceDataInput(), new MultipleInstanceCollectionOutput(), new MultipleInstanceDataOutput(), new MultipleInstanceCompletionCondition(), new OnEntryAction(new ScriptTypeListValue().addValue(new ScriptTypeValue("java", ""))), new OnExitAction(new ScriptTypeListValue().addValue(new ScriptTypeValue("java", ""))), new SLADueDate(SLA_DUE_DATE_1));
assertEquals(c, d);
}
use of org.kie.workbench.common.stunner.bpmn.definition.property.task.IsMultipleInstance in project kie-wb-common by kiegroup.
the class TaskViewHandlerTest method prepareTest.
private void prepareTest(boolean multipleInstance, boolean sequential) {
UserTask userTask = mock(UserTask.class);
UserTaskExecutionSet executionSet = mock(UserTaskExecutionSet.class);
IsMultipleInstance isMultipleInstance = new IsMultipleInstance(multipleInstance);
MultipleInstanceExecutionMode executionMode = new MultipleInstanceExecutionMode(sequential);
when(executionSet.getIsMultipleInstance()).thenReturn(isMultipleInstance);
when(executionSet.getMultipleInstanceExecutionMode()).thenReturn(executionMode);
when(userTask.getExecutionSet()).thenReturn(executionSet);
viewHandler.handle(userTask, svgShapeView);
}
use of org.kie.workbench.common.stunner.bpmn.definition.property.task.IsMultipleInstance in project kie-wb-common by kiegroup.
the class VariableUtilsTest method mockUserTask.
private BaseUserTask mockUserTask(String name, String assignmentsInfoValue, String inputCollection, String outputCollection) {
UserTask result = mock(UserTask.class);
TaskGeneralSet generalSet = mockTaskGeneralSet(name);
when(result.getGeneral()).thenReturn(generalSet);
UserTaskExecutionSet executionSet = mock(UserTaskExecutionSet.class);
when(result.getExecutionSet()).thenReturn(executionSet);
AssignmentsInfo assignmentsInfo = mockAssignmentsInfo(assignmentsInfoValue);
when(executionSet.getAssignmentsinfo()).thenReturn(assignmentsInfo);
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;
}
use of org.kie.workbench.common.stunner.bpmn.definition.property.task.IsMultipleInstance in project kie-wb-common by kiegroup.
the class TaskConverterPriorityTest method setPriorityMvel.
@Test
public void setPriorityMvel() {
propertyWriterFactory = new PropertyWriterFactory();
taskConverter = spy(new TaskConverter(propertyWriterFactory));
when(n.getContent()).thenReturn(view);
when(view.getBounds()).thenReturn(Bounds.create(0, 0, 10, 10));
when(view.getDefinition()).thenReturn(definition);
when(general.getName()).thenReturn(new Name("Name"));
when(general.getDocumentation()).thenReturn(new Documentation());
when(definition.getGeneral()).thenReturn(general);
when(definition.getSimulationSet()).thenReturn(new SimulationSet());
when(definition.getExecutionSet()).thenReturn(baseUserTaskExecutionSet);
when(baseUserTaskExecutionSet.getTaskName()).thenReturn(new TaskName("taskName"));
when(baseUserTaskExecutionSet.getActors()).thenReturn(new Actors());
when(baseUserTaskExecutionSet.getAssignmentsinfo()).thenReturn(new AssignmentsInfo());
when(baseUserTaskExecutionSet.getReassignmentsInfo()).thenReturn(new ReassignmentsInfo());
when(baseUserTaskExecutionSet.getNotificationsInfo()).thenReturn(new NotificationsInfo());
when(baseUserTaskExecutionSet.getSkippable()).thenReturn(new Skippable(true));
when(baseUserTaskExecutionSet.getGroupid()).thenReturn(new Groupid("groupId"));
when(baseUserTaskExecutionSet.getSubject()).thenReturn(new Subject());
when(baseUserTaskExecutionSet.getDescription()).thenReturn(new Description());
when(baseUserTaskExecutionSet.getPriority()).thenReturn(new TaskPriority("#{varOne}"));
when(baseUserTaskExecutionSet.getIsAsync()).thenReturn(new IsAsync(true));
when(baseUserTaskExecutionSet.getCreatedBy()).thenReturn(new CreatedBy());
when(baseUserTaskExecutionSet.getAdHocAutostart()).thenReturn(new AdHocAutostart());
when(baseUserTaskExecutionSet.getIsMultipleInstance()).thenReturn(new IsMultipleInstance(false));
when(baseUserTaskExecutionSet.getOnEntryAction()).thenReturn(new OnEntryAction(new ScriptTypeListValue().addValue(new ScriptTypeValue("java", ""))));
when(baseUserTaskExecutionSet.getOnExitAction()).thenReturn(new OnExitAction(new ScriptTypeListValue().addValue(new ScriptTypeValue("java", ""))));
when(baseUserTaskExecutionSet.getContent()).thenReturn(new Content());
when(baseUserTaskExecutionSet.getSlaDueDate()).thenReturn(new SLADueDate());
when(definition.getAdvancedData()).thenReturn(new AdvancedData(new MetaDataAttributes()));
doCallRealMethod().when(taskConverter).userTask(any());
final UserTaskPropertyWriter propertyWriter = (UserTaskPropertyWriter) taskConverter.userTask(n);
assertTrue(propertyWriter.getPriority().equals("<![CDATA[#{varOne}]]>"));
System.out.println("Priority: " + propertyWriter.getPriority());
}
use of org.kie.workbench.common.stunner.bpmn.definition.property.task.IsMultipleInstance 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