private String buildBody(WorkflowUserInfo recipient) { bodyBuilder = new StringBuilder(); append("Dear " + recipient.getDisplayName(), 2); append( "The following working set within SIS has " + "been submitted to you for " + newStatus.getEmailFriendlyDesc() + ":", 2); append("Working Set: " + workingSet.getWorkingSetName()); append("Working Set Owner: " + workingSet.getCreatorUsername()); append("Working Set Status: " + workingSet.getWorkflowStatus()); append("Working Set Description: " + workingSet.getDescription()); append("Number of species: " + Integer.toString(workingSet.getSpeciesIDs().size())); append("Submission notes: " + comment.getComment()); append("Person submitting: " + sender.getDisplayName(), 2); append( "Please log into SIS and review the assessments; be sure " + "to provide appropriate notes and to change the status, if necessary, " + "to keep the assessments moving through the submission process.", 2); append("Thank you.", 2); append("SIS Administration."); return bodyBuilder.toString(); }
@Override public void addComment(Number id, WorkflowComment comment) throws WorkflowManagerException { final Row row = new Row(); try { row.add(new CInteger("id", RowID.get(ec, WorkflowConstants.WORKFLOW_NOTES_TABLE, "id"))); } catch (DBException e) { throw new WorkflowManagerException(e); } row.add(new CInteger("workflowstatusid", id)); row.add(new CString("scope", comment.getScope())); row.add(new CInteger("userid", comment.getUser().getID())); row.add(new CString("comment", comment.getComment())); row.add(new CDateTime("date", comment.getDate())); final InsertQuery query = new InsertQuery(); query.setRow(row); query.setTable(WorkflowConstants.WORKFLOW_NOTES_TABLE); try { ec.doUpdate(query); } catch (DBException e) { throw new WorkflowManagerException(e); } }