osworkflow / docs / BSF_Functions.html

<html><head><title>OSWorkflow BSF Functions</title></head><body>
<ul class="star">
<li>Up to <a href="Documentation.html">Documentation</a></li>
<li>Back to <a href="BeanShell_Functions.html">BeanShell Functions</a></li>
<li>Forward to <a href="Utility_Functions.html">Utility Functions</a></li>
</ul><p class="paragraph"></p>In addition to OSWorkflow Java Function and <a href="BeanShell_Functions.html">BeanShell Functions</a>, OSWorkflow supports a third type of function: <span class="nobr"></img><a href="http://oss.software.ibm.com/developerworks/projects/bsf">Bean Scripting Framework</a></span> functions. BSF is a project by IBM's AlphaWorks group that allows for commonly used languages such as VBScript, Perlscript, Python, and JavaScript to operate in a common environment. What this means in OSWorkflow is that you can code your functions in any language supported by BSF in the following manner:<p class="paragraph"></p><div class="wikicode"><pre>&#60;function type=<span class="java&#45;quote">"bsf"</span>&#62;
	&#60;arg name=<span class="java&#45;quote">"source"</span>&#62;foo.pl&#60;/arg&#62;
	&#60;arg name=<span class="java&#45;quote">"row"</span>&#62;0&#60;/arg&#62;
	&#60;arg name=<span class="java&#45;quote">"col"</span>&#62;0&#60;/arg&#62;
	&#60;arg name=<span class="java&#45;quote">"script"</span>&#62;
		print $bsf&#45;&#62;lookupBean(<span class="java&#45;quote">"propertySet"</span>).getString(<span class="java&#45;quote">"foo"</span>);
	&#60;/arg&#62;
&#60;/function&#62;</pre></div><p class="paragraph"></p>The above code gets the <b class="bold">propertySet</b> then prints out the value with the key "foo". The same variables that are in default scope in BeanShell functions are available to lookup in your BSF script. Please read the BSF guide for info on how to lookup these beans in your language of choice.<p class="paragraph"></p></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.