1. opensymphony
  2. osworkflow


osworkflow / docs / Registers.html

<html><head><title>OSWorkflow Registers</title></head><body>
<ul class="star">
<li>Up to <a href="Documentation.html">Documentation</a></li>
<li>Back to <a href="Validators.html">Validators</a></li>
<li>Forward to <a href="Conditions.html">Conditions</a></li>
</ul><p class="paragraph"></p>A register in OSWorkflow is a runtime field that can be dynamically registered in the workflow definition file.<p class="paragraph"></p>Registers are useful in a number of situations. For example, you might want to provide easy access to the entity that is progressing through the workflow (separate from the actual workflow itself) to the workflow descriptor. In this case, you would define a register that encapsulates this entity. If this entity happens to be a local session EJB, you could use the <b class="bold">com.opensymphony.workflow.util.ejb.local.LocalEJBRegister</b> register class to make this entity available. Later on in a particular post-function, you will have access to the entity, and can call any of its methods through a beanshell script, for example.<p class="paragraph"></p>Registers, just like <a href="Validators.html">Validators</a> and <a href="Functions.html">Functions</a>, can be implemented using three different forms: <b class="bold">Java-based</b>, <b class="bold">BeanShell</b>, and <b class="bold">BSF</b>. 
<h3 class="heading-1-1">Java-based
</h3><p class="paragraph"></p>Java-based registers must implement the <b class="bold">com.opensymphony.workflow.Register</b> interface (or in the case of <b class="bold">remote-ejb</b>'s, the <b class="bold">com.opensymphony.workflow.RegisterRemote</b> interface).  
<h3 class="heading-1-1">BeanShell and BSF registers
</h3><p class="paragraph"></p>The value or object returned by the script will be the object that is registered.
<h3 class="heading-1-1">One note about registers
</h3><p class="paragraph"></p>While validators and functions both have the three parameters (<b class="bold">transientVars</b>, <b class="bold">args</b>, and <b class="bold">propertySet</b>) to work with, registers only have the args Map to use (along with the <b class="bold">context</b> and <b class="bold">entry</b> variables that are found in the <b class="bold">propertySet</b> normally). This is because registers are called regardless of user input, and also make up the variables map, so it would not make sense to give them scope to that kind of information.</body></html>