@Override protected String getBody( UserNotificationEvent userNotificationEvent, ServiceContext serviceContext) throws Exception { JSONObject jsonObject = JSONFactoryUtil.createJSONObject(userNotificationEvent.getPayload()); long workflowTaskId = jsonObject.getLong("workflowTaskId"); WorkflowTask workflowTask = WorkflowTaskManagerUtil.fetchWorkflowTask(serviceContext.getCompanyId(), workflowTaskId); if (workflowTask == null) { _userNotificationEventLocalService.deleteUserNotificationEvent( userNotificationEvent.getUserNotificationEventId()); return null; } return HtmlUtil.escape(jsonObject.getString("notificationMessage")); }
@Override protected String getLink( UserNotificationEvent userNotificationEvent, ServiceContext serviceContext) throws Exception { JSONObject jsonObject = JSONFactoryUtil.createJSONObject(userNotificationEvent.getPayload()); String entryClassName = jsonObject.getString("entryClassName"); WorkflowHandler<?> workflowHandler = WorkflowHandlerRegistryUtil.getWorkflowHandler(entryClassName); if (workflowHandler == null) { return null; } long workflowTaskId = jsonObject.getLong("workflowTaskId"); return workflowHandler.getURLEditWorkflowTask(workflowTaskId, serviceContext); }