Start line:  
End line:  

Snippet Preview

Snippet HTML Code

Stack Overflow Questions
 package org.jharks.workflow.conditions;
 
This RuleCondition peeks into the stack of queues on the SessionHistory object and checks to make sure that the queue on the top of the stack matches the category condition. For example, to check whether the next queue on the stack is of type Problem Class you could configure a rule-condition as:
    <rule-condition type="org.jharks.workflow.conditions.
                             QueueTypeCondition">
      <property name="category" value="Problem Class"/>
    </rule-condition>
 

Author(s):
Michael J. Rizzo
Version:
1.0
public class QueueTypeCondition extends RuleCondition {

    
The category type for object stored on queue.
    private String category
    
    
    public boolean checkCondition(Object param) {
        if (param instanceof SessionHistory) {
            SessionHistory sh = (SessionHistoryparam;
            Stackable element = sh.peek(); 
            
            if (element.getElementType().equalsIgnoreCase())
              return true;  
            
            return false;   
        } else {
            throw new ClassCastException("Expecting SessionHistory Object.");
        }
    }
    
    
Returns the category of the stackable element configured for the condition.

Returns:
the element category.
    public String getCategory() {
        return ;
    }
    
    
Sets the category of the element.

Parameters:
category The element category.
    public void setCategory(String category) {
        this. = category;
    }
New to GrepCode? Check out our FAQ X