1 /* ProcessMgrIteratorExpressionBuilder.java */2 3 package org.enhydra.shark.api.common;4 5 import java.io.Serializable ;6 7 /**8 * ProcessMgrIteratorExpressionBuilder9 * <p>10 * All methods are returng the object itself to allow stacking method11 * calls on the same object.12 * 13 * @author V.Puskas14 * @version 0.315 */16 public interface ProcessMgrIteratorExpressionBuilder extends17 ExpressionBuilder,18 Serializable {19 /**20 * Appends <b>AND </b> operator to expression21 * 22 * @return itself23 */24 public ProcessMgrIteratorExpressionBuilder and();25 26 /**27 * Appends <b>OR </b> operator to expression28 * 29 * @return itself30 */31 public ProcessMgrIteratorExpressionBuilder or();32 33 /**34 * Appends <b>NOT </b> operator to expression35 * 36 * @return itself37 */38 public ProcessMgrIteratorExpressionBuilder not();39 40 /**41 * Appends condition "pakcage id == value of exp"42 * 43 * @param exp44 * @return itself45 */46 public ProcessMgrIteratorExpressionBuilder addPackageIdEquals(String exp);47 48 /**49 * Appends condition "process definition id == value of exp"50 * 51 * @param exp52 * @return itself53 */54 public ProcessMgrIteratorExpressionBuilder addProcessDefIdEquals(String exp);55 56 /**57 * Appends condition "process manager name == value of exp"58 * 59 * @param exp60 * @return itself61 */62 public ProcessMgrIteratorExpressionBuilder addNameEquals(String exp);63 64 /**65 * Appends condition "process manager version == value of exp"66 * 67 * @param exp68 * @return itself69 */70 public ProcessMgrIteratorExpressionBuilder addVersionEquals(String exp);71 72 /**73 * Appends condition "process manager created time == arg"74 * 75 * @param arg76 * @return itself77 */78 public ProcessMgrIteratorExpressionBuilder addCreatedTimeEquals(long arg);79 80 /**81 * Appends condition "process manager created time < arg"82 * 83 * @param arg84 * @return itself85 */86 public ProcessMgrIteratorExpressionBuilder addCreatedTimeBefore(long arg);87 88 /**89 * Appends condition "process manager created time > arg"90 * 91 * @param arg92 * @return itself93 */94 public ProcessMgrIteratorExpressionBuilder addCreatedTimeAfter(long arg);95 96 /**97 * Appends condition "process manager enabled"98 * 99 * @return itself100 */101 public ProcessMgrIteratorExpressionBuilder addIsEnabled();102 103 /**104 * Appends arbitrary condition105 * <p>106 * Here you may specify any script compatible expression, but <b>beware107 * complete expression will be evaluated inside Java VM</b>, not on DB.108 * 109 * @param exp110 * @return itself111 */112 public ProcessMgrIteratorExpressionBuilder addExpression(String exp);113 114 /**115 * Appends condition contained inside other116 * <tt>ProcessMgrIteratorExpressionBuilder</tt>. This allows user117 * to build more complicated expressions, because eb condition is118 * nested into parenthesis.119 * 120 * @param eb121 * @return itself122 */123 public ProcessMgrIteratorExpressionBuilder addExpression(ProcessMgrIteratorExpressionBuilder eb);124 125 /**126 * Methods starting with <tt>setOrderBy</tt> obviously don't affect127 * actual expression (nor its evaluation), rather they affect sorting128 * of the result.129 * <p>130 * This method sets ordering by packageId value.131 * 132 * @param ascending133 * @return itself134 */135 public ProcessMgrIteratorExpressionBuilder setOrderByPackageId(boolean ascending);136 137 /**138 * Methods starting with <tt>setOrderBy</tt> obviously don't affect139 * actual expression (nor its evaluation), rather they affect sorting140 * of the result.141 * <p>142 * This method sets ordering by processDefinitionId value.143 * 144 * @param ascending145 * @return itself146 */147 public ProcessMgrIteratorExpressionBuilder setOrderByProcessDefId(boolean ascending);148 149 /**150 * Methods starting with <tt>setOrderBy</tt> obviously don't affect151 * actual expression (nor its evaluation), rather they affect sorting152 * of the result.153 * <p>154 * This method sets ordering by process manager name value.155 * 156 * @param ascending157 * @return itself158 */159 public ProcessMgrIteratorExpressionBuilder setOrderByName(boolean ascending);160 161 /**162 * Methods starting with <tt>setOrderBy</tt> obviously don't affect163 * actual expression (nor its evaluation), rather they affect sorting164 * of the result.165 * <p>166 * This method sets ordering by process manager version value.167 * 168 * @param ascending169 * @return itself170 */171 public ProcessMgrIteratorExpressionBuilder setOrderByVersion(boolean ascending);172 173 /**174 * Methods starting with <tt>setOrderBy</tt> obviously don't affect175 * actual expression (nor its evaluation), rather they affect sorting176 * of the result.177 * <p>178 * This method sets ordering by process manager created time value.179 * 180 * @param ascending181 * @return itself182 */183 public ProcessMgrIteratorExpressionBuilder setOrderByCreatedTime(boolean ascending);184 185 /**186 * Methods starting with <tt>setOrderBy</tt> obviously don't affect187 * actual expression (nor its evaluation), rather they affect sorting188 * of the result.189 * <p>190 * This method sets ordering by process manager enabled value.191 * 192 * @param ascending193 * @return itself194 */195 public ProcessMgrIteratorExpressionBuilder setOrderByEnabled(boolean ascending);196 }