use of com.centurylink.mdw.bpm.MDWStatusMessageDocument in project mdw-designer by CenturyLinkCloud.
the class RestfulServer method skipActivityInstance.
public String skipActivityInstance(Long activityId, Long activityInstanceId, String completionCode, boolean oldFormat) throws DataAccessException, XmlException, IOException {
if (isSchemaVersion61()) {
return skipActivityInstance(activityInstanceId, ActivityResultCodeConstant.RESULT_PROCEED, completionCode);
} else {
String request = buildSkipActivityInstanceRequest(activityId, activityInstanceId, completionCode, oldFormat);
MDWStatusMessageDocument statusMsgDoc = invokeService(request);
if (statusMsgDoc.getMDWStatusMessage().getStatusCode() == 0)
// indicates success
return "";
else
return statusMsgDoc.getMDWStatusMessage().getStatusMessage();
}
}
use of com.centurylink.mdw.bpm.MDWStatusMessageDocument in project mdw-designer by CenturyLinkCloud.
the class RestfulServer method retryActivityInstance.
public String retryActivityInstance(Long activityId, Long activityInstanceId, boolean oldFormat) throws DataAccessException, XmlException, IOException {
if (isSchemaVersion61()) {
return retryActivityInstance(activityInstanceId, ActivityResultCodeConstant.RESULT_RETRY);
} else {
String request = buildRetryActivityInstanceRequest(activityId, activityInstanceId, oldFormat);
MDWStatusMessageDocument statusMsgDoc = invokeService(request);
if (statusMsgDoc.getMDWStatusMessage().getStatusCode() == 0)
// indicates success
return "";
else
return statusMsgDoc.getMDWStatusMessage().getStatusMessage();
}
}
use of com.centurylink.mdw.bpm.MDWStatusMessageDocument in project mdw-designer by CenturyLinkCloud.
the class RestfulServer method invokeResourceService.
public String invokeResourceService(String path) throws DataAccessException, IOException {
String url = getMdwWebUrl() + (path.startsWith("/") ? "Services/" + path : "/Services/" + path);
String response = null;
try {
HttpHelper httpHelper = getHttpHelper(url);
httpHelper.setConnectTimeout(getConnectTimeout());
httpHelper.setReadTimeout(getReadTimeout());
response = httpHelper.get();
} catch (SocketTimeoutException ex) {
throw new IOException("Timeout after " + getReadTimeout() + " ms", ex);
} catch (FileNotFoundException ex) {
throw ex;
} catch (IOException ex) {
throw new IOException("Unable to connect to " + getMdwWebUrl(), ex);
}
if (response != null && (response.trim().startsWith("<xs:MDWStatusMessage") || response.trim().startsWith("<bpm:MDWStatusMessage"))) {
try {
MDWStatusMessageDocument msgDoc = MDWStatusMessageDocument.Factory.parse(response, Compatibility.namespaceOptions());
throw new DataAccessException(msgDoc.getMDWStatusMessage().getStatusMessage());
} catch (Exception ex) {
throw new DataAccessException(-1, response, ex);
}
}
return response;
}
use of com.centurylink.mdw.bpm.MDWStatusMessageDocument in project mdw-designer by CenturyLinkCloud.
the class Server method getErrorMessageFromResponse.
public String getErrorMessageFromResponse(String response) throws XmlException {
MDWStatusMessageDocument statusMessageDoc = MDWStatusMessageDocument.Factory.parse(response, Compatibility.namespaceOptions());
MDWStatusMessage statusMessage = statusMessageDoc.getMDWStatusMessage();
if (// indicate success
statusMessage.getStatusCode() == 0)
// indicate success
return "";
else
return statusMessage.getStatusMessage();
}
use of com.centurylink.mdw.bpm.MDWStatusMessageDocument in project mdw-designer by CenturyLinkCloud.
the class CacheRefresh method refreshSingle.
public void refreshSingle(String cacheName, boolean silent) {
try {
MDWStatusMessageDocument statusMsgDoc = restfulServer.refreshCache("SingleCache", cacheName, workflowProject.isRemote(), workflowProject.isOldNamespaces(), false);
if (!silent) {
String message = statusMsgDoc.getMDWStatusMessage().getStatusMessage();
PluginMessages.uiMessage(workflowProject.getName() + " Refresh Caches:\n" + message, REFRESH_CACHES, workflowProject, PluginMessages.INFO_MESSAGE);
}
} catch (Exception ex) {
if (!silent || MdwPlugin.getSettings().isLogConnectErrors())
PluginMessages.uiError(ex, ex.getMessage(), REFRESH_CACHES, workflowProject);
}
}
Aggregations