/** * Produces an exact replica of this InFlowWorkItem */ public Object clone () { CancelItem clone = new CancelItem (); clone.setLastModified(Time.toIsoDate()); clone.setAttributes((StringMapAttribute)getAttributes().clone()); if (getId() != null) clone.setId(getId().copy()); clone.setParticipantName(Utils.copyString(getParticipantName())); return clone; }
protected CancelItem decodeCancelItem (final org.jdom.Element elt) throws CodingException { CancelItem ci = new CancelItem(); org.jdom.Element eiElt = elt.getChild(LAST_EXPRESSION_ID, elt.getNamespace()); if (eiElt != null) { eiElt = eiElt.getChild(FLOW_EXPRESSION_ID, elt.getNamespace()); ci.setId(decodeFlowExpressionId(eiElt)); } ci.setParticipantName(elt.getAttributeValue(PARTICIPANT_NAME)); return ci; }
protected org.jdom.Element encodeAsXml (final CancelItem ci) throws CodingException { if (log.isDebugEnabled()) log.debug("encodeAsXml() "+ci.getId()); org.jdom.Element elt = encodeSuper(ci); elt.setName(CANCELITEM); // // expressionId org.jdom.Element ei = new org.jdom.Element(LAST_EXPRESSION_ID, XMLNS); ei.addContent(encode(ci.getId())); elt.addContent(ei); // // participant name WicUtils.setAttribute (elt, PARTICIPANT_NAME, ci.getParticipantName()); // // done return elt; }
/** * 'Cancels' a workitem, either remove it, either flags it as cancelled */ public void cancel (final CancelItem ci) throws StoreException { this.putStrategy.remove(ci.getId()); }
lookupParticipant(this.appliedWorkitem); final CancelItem ci = new CancelItem (getId(), getParticipantName(this.appliedWorkitem));
@Override public void cancel(CancelItem cancelItem) throws Exception { if (log.isDebugEnabled()) { if (cancelItem.getId() != null) { log.debug("Cancelling {}", cancelItem.getId().toParseableString()); } } Context originalContext = null; if (MgnlContext.hasInstance()) { originalContext = MgnlContext.getInstance(); } try { String parName = cancelItem.getParticipantName(); if (!parName.startsWith(WorkflowConstants.PARTICIPANT_PREFIX_COMMAND)) { // // remove workitem from inbox MgnlContext.setInstance(MgnlContext.getSystemContext()); WorkflowUtil.getWorkItemStore().removeWorkItem(cancelItem.getId()); } } finally { MgnlContext.release(); MgnlContext.setInstance(originalContext); } }
public void cancel (final CancelItem ci) throws StoreException { final FlowExpressionId id = ci.getId(); this.cache.remove(id); this.cachedHeaders = null; removeWorkItem(id); }
/** * The worklist as good a embedded participant, implements this cancel() * method (which removes regular workitems). */ public void cancel (final CancelItem ci) throws Exception { //getStorage().removeWorkItem(this.listName, ci.getLastExpressionId()); getStorage().removeWorkItem(this.listName, ci.getId()); }