protected static HistoryItem extractHistoryItem (final java.sql.ResultSet rs) throws java.sql.SQLException { final HistoryItem hi = new HistoryItem(); int i = 3; hi.setDate(rs.getString(i++)); hi.setAuthor(rs.getString(i++)); hi.setHost(rs.getString(i++)); hi.setText(rs.getString(i++)); hi.setWorkflowDefinitionName(rs.getString(i++)); hi.setWorkflowDefinitionRevision(rs.getString(i++)); hi.setWorkflowInstanceId(rs.getString(i++)); return hi; }
protected HistoryItem decodeHistoryItem (org.jdom.Element elt) { HistoryItem item = new HistoryItem(); item.setDate(elt.getAttributeValue(DATE)); item.setAuthor(elt.getAttributeValue(AUTHOR)); item.setHost(elt.getAttributeValue(HOST)); item.setText(elt.getTextTrim()); item.setWorkflowDefinitionName (elt.getAttributeValue(WORKFLOW_DEFINITION_NAME)); item.setWorkflowDefinitionRevision (elt.getAttributeValue(WORKFLOW_DEFINITION_REVISION)); try { item.setWorkflowInstanceId (elt.getAttributeValue(WORKFLOW_INSTANCE_ID)); } catch (NumberFormatException nfe) { // let workflow instance id to -1 } item.setExpressionId(elt.getAttributeValue(EXPRESSION_ID)); return item; }
/** * Adds a 'participant' history item to the workitem. */ protected void addHistoryItem (final InFlowWorkItem wi) { if (wi.getHistory() == null) wi.setHistory(new java.util.ArrayList(1)); final HistoryItem hi = new HistoryItem(getId()); try { hi.setAuthor("participant::"+getParticipantName(wi)); } catch (ApplyException ae) { hi.setAuthor("participant::unknown"); } try { java.net.InetAddress add = java.net.InetAddress.getLocalHost(); hi.setHost(add.getHostName()+" / "+add.getHostAddress()); } catch (java.net.UnknownHostException uhe) { hi.setHost(""+uhe); } hi.setText(HISTORY_TEXT); wi.getHistory().add(hi); //log.debug("addHistoryItem() did it"); }
hi.setAuthor(author); hi.setDate(Time.toIsoDate()); hi.setText(text);