Search in sources :

Example 16 with ValidationException

use of com.centurylink.mdw.designer.utils.ValidationException in project mdw-designer by CenturyLinkCloud.

the class TestCaseRun method validateEngineCallResponse.

protected JSONObject validateEngineCallResponse(String response) throws ValidationException, XmlException, JSONException {
    MDWStatusMessageDocument statusMessageDoc;
    if (response.startsWith("{")) {
        StatusMessage statusMessage = new StatusMessage(new JSONObject(response));
        statusMessageDoc = statusMessage.getStatusDocument();
    } else {
        statusMessageDoc = MDWStatusMessageDocument.Factory.parse(response, Compatibility.namespaceOptions());
    }
    MDWStatusMessage statusMessage = statusMessageDoc.getMDWStatusMessage();
    if (statusMessage.getStatusCode() == -3) {
        // event handler not registered
        throw new ValidationException("No event handler is registered for regression test actions");
    } else if (statusMessage.getStatusCode() != 0) {
        throw new ValidationException("Error response from server: " + statusMessage.getStatusMessage());
    }
    if (statusMessage.getStatusMessage().startsWith("{"))
        return new JSONObject(statusMessage.getStatusMessage());
    else
        return null;
}
Also used : ValidationException(com.centurylink.mdw.designer.utils.ValidationException) JSONObject(org.json.JSONObject) MDWStatusMessage(com.centurylink.mdw.bpm.MDWStatusMessageDocument.MDWStatusMessage) MDWStatusMessageDocument(com.centurylink.mdw.bpm.MDWStatusMessageDocument) MDWStatusMessage(com.centurylink.mdw.bpm.MDWStatusMessageDocument.MDWStatusMessage) StatusMessage(com.centurylink.mdw.common.service.types.StatusMessage)

Aggregations

ValidationException (com.centurylink.mdw.designer.utils.ValidationException)16 DataAccessException (com.centurylink.mdw.common.exception.DataAccessException)10 RemoteException (java.rmi.RemoteException)9 ProcessVO (com.centurylink.mdw.model.value.process.ProcessVO)7 Graph (com.centurylink.mdw.designer.display.Graph)5 SubGraph (com.centurylink.mdw.designer.display.SubGraph)5 ProcessWorker (com.centurylink.mdw.designer.utils.ProcessWorker)5 CodeTimer (com.centurylink.mdw.plugin.CodeTimer)4 WorkflowProcess (com.centurylink.mdw.plugin.designer.model.WorkflowProcess)4 FlowchartPage (com.centurylink.mdw.designer.pages.FlowchartPage)3 WorkflowPackage (com.centurylink.mdw.plugin.designer.model.WorkflowPackage)3 ProcessValidator (com.centurylink.mdw.designer.utils.ProcessValidator)2 XmlException (org.apache.xmlbeans.XmlException)2 IProgressMonitor (org.eclipse.core.runtime.IProgressMonitor)2 Shell (org.eclipse.swt.widgets.Shell)2 MDWStatusMessageDocument (com.centurylink.mdw.bpm.MDWStatusMessageDocument)1 MDWStatusMessage (com.centurylink.mdw.bpm.MDWStatusMessageDocument.MDWStatusMessage)1 StatusMessage (com.centurylink.mdw.common.service.types.StatusMessage)1 ActionCancelledException (com.centurylink.mdw.common.utilities.timer.ActionCancelledException)1 DataAccessOfflineException (com.centurylink.mdw.dataaccess.DataAccessOfflineException)1