use of com.centurylink.mdw.dataaccess.DataAccessOfflineException in project mdw-designer by CenturyLinkCloud.
the class RuntimeDataAccessRest method getProcessInstanceList.
public ProcessList getProcessInstanceList(Map<String, String> criteria, Map<String, String> variables, int pageIndex, int pageSize, String orderBy) throws DataAccessException {
try {
String pathWithArgs = "Processes?mdw-app=designer";
if (!getServer().isSchemaVersion61())
pathWithArgs = "ProcessInstances?format=json";
String criteriaParams = queryParams(criteria);
if (criteriaParams.length() > 0)
pathWithArgs += "&" + criteriaParams;
String varParams = queryParams(variables);
if (varParams.length() > 0)
pathWithArgs += "&" + varParams;
if (pageIndex > 0)
pathWithArgs += "&pageIndex=" + pageIndex;
if (pageSize != 0)
pathWithArgs += "&pageSize=" + pageSize;
if (orderBy != null) {
pathWithArgs += "&orderBy=" + URLEncoder.encode(orderBy.trim(), "UTF-8");
}
String response = invokeResourceService(pathWithArgs);
return new ProcessList(ProcessList.PROCESS_INSTANCES, response);
} catch (IOException ex) {
throw new DataAccessOfflineException(ex.getMessage(), ex);
} catch (Exception ex) {
throw new DataAccessException(ex.getMessage(), ex);
}
}
use of com.centurylink.mdw.dataaccess.DataAccessOfflineException in project mdw-designer by CenturyLinkCloud.
the class RuntimeDataAccessRest method getProcessInstanceAll.
public ProcessInstanceVO getProcessInstanceAll(Long processInstanceId) throws DataAccessException {
try {
String pathWithArgs = "Processes/" + processInstanceId;
if (!getServer().isSchemaVersion61())
pathWithArgs = "ProcessInstance?format=json&instanceId=" + processInstanceId;
String response = invokeResourceService(pathWithArgs);
return new ProcessInstanceVO(new JSONObject(response));
} catch (IOException ex) {
throw new DataAccessOfflineException(ex.getMessage(), ex);
} catch (Exception ex) {
throw new DataAccessException(ex.getMessage(), ex);
}
}
use of com.centurylink.mdw.dataaccess.DataAccessOfflineException 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);
}
}
use of com.centurylink.mdw.dataaccess.DataAccessOfflineException in project mdw-designer by CenturyLinkCloud.
the class RuntimeDataAccessRest method getProcessInstanceCallHierarchy.
public LinkedProcessInstance getProcessInstanceCallHierarchy(Long processInstanceId) throws DataAccessException {
try {
String pathWithArgs = "Processes?mdw-app=designer&callHierarchyFor=" + processInstanceId;
String response;
if (!getServer().isSchemaVersion61())
pathWithArgs = "ProcessInstances?format=json&callHierarchyFor=" + processInstanceId;
response = invokeResourceService(pathWithArgs);
return new LinkedProcessInstance(response);
} catch (IOException ex) {
throw new DataAccessOfflineException(ex.getMessage(), ex);
} catch (Exception ex) {
throw new DataAccessException(ex.getMessage(), ex);
}
}
use of com.centurylink.mdw.dataaccess.DataAccessOfflineException in project mdw-designer by CenturyLinkCloud.
the class ImportExportWizard method performFinish.
@Override
public boolean performFinish() {
IRunnableWithProgress op = new IRunnableWithProgress() {
public void run(IProgressMonitor monitor) throws InvocationTargetException {
ProgressMonitor progressMonitor = new SwtProgressMonitor(monitor);
try {
progressMonitor.start((page.isExport ? "Exporting from " : "Importing into ") + "'" + getProject().getLabel() + "'");
progressMonitor.progress(5);
performImportExport(progressMonitor);
progressMonitor.done();
} catch (ActionCancelledException ex) {
throw new OperationCanceledException();
} catch (Exception ex) {
PluginMessages.log(ex);
throw new InvocationTargetException(ex);
}
}
};
try {
getContainer().run(true, true, op);
postRunUpdates();
return true;
} catch (InvocationTargetException ex) {
if (ex.getCause() instanceof DataAccessOfflineException)
MessageDialog.openError(getShell(), "Export Attributes", "Server appears to be offline: " + ex.getMessage());
else
PluginMessages.uiError(getShell(), ex, page.getTitle(), getProject());
return false;
} catch (Exception ex) {
PluginMessages.uiError(getShell(), ex, page.getTitle(), getProject());
return false;
}
}
Aggregations