/** * Sets the lastExpressionId of the workItem as 'this' id */ public void tag (final InFlowWorkItem wi) { if (wi == null) { log.warn("tag() wi is null ??? for "+this.getId()); return; } //log.debug("tag() was "+wi.getLastExpressionId()); wi.setId(this.getId()); //log.debug("tag() is "+wi.getLastExpressionId()); }
protected InFlowWorkItem decodeInFlowWorkItem (final org.jdom.Element elt) throws CodingException { InFlowWorkItem wi = new InFlowWorkItem(); org.jdom.Element leiElt = elt.getChild(LAST_EXPRESSION_ID, elt.getNamespace()); if (leiElt != null) { leiElt = leiElt.getChild(FLOW_EXPRESSION_ID, elt.getNamespace()); wi.setId(decodeFlowExpressionId(leiElt)); } wi.setParticipantName(elt.getAttributeValue(PARTICIPANT_NAME)); wi.setDispatchTime(elt.getAttributeValue(DISPATCH_TIME)); //log.debug // ("decodeInFlowWorkItem() wi.dispatchTime >"+ // wi.getDispatchTime()+"<"); // // decode filter wi.setFilter(decodeFilter(elt)); // // decode history wi.setHistory(decodeHistory(elt)); return wi; }
wi.setId(lastExpressionId);
public static void main (String[] args) throws Exception { // // encoding InFlowWorkItem wi = new InFlowWorkItem(); wi.setId(new FlowExpressionId()); wi.getAttributes().puts("mf_fields", "color, size, quantity"); wi.getAttributes().puts("mf_header", "This is our offer"); wi.getAttributes().puts("mf_footer", "Best regards,\n\nJohn"); wi.getAttributes().puts("color", "blue"); wi.getAttributes().puts("size", "XL"); WorkItemCoder coder = new MailFormCoder(); String s = new String ((byte[])coder.encode(wi, null, null), Utils.getEncoding()); System.out.println(s); // // decoding wi = (InFlowWorkItem)coder .decode(new java.io.StringReader(s), null, null); System.out.println(); System.out.println("color : "+wi.getAttributes().sget("color")); System.out.println("size : "+wi.getAttributes().sget("size")); System.out.println("quantity : "+wi.getAttributes().sget("quantity")); }
result.setId(workItem.getId()); result.setParticipantName(workItem.getParticipantName()); result.setLastModified(workItem.getLastModified());
/** * Produces an exact replica of this InFlowWorkItem */ public Object clone () { InFlowWorkItem clone = new InFlowWorkItem (); clone.setAttributes((StringMapAttribute)getAttributes().clone()); if (getId() != null) clone.setId(getId().copy()); clone.setParticipantName(Utils.copyString(getParticipantName())); clone.setDispatchTime(Utils.copyString(getDispatchTime())); clone.setLastModified(Time.toIsoDate()); clone.setFilter(getFilter()); clone.setHistory(HistoryItem.copyHistoryList(this.history)); return clone; }