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; }
public org.jdom.Element encodeAsXml (HistoryItem hi) { org.jdom.Element elt = new org.jdom.Element(HISTORY_ITEM, XMLNS); elt.setAttribute (DATE, ""+hi.getDate()); elt.setAttribute (AUTHOR, ""+hi.getAuthor()); elt.setAttribute (HOST, ""+hi.getHost()); elt.setAttribute (WORKFLOW_DEFINITION_NAME, ""+hi.getWorkflowDefinitionName()); elt.setAttribute (WORKFLOW_DEFINITION_REVISION, ""+hi.getWorkflowDefinitionRevision()); elt.setAttribute (WORKFLOW_INSTANCE_ID, ""+hi.getWorkflowInstanceId()); elt.setAttribute (EXPRESSION_ID, ""+hi.getExpressionId()); elt.setText(hi.getText()); return elt; }
/** * 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"); }
public Object clone () { HistoryItem result = new HistoryItem(); result.date = Utils.copyString(this.date); result.author = Utils.copyString(this.author); result.host = Utils.copyString(this.host); result.text = Utils.copyString(this.text); result.wfdName = Utils.copyString(this.wfdName); result.wfdRevision = Utils.copyString(this.wfdRevision); //result.wfInstanceId = this.wfInstanceId; result.wfInstanceId = Utils.copyString(this.wfInstanceId); result.expressionId = Utils.copyString(this.expressionId); return result; }
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; }
values.add(workitemId.toString()); values.add(new Integer(id)); values.add(hi.getDate()); values.add(hi.getAuthor()); values.add(hi.getHost()); values.add(hi.getText()); values.add(hi.getWorkflowDefinitionName()); values.add(hi.getWorkflowDefinitionRevision()); values.add(hi.getWorkflowInstanceId());
(FlowExpressionId fei, final String author, final String text) HistoryItem hi = new HistoryItem(); hi.setAuthor(author); hi.setDate(Time.toIsoDate()); hi.setText(text); hi.setWorkflowDefinitionName (fei.getWorkflowDefinitionName()); hi.setWorkflowDefinitionRevision (fei.getWorkflowDefinitionRevision()); hi.setWorkflowInstanceId (fei.getWorkflowInstanceId()); hi.setHost(add.getHostName()+" / "+add.getHostAddress()); hi.setHost(""+uhe);