Search in sources :

Example 6 with ProcessList

use of com.centurylink.mdw.model.value.process.ProcessList in project mdw-designer by CenturyLinkCloud.

the class RuntimeDataAccessRest method hasProcessInstances.

public boolean hasProcessInstances(Long processId) throws DataAccessException {
    try {
        String pathWithArgs = "Processes?processId=" + processId + "&pageSize=1";
        if (!getServer().isSchemaVersion61())
            pathWithArgs = "ProcessInstances?format=json&pageSize=1&processId=" + processId;
        String response = invokeResourceService(pathWithArgs);
        return new ProcessList(ProcessList.PROCESS_INSTANCES, response).getCount() > 0;
    } 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) ProcessList(com.centurylink.mdw.model.value.process.ProcessList) 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

ProcessList (com.centurylink.mdw.model.value.process.ProcessList)6 DataAccessException (com.centurylink.mdw.common.exception.DataAccessException)3 DataAccessOfflineException (com.centurylink.mdw.dataaccess.DataAccessOfflineException)3 ProcessInstanceVO (com.centurylink.mdw.model.value.process.ProcessInstanceVO)3 IOException (java.io.IOException)3 XmlException (org.apache.xmlbeans.XmlException)3 JSONException (org.json.JSONException)3 RuntimeDataAccess (com.centurylink.mdw.dataaccess.RuntimeDataAccess)2 ActionRequestMessage (com.centurylink.mdw.common.service.types.ActionRequestMessage)1 DesignerProxy (com.centurylink.mdw.plugin.designer.DesignerProxy)1 WorkflowProcess (com.centurylink.mdw.plugin.designer.model.WorkflowProcess)1 ArrayList (java.util.ArrayList)1 HashMap (java.util.HashMap)1 JSONObject (org.json.JSONObject)1