use of com.centurylink.mdw.model.value.user.UserActionVO in project mdw-designer by CenturyLinkCloud.
the class DesignerDataAccess method auditLog.
public void auditLog(Action action, Entity entity, Long entityId, String comments) throws DataAccessException {
if (dbSchemaVersion < DataAccess.schemaVersion61) {
UserActionVO userAction = new UserActionVO(cuid, action, entity, entityId, comments);
auditLog(userAction);
}
}
use of com.centurylink.mdw.model.value.user.UserActionVO in project mdw-designer by CenturyLinkCloud.
the class NotificationChecker method checkNotices.
private String checkNotices() {
taskInstanceId = null;
String msg = null;
try {
String urlStr = workflowProject.getServiceUrl() + "/Services/TaskActions?user=" + workflowProject.getUser().getUsername() + "&since=" + URLEncoder.encode(StringHelper.dateToString(lastResult), "utf-8") + "&max=" + MAX_NOTICES + "&format=json";
HttpHelper httpHelper = workflowProject.getHttpHelper(urlStr);
httpHelper.setConnectTimeout(MdwPlugin.getSettings().getHttpConnectTimeout());
httpHelper.setReadTimeout(MdwPlugin.getSettings().getHttpReadTimeout());
String response = new String(httpHelper.get());
JSONArray actions = new JSONArray(response);
// String[0]), lastResult);
if (actions.length() > 0) {
msg = "";
UserActionVO firstAction = new UserActionVO(actions.getJSONObject(0));
if (actions.length() == 1) {
taskInstanceId = firstAction.getEntityId();
msg += messageLine(firstAction);
} else {
for (int i = 0; i < actions.length(); i++) {
JSONObject action = actions.getJSONObject(i);
msg += messageLine(new UserActionVO(action));
}
}
lastResult = firstAction.getRetrieveDate();
}
if (lastResult == null)
// fall back to device time
lastResult = new Date();
String lastResultStr = new SimpleDateFormat("MM/dd/yyyy HH:mm:ss").format(lastResult);
workflowProject.setPersistentProperty(NotificationChecker.NOTIF_CHECK_LAST_RESULT_KEY, lastResultStr);
} catch (Exception ex) {
PluginMessages.uiError(ex, "Check Notices", workflowProject);
}
return msg;
}
use of com.centurylink.mdw.model.value.user.UserActionVO in project mdw-designer by CenturyLinkCloud.
the class PluginDataAccess method auditLog.
public void auditLog(Action action, Entity entity, Long entityId, String comments) throws DataAccessException {
if (!workflowProject.checkRequiredVersion(6, 1, 1)) {
UserActionVO userAction = new UserActionVO(workflowProject.getUser().getUsername(), action, entity, entityId, comments);
userAction.setSource("Eclipse/RCP Designer");
getDesignerDataAccess().auditLog(userAction);
}
}
use of com.centurylink.mdw.model.value.user.UserActionVO in project mdw-designer by CenturyLinkCloud.
the class DesignerProxy method launchProcess.
public MDWStatusMessage launchProcess(WorkflowProcess processVersion, String masterRequestId, String owner, Long ownerId, List<VariableValue> variableValues, Long activityId) throws DataAccessException, XmlException, JSONException, IOException {
Map<VariableVO, String> variables = new HashMap<>();
for (VariableValue variableValue : variableValues) {
variables.put(variableValue.getVariableVO(), variableValue.getValue());
}
MDWStatusMessageDocument statusMessageDoc = restfulServer.launchProcess(processVersion.getId(), masterRequestId, owner, ownerId, variables, activityId, project.isOldNamespaces());
if (statusMessageDoc.getMDWStatusMessage().getStatusCode() != 0)
throw new RemoteException("Error launching process: " + statusMessageDoc.getMDWStatusMessage().getStatusMessage());
// audit log in separate dao since launch is multi-threaded
UserActionVO userAction = new UserActionVO(project.getUser().getUsername(), Action.Run, processVersion.getActionEntity(), processVersion.getId(), processVersion.getLabel());
userAction.setSource("Eclipse/RCP Designer");
try {
new DesignerDataAccess(dataAccess.getDesignerDataAccess()).auditLog(userAction);
} catch (Exception ex) {
throw new DataAccessException(-1, ex.getMessage(), ex);
}
return statusMessageDoc.getMDWStatusMessage();
}
Aggregations