1. opensymphony
  2. osworkflow


osworkflow / docs / Conditions.html

<html><head><title>OSWorkflow Conditions</title></head><body>
<ul class="star">
<li>Up to <a href="Documentation.html">Documentation</a></li>
<li>Back to <a href="Registers.html">Registers</a></li>
<li>Forward to <a href="SOAP_Support.html">SOAP Support</a></li>
</ul><p class="paragraph"></p>Conditions in OSWorkflow work very much like functions, validators, and registers, with one exception: <b class="bold">in BSF and Beanshell scripts, there is an extra object in scope of the name "jn"</b>. This variable is of the class <i class="italic">com.opensymphony.workflow.JoinNodes</i> and is used for join-conditions. Other than that, conditions are just like functions except that they must return a value that equates to <b class="bold">true or false</b>. This includes a String "true" or a Boolean that evaluates to true, or any other object that has a toString() method that returns the String "true" in some manner (TRUE, True, true, etc).<p class="paragraph"></p>Each <b class="bold">condition</b> must be defined as a child of the <b class="bold">conditions</b> element. This element has one attribute called <b class="bold">type</b>, which can either be <b class="bold">AND</b> or <b class="bold">OR</b>. When using the type AND all the condition elements must evaluate to true or the overall condition will return as false. When using the type OR only one condition element must evaluate to true for the overall condition to pass. If you require more complex conditional logic, you must write it yourself using the <b class="bold">Condition</b> or <b class="bold">ConditionRemote</b> interfaces, BeanShell, or BSF.<p class="paragraph"></p>Below is a list of some of the standard conditions that OSWorkflow ships with:
<ul class="minus">
<li><b class="bold">OSUserGroupCondition</b> - Uses OSUser to determine if the caller is in the required argument "group"</li>
<li><b class="bold">StatusCondition</b> - Determines if the current step's status if the same as the required argument "status".</li>
<li><b class="bold">AllowOwnerOnlyCondition</b> - Only returns true if the caller is the owner of the specified current step or any current step if the step is not specified.</li>
<li><b class="bold">DenyOwnerCondition</b> - Does the opposite of AllowOwnerOnlyCondition.</li>
You can read the JavaDocs of these classes for more information.</body></html>