/** * Sets the field '__result__' in the workitem. */ public static void setResult (final InFlowWorkItem wi, final Object result) { wi.getAttributes().put(F_RESULT, AttributeUtils.java2owfe(result)); // the method java2owfe leaves the result untouched if // it's already an Attribute }
/** * Returns the count of attributes (field) the workitem has. * fieldCount() and attributeCount() are identical functions. */ public static String fieldCount (final FlowExpression fe, final InFlowWorkItem wi, final String[] args) { return ""+wi.getAttributes().size(); }
/** * The equivalent of put(new StringAttribute(key), value). But this * is mainly a method required by CollectionAttribute, the parent class. * This method is used by setField in CollectionAttribute, * it has thus an internal value rather than an API value. */ public void cput (final String key, final Attribute value) { this.put(new StringAttribute(key), value); }
/** * Sets the field '__boolean_result__' in the workitem. */ public static void setBooleanResult (final InFlowWorkItem wi, final boolean result) { //log.debug // ("setBooleanResult() '"+result+"' for "+wi.getLastExpressionId()); wi.getAttributes().put(F_RESULT, new BooleanAttribute(result)); }
/** * Determines the subject of the form email. */ protected String determineSubject (final WorkItem wi) { String subject = wi.getAttributes().sget("mf_subject"); if (subject != null) return subject; return "OpenWFE form"; }
/** * Returns the result held in the field '__result__'. */ public static Attribute getResult (final InFlowWorkItem wi) { return wi.getAttributes().aget(F_RESULT); }
/** * removes any boolean result variable in this expression * (used by CondExpression) */ public static void cleanResult (final InFlowWorkItem wi) { wi.getAttributes().remove(F_RESULT); }
/** * An alias for puts(). */ public void sput (final String key, final String value) { this.puts(key, value); }
/** * Turns a map into a StringMapAttribute (may easily be used in * conjunction with workitem.SetAttributes(x)) */ public static StringMapAttribute java2attributes (final java.util.Map m) { final StringMapAttribute result = new StringMapAttribute(); fillMap(result, m); return result; }
/** * 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(); }
/** * Turns a java Map into an OpenWFE MapAttribute. * Doesn't produce a StringMapAttribute. */ public static MapAttribute map2owfe (java.util.Map m) { MapAttribute result = new MapAttribute(); fillMap(result, m); return result; }
public static Attribute lookupAsAttribute (final String key, final org.jdom.Content c) { return toAttribute(lookupInXml(key, c)); }
/** * Returns true if this StringMapAttribute instance contains the * given key. */ public boolean hasKey (final String key) { return (this.get(key) != null); }
/** * Adds a HistoryItem to the history list of the workitem. */ public void addHistoryItem (final String author, final String text) { addHistoryItem(null, author, text); }
/** * A shortcut method for * getAttributes().cget(new StringAttribute(attributeName)); */ public Attribute getAttribute (final String attributeName) { if (this.attributes == null) return null; return this.attributes.cget(attributeName); }
private Attribute clone (final Attribute a) { if (a == null) return null; return (Attribute)a.clone(); }
/** * Returns the JDOM content instance encapsulated in this attribute. */ public org.jdom.Content getContent () { return (org.jdom.Content)getValue(); //return (org.jdom.Content)((org.jdom.Content)getValue()).clone(); }
/** * Given a key and a CollectionAttribute, looks up the collection * attribute containing the key. */ public static CollectionAttribute lookupContainer (final String key, final CollectionAttribute startPoint) { return (CollectionAttribute)doLookup(true, key, startPoint); }
/** * Returns the count of attributes (field) the workitem has. * fieldCount() and attributeCount() are identical functions. */ public static String attributeCount (final FlowExpression fe, final InFlowWorkItem wi, final String[] args) { return ""+wi.getAttributes().size(); }