com.opensymphony.workflow.util
Class IsUserOwnerCondition

java.lang.Object
  extended by com.opensymphony.workflow.util.IsUserOwnerCondition
All Implemented Interfaces:
Condition

public class IsUserOwnerCondition
extends Object
implements Condition

A simple utility condition that returns true if the the current user (caller) is the step owner.

This condition may be used to deny the owner of the step by negating the condition in the workflow descriptor with negate='true'.

Looks at ALL current steps unless a step id is given in the optional argument "stepId".

The implementation was originally contained in AllowOwnerOfStepCondition by Pat Lightbody.

Author:
Pat Lightbody (original implementation), Adam Southall (refactored owner conditions to use this generic class.

Constructor Summary
IsUserOwnerCondition()
           
 
Method Summary
 boolean passesCondition(Map transientVars, Map args, com.opensymphony.module.propertyset.PropertySet ps)
          Determines if a condition should signal pass or fail.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

IsUserOwnerCondition

public IsUserOwnerCondition()
Method Detail

passesCondition

public boolean passesCondition(Map transientVars,
                               Map args,
                               com.opensymphony.module.propertyset.PropertySet ps)
                        throws StoreException
Description copied from interface: Condition
Determines if a condition should signal pass or fail.

Specified by:
passesCondition in interface Condition
Parameters:
transientVars - Variables that will not be persisted. These include inputs given in the Workflow.initialize(java.lang.String, int, java.util.Map) and Workflow.doAction(long, int, java.util.Map) method calls. There are a number of special variable names:
  • entry: (object type: WorkflowEntry) The workflow instance
  • context: (object type: WorkflowContext). The workflow context.
  • actionId: The Integer ID of the current action that was take (if applicable).
  • currentSteps: A Collection of the current steps in the workflow instance.
  • store: The WorkflowStore.
  • descriptor: The WorkflowDescriptor.

Also, any variable set as a Register), will also be available in the transient map, no matter what. These transient variables only last through the method call that they were invoked in, such as Workflow.initialize(java.lang.String, int, java.util.Map) and Workflow.doAction(long, int, java.util.Map).

args - The properties for this function invocation. Properties are created from arg nested elements within the xml, an arg element takes in a name attribute which is the properties key, and the CDATA text contents of the element map to the property value. There is a magic property of 'stepId'; if specified with a value of -1, then the value is replaced with the current step's ID before the condition is called.
ps - The persistent variables that are associated with the current instance of the workflow. Any change made to this will be seen on the next function call in the workflow lifetime.
Throws:
StoreException

OpenSymphony Workflow Project Page