Search in sources :

Example 11 with Parameter

use of com.centurylink.mdw.service.Parameter 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

Parameter (com.centurylink.mdw.service.Parameter)11 ActionRequestDocument (com.centurylink.mdw.service.ActionRequestDocument)9 Action (com.centurylink.mdw.service.Action)6 ActionRequest (com.centurylink.mdw.service.ActionRequestDocument.ActionRequest)6 VariableVO (com.centurylink.mdw.model.value.variable.VariableVO)3 IOException (java.io.IOException)3 RemoteException (java.rmi.RemoteException)2 JSONObject (org.json.JSONObject)2 AuthenticationException (com.centurylink.mdw.auth.AuthenticationException)1 MDWStatusMessage (com.centurylink.mdw.bpm.MDWStatusMessageDocument.MDWStatusMessage)1 DataAccessException (com.centurylink.mdw.common.exception.DataAccessException)1 TranslationException (com.centurylink.mdw.common.exception.TranslationException)1 StatusMessage (com.centurylink.mdw.common.service.types.StatusMessage)1 SelfSerializable (com.centurylink.mdw.common.translator.SelfSerializable)1 VariableTranslator (com.centurylink.mdw.common.translator.VariableTranslator)1 JavaObjectTranslator (com.centurylink.mdw.common.translator.impl.JavaObjectTranslator)1 HttpHelper (com.centurylink.mdw.common.utilities.HttpHelper)1 DataAccessOfflineException (com.centurylink.mdw.dataaccess.DataAccessOfflineException)1 ValidationException (com.centurylink.mdw.designer.utils.ValidationException)1 DocumentReference (com.centurylink.mdw.model.value.variable.DocumentReference)1