/** * Returns the id of the last expression this InFlowWorkItem transited * through (or simply the fei of the expression that emitted this * workitem out of the engine). */ public FlowExpressionId getLastExpressionId () { return this.getId(); }
/** * remove one work item by id. */ private static void removeWorkItem(InFlowWorkItem wi) { try { getWorkItemStore().removeWorkItem(wi.getId()); } catch (StoreException e) { log.error("can't remove workitem", e); } }
public void cacheWorkitem (final InFlowWorkItem wi) { this.put(wi.getId().toString(), wi); /* if (log.isDebugEnabled()) { log.debug ("cacheWorkitem() ("+this.storeName+ " "+this.size()+") "+wi.getId()); } */ }
/** * This method returns the item id that should be used for the log. */ protected String determineItemId (final WorkItem item) { StringBuffer id = new StringBuffer(); if (this.idFieldName != null) id.append(item.getAttributes().sget(this.idFieldName)); if (item instanceof InFlowWorkItem) { final InFlowWorkItem ifwi = (InFlowWorkItem)item; if (id.length() > 0) { id .insert(0, this.separator) .insert(0, ifwi.getId().getWorkflowInstanceId()); } else { id = new StringBuffer(ifwi.getId().toString()); } } if (id.length() < 1) return "_new_"; return id.toString(); }
/** * Inserts a workitem into the storage for given store. */ public void storeWorkItem (final String storeName, final InFlowWorkItem wi) throws StoreException { if (log.isDebugEnabled()) log.debug("storeWorkItem() '"+storeName+"' "+wi.getId()); // // store in cache getWorkitemCache(storeName).cacheWorkitem(wi); // // store in the real storage getCachedStorage().storeWorkItem(storeName, wi); }
String fileName = determineFileName(((InFlowWorkItem)wi).getId());
/** * Replies to the engine (this method is only used by certain * extensions of this class). * This method is protected as well, but there shouldn't be any need * to override it. * * @param context the engine ApplicationContext * @param wi the param as it should resume along its flow. */ protected void reply (final ApplicationContext context, final WorkItem wi) throws DispatchingException { final InFlowWorkItem ifwi = (InFlowWorkItem)wi; try { Definitions.getExpressionPool(context) .reply(ifwi.getId(), ifwi); } catch (final Throwable t) { throw new DispatchingException ("failed to feed back workitem to engine", t); } }
.determineFileName(wi.getId());
ifwi.getId(), Launcher.URL_FIELD_PREFIX+this.processDefinitionField, true); // async is true
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; }