/** * 'Cancels' a workitem, either remove it, either flags it as cancelled */ public void cancel (final CancelItem ci) throws StoreException { this.putStrategy.remove(ci.getId()); }
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()); }
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; }
@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); } }
/** * 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; }