1 25 package org.ofbiz.shark.expression; 26 27 import org.enhydra.shark.api.common.ProcessMgrIteratorExpressionBuilder; 28 import org.ofbiz.entity.condition.EntityExpr; 29 import org.ofbiz.entity.condition.EntityOperator; 30 31 37 public class ProcessMgrIteratorCondExprBldr extends BaseEntityCondExprBldr implements ProcessMgrIteratorExpressionBuilder { 38 39 public ProcessMgrIteratorCondExprBldr() { 40 this.addEntity("WFPM", "WfProcessMgr"); 41 this.addAllFields("WFPM"); 42 } 43 44 public ProcessMgrIteratorExpressionBuilder and() { 45 this.setOr(false); 46 return this; 47 } 48 49 public ProcessMgrIteratorExpressionBuilder or() { 50 this.setOr(true); 51 return this; 52 } 53 54 public ProcessMgrIteratorExpressionBuilder not() { 55 this.setNot(true); 56 return this; 57 } 58 59 public ProcessMgrIteratorExpressionBuilder addPackageIdEquals(String s) { 60 this.addCondition(new EntityExpr("packageId", isNotSet ? EntityOperator.NOT_EQUAL : EntityOperator.EQUALS, s)); 61 return this; 62 } 63 64 public ProcessMgrIteratorExpressionBuilder addProcessDefIdEquals(String s) { 65 this.addCondition(new EntityExpr("definitionId", isNotSet ? EntityOperator.NOT_EQUAL : EntityOperator.EQUALS, s)); 66 return this; 67 } 68 69 public ProcessMgrIteratorExpressionBuilder addNameEquals(String s) { 70 this.addCondition(new EntityExpr("mgrName", isNotSet ? EntityOperator.NOT_EQUAL : EntityOperator.EQUALS, s)); 71 return this; 72 } 73 74 public ProcessMgrIteratorExpressionBuilder addVersionEquals(String s) { 75 this.addCondition(new EntityExpr("packageVer", isNotSet ? EntityOperator.NOT_EQUAL : EntityOperator.EQUALS, s)); 76 return this; 77 } 78 79 public ProcessMgrIteratorExpressionBuilder addIsEnabled() { 80 this.addCondition(new EntityExpr("currentState", isNotSet ? EntityOperator.NOT_EQUAL : EntityOperator.EQUALS, new Long (0))); 81 return this; 82 } 83 84 public ProcessMgrIteratorExpressionBuilder addExpression(String s) { 85 ProcessMgrIteratorExpressionBuilder builder = (ProcessMgrIteratorExpressionBuilder) BaseEntityCondExprBldr.getBuilder(s); 86 if (builder != null) { 87 return this.addExpression(builder); 88 } else { 89 return this; 90 } 91 } 92 93 public ProcessMgrIteratorExpressionBuilder addExpression(ProcessMgrIteratorExpressionBuilder builder) { 94 if (!(builder instanceof BaseEntityCondExprBldr)) { 95 throw new UnsupportedOperationException ("Unsupported implementation"); 96 } else { 97 this.addCondition(((BaseEntityCondExprBldr) builder).getCondition()); 98 } 99 return this; 100 } 101 } 102 | Popular Tags |