Search in sources :

Example 1 with TaskList

use of com.centurylink.mdw.common.task.TaskList in project mdw-designer by CenturyLinkCloud.

the class RuntimeDataAccessRest method getTaskInstancesForProcessInstance.

public List<TaskInstanceVO> getTaskInstancesForProcessInstance(Long processInstanceId) throws DataAccessException {
    try {
        if (getServer().getSchemaVersion() >= 6000) {
            String path = "Tasks?processInstanceId=" + processInstanceId;
            String response = invokeResourceService(path);
            return new TaskList(TaskList.TASKS, response).getItems();
        } else {
            String path = "ProcessTasks?format=json&processInstanceId=" + processInstanceId;
            String response = invokeResourceService(path);
            return new TaskList(TaskList.PROCESS_TASKS, response).getItems();
        }
    } catch (IOException ex) {
        throw new DataAccessOfflineException(ex.getMessage(), ex);
    } catch (Exception ex) {
        throw new DataAccessException(ex.getMessage(), ex);
    }
}
Also used : DataAccessOfflineException(com.centurylink.mdw.dataaccess.DataAccessOfflineException) TaskList(com.centurylink.mdw.common.task.TaskList) IOException(java.io.IOException) JSONException(org.json.JSONException) DataAccessOfflineException(com.centurylink.mdw.dataaccess.DataAccessOfflineException) DataAccessException(com.centurylink.mdw.common.exception.DataAccessException) IOException(java.io.IOException) XmlException(org.apache.xmlbeans.XmlException) DataAccessException(com.centurylink.mdw.common.exception.DataAccessException)

Aggregations

DataAccessException (com.centurylink.mdw.common.exception.DataAccessException)1 TaskList (com.centurylink.mdw.common.task.TaskList)1 DataAccessOfflineException (com.centurylink.mdw.dataaccess.DataAccessOfflineException)1 IOException (java.io.IOException)1 XmlException (org.apache.xmlbeans.XmlException)1 JSONException (org.json.JSONException)1