/** * 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)); }
public Object clone () { return new BooleanAttribute(booleanValue()); }
public Object encode (final Attribute a, final java.util.Map args) throws CodingException { final org.jdom.Element elt = newElement(); elt.addContent(((BooleanAttribute)a).getValue().toString()); return elt; }
/** * Looks for a boolean result field in the workitem. * Used by the 'if' and the 'when' expression. */ public static boolean lookupBooleanResult (final InFlowWorkItem wi) throws ReplyException { final Attribute a = wi.getAttributes().aget(F_RESULT); if (a == null) { throw new ReplyException ("lookupBooleanVariable() no boolean result found"); } //log.debug("o.class is "+o.getClass().getName()); if (a instanceof BooleanAttribute) return ((BooleanAttribute)a).booleanValue(); return (a.toString().toLowerCase().equals("true")); /* throw new ReplyException ("lookupBooleanVariable() boolean value expected, "+ "found "+a.getClass()); */ }
public Attribute decode (final Object o, final java.util.Map args) throws CodingException { final org.jdom.Element elt = enforceElement(o); String text = XmlUtils.fetchTextContent(elt).trim().toLowerCase(); //log.debug("decode() text is >"+text+"<"); try { return new BooleanAttribute(text.equals("true")); } catch (final NumberFormatException nfe) { throw new CodingException ("Cannot build a boolean from '"+text+"'", nfe); } }
.put(Definitions.V_TIMED_OUT, new BooleanAttribute(true));
attr = new BooleanAttribute("true".startsWith(fieldValue.toLowerCase()));
return new DoubleAttribute((Double)o); if (o instanceof Boolean) return new BooleanAttribute((Boolean)o); if (o instanceof org.jdom.Content) return new XmlAttribute((org.jdom.Content)o);
variableValue = new BooleanAttribute(value); else if (type.equals(T_INTEGER)) variableValue = new IntegerAttribute(value);