use of org.dashbuilder.dataset.DataSet in project jbpm by kiegroup.
the class UserTaskInstanceWithModifVarsQueryMapper method map.
@Override
public List<UserTaskInstanceWithPotOwnerDesc> map(Object result) {
if (result instanceof DataSet) {
DataSet dataSetResult = (DataSet) result;
List<UserTaskInstanceWithPotOwnerDesc> mappedResult = new ArrayList<UserTaskInstanceWithPotOwnerDesc>();
if (dataSetResult != null) {
Map<Long, UserTaskInstanceWithPotOwnerDesc> tmp = new HashMap<Long, UserTaskInstanceWithPotOwnerDesc>();
for (int i = 0; i < dataSetResult.getRowCount(); i++) {
Long taskId = getColumnLongValue(dataSetResult, COLUMN_TASKID, i);
UserTaskInstanceWithPotOwnerDesc ut = tmp.get(taskId);
if (ut == null) {
ut = buildInstance(dataSetResult, i);
mappedResult.add(ut);
tmp.put(taskId, ut);
} else if (!tmp.get(taskId).getPotentialOwners().contains(getColumnStringValue(dataSetResult, COLUMN_POTOWNER, i))) {
((org.jbpm.kie.services.impl.model.UserTaskInstanceWithPotOwnerDesc) ut).addPotOwner(getColumnStringValue(dataSetResult, COLUMN_POTOWNER, i));
}
String varName = getColumnStringValue(dataSetResult, COLUMN_TASK_VAR_NAME, i);
String varValue = getColumnStringValue(dataSetResult, COLUMN_TASK_VAR_VALUE, i);
if (getColumnIntValue(dataSetResult, COLUMN_TASK_VAR_TYPE, i) == 0) {
((org.jbpm.kie.services.impl.model.UserTaskInstanceWithPotOwnerDesc) ut).addInputdata(varName, varValue);
} else {
((org.jbpm.kie.services.impl.model.UserTaskInstanceWithPotOwnerDesc) ut).addOutputdata(varName, varValue);
}
}
}
return mappedResult;
}
throw new IllegalArgumentException("Unsupported result for mapping " + result);
}
use of org.dashbuilder.dataset.DataSet in project kie-wb-common by kiegroup.
the class ContributorsDashboardTest method testAllCommits.
@Test
public void testAllCommits() {
Displayer displayer = presenter.getAllCommitsDisplayer();
DataSet dataSet = displayer.getDataSetHandler().getLastDataSet();
assertDataSetValues(dataSet, new String[][] { { "user1", "repo1", "01/01/19 12:00", "Commit 1" }, { "user2", "repo1", "03/02/19 12:00", "Commit 2" }, { "user3", "repo2", "04/03/19 12:00", "Commit 3" }, { "user4", "repo2", "06/04/19 12:00", "Commit 4" }, { "user5", "repo3", "07/05/19 12:00", "Commit 5" }, { "user6", "repo3", "09/06/19 12:00", "Commit 6" }, { "user7", "repo4", "11/07/19 12:00", "Commit 7" }, { "user8", "repo4", "02/08/20 12:00", "Commit 8" }, { "", "", "", "" } }, 0);
}
use of org.dashbuilder.dataset.DataSet in project kie-wb-common by kiegroup.
the class ContributorsDashboardTest method testSelectAuthorAndWeekOfDay.
@Test
public void testSelectAuthorAndWeekOfDay() throws Exception {
// "user" selected
authorSelectorDisplayer.filterUpdate(COLUMN_AUTHOR, 1);
DataSet dataSet = allCommitsDisplayer.getDataSetHandler().getLastDataSet();
assertEquals(dataSet.getRowCount(), 1);
// "Tuesday" selected
dayOfWeekSelectorDisplayer.filterUpdate(COLUMN_DATE, 2);
dataSet = allCommitsDisplayer.getDataSetHandler().getLastDataSet();
assertEquals(dataSet.getRowCount(), 1);
}
use of org.dashbuilder.dataset.DataSet in project kie-wb-common by kiegroup.
the class ContributorsDashboardTest method testAlwaysShow7Days.
@Test
public void testAlwaysShow7Days() throws Exception {
// "user" selected
authorSelectorDisplayer.filterUpdate(COLUMN_AUTHOR, 1);
DataSet dataSet = allCommitsDisplayer.getDataSetHandler().getLastDataSet();
assertEquals(dataSet.getRowCount(), 1);
// Bar chart must always show 7 bars, one per day of week
dataSet = dayOfWeekSelectorDisplayer.getDataSetHandler().getLastDataSet();
assertEquals(dataSet.getRowCount(), 7);
}
use of org.dashbuilder.dataset.DataSet in project kie-wb-common by kiegroup.
the class ContributorsDashboardTest method testQuarterSelector.
@Test
public void testQuarterSelector() {
Displayer displayer = presenter.getQuarterSelectorDisplayer();
DataSet dataSet = displayer.getDataSetHandler().getLastDataSet();
assertDataSetValues(dataSet, new String[][] { { "1", "3.00" }, { "2", "2.00" }, { "3", "2.00" }, { "4", "1.00" } }, 0);
}
Aggregations