This section is about customizing and adding functionality to our XML OSWorkflow process definition. Both classic Java code and BeanShell scripts are available to extend and enhance the business process.
During execution and transitioning of the workflow instance you may need to execute code specific to your application or custom functionality. OSWorkflow provides a way to do so, through the use of FunctionProvider
.
The FunctionProvider
can be a regular Java class, an EJB, or a BeanShell script. OSWorkflow has several useful built-in functions that you can use in your definition.
Defining a Java FunctionProvider
is very easy; all you need to do is implement the com.openshymphony.workflow.FunctionProvider
interface. A sample FunctionProvider
that simply prints its arguments is shown in the following code snippet:
package packtpub.osw; import java.util.Map; import com.opensymphony.module.propertyset.PropertySet...