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 and that the transitional property equals a specified value. For example, to check whether the next queue on the stack is of type Problem Class and with a transitional value of gastrointestinal you could configure a rule-condition as:
    <rule-condition type="org.jharks.workflow.conditions.
                             QueueTypeCondition">
      <property name="category" value="Problem Class"/>
      <property name="value" value="gastrointestinal"/>
    </rule-condition>
 

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

    
The name of the transitional property.
    private String propertyName
    
    
The value of the property.
    private String value;
    
    
    public boolean checkCondition(Object param) {
        if (param instanceof SessionHistory) {
            SessionHistory sh = (SessionHistoryparam;
            QueueWrapper element = (QueueWrappersh.peek();
            
            if (element.getElementType().equalsIgnoreCase()) {
                if (element.isEmpty()) 
                    return false;
                
                String responseValue = ((QueueNodeelement.get()).getValue();
                  if (responseValue.equalsIgnoreCase(getValue()))
                    return true;  
            }
            
            return false;   
        } else {
            throw new ClassCastException("Expecting SessionHistory Object.");
        }
    }

    
Returns the name of the property.

Returns:
the property name.
    public String getPropertyName() {
        return ;
    }
    
    
Sets the property name to evaluate.

Parameters:
property The property name.
    public void setPropertyName(String property) {
        this. = property;
    }
    
    
Returns the value of the property.

Returns:
the property value.
    public String getValue() {
        return ;
    }
    
    
Sets the value of the property to evaluate.

Parameters:
value The property value.
    public void setValue(String value) {
        this. = value;
    }
New to GrepCode? Check out our FAQ X