Java-based functions must implement the interface com.opensymphony.workflow.FunctionProvider. This interface has a single method, execute. This method takes three arguments:
Java-based functions are available in the following types: classFor a class function, the ClassLoader must know the class name of your function. This can be accomplished with the argument class.name. An example is: <function type="class"> <arg name="class.name">com.acme.FooFunction</arg> <arg name="message">The message is ${message}</arg> </function> jndiJNDI functions are just like class functions except they must already exist in the JNDI tree. Instead of a class.name argument, the argument jndi.location is required. Example: <function type="jndi"> <arg name="jndi.location">java:/FooFunction</arg> <arg name="message">The message is ${message}</arg> </function> remote-ejbRemote EJBs can be used as a function in OSWorkflow provided a few things happen first. The remote interface of the EJB must extend com.opensymphony.workflow.FunctionProviderRemote. Also, the required argument ejb.location must be given. Example: <function type="remote-ejb"> <arg name="ejb.location">java:/comp/env/FooEJB</arg> <arg name="message">The message is ${message}</arg> </function> local-ejbLocal EJBs are exactly like remote EJBs, except that the local interface of the EJB must extend com.opensymphony.workflow.FunctionProvider, just like the other Java-based functions. Example: <function type="local-ejb"> <arg name="ejb.location">java:/comp/env/FooEJB</arg> <arg name="message">The message is ${message}</arg> </function>
|