Search in sources :

Example 11 with ActionRequestDocument

use of com.centurylink.mdw.service.ActionRequestDocument in project mdw-designer by CenturyLinkCloud.

the class WorkflowLaunchConfiguration method notifyProcess.

public void notifyProcess(WorkflowProject workflowProject, String eventName, String message, Map<String, String> headers) {
    try {
        ActionRequestDocument msgdoc = ActionRequestDocument.Factory.newInstance();
        ActionRequest actionRequest = msgdoc.addNewActionRequest();
        com.centurylink.mdw.service.Action act = actionRequest.addNewAction();
        act.setName("RegressionTest");
        Parameter param = act.addNewParameter();
        param.setName("SubAction");
        param.setStringValue("NotifyProcess");
        param = act.addNewParameter();
        param.setName("EventName");
        param.setStringValue(eventName);
        param = act.addNewParameter();
        param.setName("Message");
        param.setStringValue(message);
        String request;
        if (workflowProject.isOldNamespaces())
            request = DesignerCompatibility.getInstance().getOldActionRequest(msgdoc);
        else
            request = msgdoc.xmlText();
        String response = workflowProject.getDesignerProxy().notifyProcess(request, headers);
        if (writeToConsole)
            writeToConsole("Notify Process Response", response + "\n");
    } catch (Exception ex) {
        showError(ex, "Send External Event", workflowProject);
    }
}
Also used : ActionRequest(com.centurylink.mdw.service.ActionRequestDocument.ActionRequest) Parameter(com.centurylink.mdw.service.Parameter) IOException(java.io.IOException) PartInitException(org.eclipse.ui.PartInitException) ActionRequestDocument(com.centurylink.mdw.service.ActionRequestDocument)

Aggregations

ActionRequestDocument (com.centurylink.mdw.service.ActionRequestDocument)11 Parameter (com.centurylink.mdw.service.Parameter)9 ActionRequest (com.centurylink.mdw.service.ActionRequestDocument.ActionRequest)8 Action (com.centurylink.mdw.service.Action)6 IOException (java.io.IOException)4 VariableVO (com.centurylink.mdw.model.value.variable.VariableVO)3 DataAccessException (com.centurylink.mdw.common.exception.DataAccessException)2 ValidationException (com.centurylink.mdw.designer.utils.ValidationException)2 MbengException (com.qwest.mbeng.MbengException)2 ParseException (java.text.ParseException)2 XmlException (org.apache.xmlbeans.XmlException)2 JSONException (org.json.JSONException)2 MDWStatusMessage (com.centurylink.mdw.bpm.MDWStatusMessageDocument.MDWStatusMessage)1 StatusMessage (com.centurylink.mdw.common.service.types.StatusMessage)1 HttpHelper (com.centurylink.mdw.common.utilities.HttpHelper)1 File (java.io.File)1 InetAddress (java.net.InetAddress)1 SocketTimeoutException (java.net.SocketTimeoutException)1 RemoteException (java.rmi.RemoteException)1 Date (java.util.Date)1