xml.KREW_RULE_EXPR_T.xml Maven / Gradle / Ivy
<?xml version="1.0" encoding="UTF-8"?> <!DOCTYPE dataset SYSTEM "ks-bundled-db.dtd"> <!-- Auto-generated by the Maven Impex Plugin --> <dataset> <KREW_RULE_EXPR_T OBJ_ID="616A0754-3BA6-39DF-9A1B-11432849DC6B" RULE_EXPR="import edu.sampleu.recipe.util.RecipeUtils
		 import org.apache.commons.lang.StringUtils
				import org.kuali.rice.kew.engine.RouteContext;
				import org.kuali.rice.kew.rule.Rule;
				import org.kuali.rice.kew.rule.RuleExpressionResult;
		 
				String ingredients = RecipeUtils.getRecipeIngredientsFromRecipeDocumentContent(routeContext)
		
				if(StringUtils.containsIgnoreCase(ingredients, "chicken")) {
					return RecipeUtils.constructGroupApprovalRequest("KR-WKFLW:ChickenRecipeMasters", rule)
		 } else {
		 	/* Return an empty route request */
		 	return RecipeUtils.constructEmptyApprovalRequest(rule);
		 }" RULE_EXPR_ID="2000" TYP="BSF:groovy" VER_NBR="1"/> <KREW_RULE_EXPR_T OBJ_ID="3364EB47-6407-9C45-8AAD-7A8310266208" RULE_EXPR="import javax.xml.namespace.QName
				import org.kuali.rice.resourceloader.GlobalResourceLoader
				import edu.sampleu.magazine.service.MagazineService
		 import edu.sampleu.recipe.util.RecipeUtils
		 import org.apache.commons.lang.StringUtils
				import org.kuali.rice.kew.engine.RouteContext
				import org.kuali.rice.kew.rule.Rule
				import org.kuali.rice.kew.rule.RuleExpressionResult
		 
				String origin = RecipeUtils.getRecipeOriginFromRecipeDocumentContent(routeContext)
				
				QName serviceName = new QName("magazineNamespace", "magazineSoapService")
				MagazineService magazineSoapService = (MagazineService) GlobalResourceLoader.getService(serviceName)
				String managedMagazines[] = magazineSoapService.getAllManagedMagazines()
		
				if(ArrayUtils.contains(managedMagazines, origin)) {
					return RecipeUtils.constructGroupApprovalRequest("KR-WKFLW:MagazineManagers", rule)
		 } else {
		 	/* Return an empty route request */
		 	return RecipeUtils.constructEmptyApprovalRequest(rule);
		 }" RULE_EXPR_ID="2001" TYP="BSF:groovy" VER_NBR="1"/> </dataset>