Coverage Report - edu.sampleu.bookstore.kew.BookTypeQualifierResolver
 
Classes in this File Line Coverage Branch Coverage Complexity
BookTypeQualifierResolver
0%
0/11
0%
0/2
2
 
 1  
 /**
 2  
  * 
 3  
  */
 4  
 package edu.sampleu.bookstore.kew;
 5  
 
 6  
 import java.util.ArrayList;
 7  
 import java.util.List;
 8  
 
 9  
 import org.apache.commons.lang.StringUtils;
 10  
 import org.kuali.rice.core.util.AttributeSet;
 11  
 import org.kuali.rice.kew.engine.RouteContext;
 12  
 
 13  
 import org.kuali.rice.kns.document.MaintenanceDocument;
 14  
 import org.kuali.rice.kns.maintenance.Maintainable;
 15  
 import org.kuali.rice.kns.workflow.attribute.QualifierResolverBase;
 16  
 import edu.sampleu.bookstore.bo.Book;
 17  
 import edu.sampleu.bookstore.bo.BookstoreKimAttributes;
 18  
 
 19  
 /**
 20  
  * Qualifier Resolver for Book Type
 21  
  *
 22  
  */
 23  0
 public class BookTypeQualifierResolver extends QualifierResolverBase {
 24  
 
 25  
         /* (non-Javadoc)
 26  
          * @see org.kuali.rice.kew.role.QualifierResolver#resolve(org.kuali.rice.kew.engine.RouteContext)
 27  
          */
 28  
         public List<AttributeSet> resolve(RouteContext context) {
 29  0
         List<AttributeSet> qualifiers = new ArrayList<AttributeSet>();
 30  0
         MaintenanceDocument doc = (MaintenanceDocument) getDocument(context);
 31  0
                 Maintainable maint = doc.getNewMaintainableObject();
 32  0
                 Book book = (Book) maint.getBusinessObject();
 33  0
                 if (StringUtils.isNotEmpty(book.getTypeCode())) {
 34  0
                         qualifiers.add(new AttributeSet(BookstoreKimAttributes.BOOK_TYPE_CODE,book.getTypeCode()));
 35  0
                         decorateWithCommonQualifiers(qualifiers, context, null);
 36  
                 }
 37  
                 else {
 38  0
             AttributeSet basicQualifier = new AttributeSet();
 39  0
             qualifiers.add(basicQualifier);
 40  
                 }
 41  0
                 return qualifiers;
 42  
         }
 43  
 
 44  
 }