use of org.dashbuilder.dataset.DataSet in project kie-wb-common by kiegroup.
the class ContributorsDashboardTest method test_BZ1255279_fix.
@Test
public void test_BZ1255279_fix() {
when(authorSelectorDisplayer.getView().getSelectedId()).thenReturn("1");
authorSelectorDisplayer.onItemSelected();
DataSet dataSet = allCommitsDisplayer.getDataSetHandler().getLastDataSet();
assertDataSetValues(dataSet, new String[][] { { "user1", "repo1", "01/01/19 12:00", "Commit 1" } }, 0);
}
use of org.dashbuilder.dataset.DataSet in project kie-wb-common by kiegroup.
the class ContributorsDashboardTest method testCommitsPerOrganization.
@Test
public void testCommitsPerOrganization() {
Displayer displayer = presenter.getCommitsPerOrganization();
DataSet dataSet = displayer.getDataSetHandler().getLastDataSet();
assertDataSetValues(dataSet, new String[][] { { "org1", "2.00", "4.00", "org1", "4.00" }, { "org2", "2.00", "4.00", "org2", "4.00" }, { "emptyOrg", "1.00", "1.00", "emptyOrg", "1.00" } }, 0);
}
use of org.dashbuilder.dataset.DataSet in project jbpm by kiegroup.
the class ProcessInstanceWithCustomVarsQueryMapper method map.
@Override
public List<ProcessInstanceWithVarsDesc> map(Object result) {
if (result instanceof DataSet) {
DataSet dataSetResult = (DataSet) result;
List<ProcessInstanceWithVarsDesc> mappedResult = new ArrayList<ProcessInstanceWithVarsDesc>();
Map<Long, ProcessInstanceWithVarsDesc> tmp = new HashMap<Long, ProcessInstanceWithVarsDesc>();
if (dataSetResult != null) {
for (int i = 0; i < dataSetResult.getRowCount(); i++) {
Long processInstanceId = getColumnLongValue(dataSetResult, COLUMN_PROCESSINSTANCEID, i);
ProcessInstanceWithVarsDesc pi = tmp.get(processInstanceId);
if (pi == null) {
pi = buildInstance(dataSetResult, i);
mappedResult.add(pi);
tmp.put(processInstanceId, pi);
}
Map<String, Object> variables = readVariables(variablesMap, dataSetResult, i);
((org.jbpm.kie.services.impl.model.ProcessInstanceWithVarsDesc) pi).setVariables(variables);
}
}
tmp = null;
return mappedResult;
}
throw new IllegalArgumentException("Unsupported result for mapping " + result);
}
use of org.dashbuilder.dataset.DataSet in project jbpm by kiegroup.
the class ProcessInstanceWithVarsQueryMapper method map.
@Override
public List<ProcessInstanceWithVarsDesc> map(Object result) {
if (result instanceof DataSet) {
DataSet dataSetResult = (DataSet) result;
List<ProcessInstanceWithVarsDesc> mappedResult = new ArrayList<ProcessInstanceWithVarsDesc>();
Map<Long, ProcessInstanceWithVarsDesc> tmp = new HashMap<Long, ProcessInstanceWithVarsDesc>();
if (dataSetResult != null) {
for (int i = 0; i < dataSetResult.getRowCount(); i++) {
Long processInstanceId = getColumnLongValue(dataSetResult, COLUMN_PROCESSINSTANCEID, i);
ProcessInstanceWithVarsDesc pi = tmp.get(processInstanceId);
if (pi == null) {
pi = buildInstance(dataSetResult, i);
mappedResult.add(pi);
tmp.put(processInstanceId, pi);
}
// now add variable
String varName = getColumnStringValue(dataSetResult, COLUMN_VAR_NAME, i);
String varValue = getColumnStringValue(dataSetResult, COLUMN_VAR_VALUE, i);
((org.jbpm.kie.services.impl.model.ProcessInstanceWithVarsDesc) pi).addVariable(varName, varValue);
}
}
tmp = null;
return mappedResult;
}
throw new IllegalArgumentException("Unsupported result for mapping " + result);
}
use of org.dashbuilder.dataset.DataSet in project jbpm by kiegroup.
the class UserTaskInstanceQueryMapper method map.
@Override
public List<UserTaskInstanceDesc> map(Object result) {
if (result instanceof DataSet) {
DataSet dataSetResult = (DataSet) result;
List<UserTaskInstanceDesc> mappedResult = new ArrayList<UserTaskInstanceDesc>();
if (dataSetResult != null) {
for (int i = 0; i < dataSetResult.getRowCount(); i++) {
UserTaskInstanceDesc ut = buildInstance(dataSetResult, i);
mappedResult.add(ut);
}
}
return mappedResult;
}
throw new IllegalArgumentException("Unsupported result for mapping " + result);
}
Aggregations