use of com.centurylink.mdw.service.ActionRequestDocument in project mdw-designer by CenturyLinkCloud.
the class RestfulServer method refreshCache.
public MDWStatusMessageDocument refreshCache(String type, String cacheName, boolean global, boolean oldFormat, boolean includeDynamicJava) throws DataAccessException, XmlException, IOException {
if (isSchemaVersion61())
return refreshCache("WorkflowCache", cacheName, global, includeDynamicJava);
else {
ActionRequestDocument actionRequestDoc = ActionRequestDocument.Factory.newInstance();
ActionRequest actionRequest = actionRequestDoc.addNewActionRequest();
Action action = actionRequest.addNewAction();
action.setName("RefreshCache");
if (type != null) {
Parameter typeParam = action.addNewParameter();
typeParam.setName("RefreshType");
typeParam.setStringValue(type);
}
if (cacheName != null) {
Parameter cacheNameParam = action.addNewParameter();
cacheNameParam.setName("CacheName");
cacheNameParam.setStringValue(cacheName);
}
if (global) {
Parameter parameter = action.addNewParameter();
parameter.setName("GlobalRefresh");
parameter.setStringValue("true");
}
if (!includeDynamicJava) {
Parameter parameter = action.addNewParameter();
parameter.setName("ExcludedFormats");
parameter.setStringValue(RuleSetVO.JAVA);
}
String request;
if (oldFormat)
request = DesignerCompatibility.getInstance().getOldActionRequest(actionRequestDoc);
else
request = actionRequestDoc.xmlText(getXmlOptions());
return invokeService(request);
}
}
use of com.centurylink.mdw.service.ActionRequestDocument in project mdw-designer by CenturyLinkCloud.
the class RestfulServer method stubServer.
public MDWStatusMessageDocument stubServer(String host, int port, boolean on, boolean oldFormat) throws DataAccessException, RemoteException, XmlException {
ActionRequestDocument actionRequestDoc = ActionRequestDocument.Factory.newInstance();
ActionRequest actionRequest = actionRequestDoc.addNewActionRequest();
Action action = actionRequest.addNewAction();
action.setName("RegressionTest");
Parameter param = action.addNewParameter();
param.setName("Maintenance");
param.setStringValue("Stubbing");
param = action.addNewParameter();
param.setName("Server");
param.setStringValue(host + ":" + port);
param = action.addNewParameter();
param.setName("Mode");
param.setStringValue(on ? "on" : "off");
String request;
if (oldFormat)
request = DesignerCompatibility.getInstance().getOldActionRequest(actionRequestDoc);
else
request = actionRequestDoc.xmlText(getXmlOptions());
return invokeService(request);
}
use of com.centurylink.mdw.service.ActionRequestDocument in project mdw-designer by CenturyLinkCloud.
the class Server method buildLaunchProcessRequest.
public String buildLaunchProcessRequest(ProcessVO procdef, String masterRequestId, Long activityId, Map<String, String> parameters, boolean isServiceProcess, boolean oldFormat) throws DataAccessException, RemoteException, XmlException {
ActionRequestDocument actionRequestDoc = getLaunchProcessBaseDoc(procdef.getProcessId(), masterRequestId, "Designer", procdef.getId());
Action action = actionRequestDoc.getActionRequest().getAction();
if (activityId != null) {
Parameter parameter = action.addNewParameter();
parameter.setName("mdw.ActivityId");
parameter.setStringValue(activityId.toString());
}
if (isServiceProcess) {
Parameter syncParam = actionRequestDoc.getActionRequest().getAction().addNewParameter();
syncParam.setName("mdw.Synchronous");
syncParam.setStringValue("true");
}
for (String processParam : parameters.keySet()) {
Parameter parameter = action.addNewParameter();
parameter.setName(processParam);
VariableVO varVO = procdef.getVariable(processParam);
if (varVO != null)
parameter.setType(varVO.getVariableType());
parameter.setStringValue(parameters.get(processParam));
}
if (oldFormat)
return DesignerCompatibility.getInstance().getOldActionRequest(actionRequestDoc);
else
return actionRequestDoc.xmlText(getXmlOptions());
}
use of com.centurylink.mdw.service.ActionRequestDocument in project mdw-designer by CenturyLinkCloud.
the class RestfulServer method launchProcess.
public MDWStatusMessageDocument launchProcess(Long processId, String masterRequestId, String owner, Long ownerId, Map<VariableVO, String> variables, Long activityId, boolean oldFormat) throws DataAccessException, XmlException, JSONException, IOException {
if (isSchemaVersion61()) {
String response = launchProcess(processId, masterRequestId, owner, ownerId, variables);
StatusMessage statusMessage = new StatusMessage(new JSONObject(response));
return statusMessage.getStatusDocument();
} else {
ActionRequestDocument actionRequestDoc = getLaunchProcessBaseDoc(processId, masterRequestId, owner, ownerId);
for (VariableVO variableVO : variables.keySet()) {
Parameter parameter = actionRequestDoc.getActionRequest().getAction().addNewParameter();
parameter.setName(variableVO.getVariableName());
parameter.setType(variableVO.getVariableType());
String stringValue = variables.get(variableVO);
parameter.setStringValue(stringValue);
}
if (activityId != null) {
Parameter parameter = actionRequestDoc.getActionRequest().getAction().addNewParameter();
parameter.setName("mdw.ActivityId");
parameter.setStringValue(activityId.toString());
}
String request;
if (oldFormat)
request = DesignerCompatibility.getInstance().getOldActionRequest(actionRequestDoc);
else
request = actionRequestDoc.xmlText(getXmlOptions());
return invokeService(request);
}
}
use of com.centurylink.mdw.service.ActionRequestDocument in project mdw-designer by CenturyLinkCloud.
the class LogSubscriberSocket method notifyServer.
private void notifyServer(boolean on) throws Exception {
ActionRequestDocument msgdoc = ActionRequestDocument.Factory.newInstance();
ActionRequest actionRequest = msgdoc.addNewActionRequest();
Action action = actionRequest.addNewAction();
action.setName("RegressionTest");
Parameter param = action.addNewParameter();
param.setName("Maintenance");
param.setStringValue("Watching");
param = action.addNewParameter();
param.setName("Server");
InetAddress ownIP = InetAddress.getLocalHost();
param.setStringValue(ownIP.getHostAddress() + ":" + LoggerUtil.getStandardLogger().getDefaultPort());
param = action.addNewParameter();
param.setName("Mode");
param.setStringValue(on ? "on" : "off");
String request;
if (oldNamespaces)
request = DesignerCompatibility.getInstance().getOldActionRequest(msgdoc);
else
request = msgdoc.xmlText();
dao.engineCall(request);
}
Aggregations