Source

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>
Tip: Filter by directory path e.g. /media app.js to search for public/media/app.js.
Tip: Use camelCasing e.g. ProjME to search for ProjectModifiedEvent.java.
Tip: Filter by extension type e.g. /repo .js to search for all .js files in the /repo directory.
Tip: Separate your search with spaces e.g. /ssh pom.xml to search for src/ssh/pom.xml.
Tip: Use ↑ and ↓ arrow keys to navigate and return to view the file.
Tip: You can also navigate files with Ctrl+j (next) and Ctrl+k (previous) and view the file with Ctrl+o.
Tip: You can also navigate files with Alt+j (next) and Alt+k (previous) and view the file with Alt+o.