Search in sources :

Example 1 with TaskCategory

use of com.centurylink.mdw.model.data.task.TaskCategory in project mdw-designer by CenturyLinkCloud.

the class WorkflowAccessRest method getTaskCategories.

public List<TaskCategory> getTaskCategories() throws DataAccessException {
    try {
        String taskCategoriesJson = getServer().invokeResourceService("BaseData/TaskCategories?format=json");
        JSONArray jsonArray = new JSONArray(taskCategoriesJson);
        List<TaskCategory> taskCategories = new ArrayList<TaskCategory>();
        for (int i = 0; i < jsonArray.length(); i++) taskCategories.add(new TaskCategory(jsonArray.getJSONObject(i)));
        return taskCategories;
    } catch (Exception ex) {
        throw new DataAccessException("Error retrieving task categories", ex);
    }
}
Also used : TaskCategory(com.centurylink.mdw.model.data.task.TaskCategory) JSONArray(org.json.JSONArray) ArrayList(java.util.ArrayList) DataAccessException(com.centurylink.mdw.common.exception.DataAccessException) IOException(java.io.IOException) JSONException(org.json.JSONException) DataAccessOfflineException(com.centurylink.mdw.dataaccess.DataAccessOfflineException) DataAccessException(com.centurylink.mdw.common.exception.DataAccessException)

Aggregations

DataAccessException (com.centurylink.mdw.common.exception.DataAccessException)1 DataAccessOfflineException (com.centurylink.mdw.dataaccess.DataAccessOfflineException)1 TaskCategory (com.centurylink.mdw.model.data.task.TaskCategory)1 IOException (java.io.IOException)1 ArrayList (java.util.ArrayList)1 JSONArray (org.json.JSONArray)1 JSONException (org.json.JSONException)1