org.apache.lenya.cms.workflow
Class RoleCondition

java.lang.Object
  extended by org.apache.lenya.cms.workflow.RoleCondition
All Implemented Interfaces:
Condition

public class RoleCondition
extends java.lang.Object
implements Condition

Role condition


Field Summary
protected static java.lang.String SEPARATOR
           
 
Constructor Summary
RoleCondition()
           
 
Method Summary
 java.lang.String getExpression()
          Returns the expression of this condition.
 boolean isComplied(Workflow workflow, Workflowable instance)
          Returns if the condition is complied in a certain situation.
 void setExpression(java.lang.String expression)
          Sets the expression for this condition.
 java.lang.String toString()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

SEPARATOR

protected static final java.lang.String SEPARATOR
See Also:
Constant Field Values
Constructor Detail

RoleCondition

public RoleCondition()
Method Detail

setExpression

public void setExpression(java.lang.String expression)
                   throws WorkflowException
Description copied from interface: Condition
Sets the expression for this condition.

Specified by:
setExpression in interface Condition
Parameters:
expression - The expression.
Throws:
WorkflowException - when the expression is not valid.
See Also:
Condition.setExpression(java.lang.String)

isComplied

public boolean isComplied(Workflow workflow,
                          Workflowable instance)
Returns if the condition is complied in a certain situation. The condition is complied when the current user has the role that is required by the RoleCondition.

Specified by:
isComplied in interface Condition
Parameters:
workflow - The workflow to use.
instance - The workflowable to check the condition on.
Returns:
if the condition is complied.
See Also:
org.apache.lenya.workflow.impl.AbstractCondition#isComplied(Workflow, Workflowable)

getExpression

public java.lang.String getExpression()
Returns the expression of this condition.

Returns:
A string.

toString

public java.lang.String toString()
Overrides:
toString in class java.lang.Object
See Also:
Object.toString()


Copyright 1999-2006 Apache Software Foundation. All Rights Reserved.