Defining custom action types |
Top Previous Next |
You may define your own custom action using the JSCAPE MFT Server Management API classes. To write your own action class you will want to extend the com.jscape.inet.mft.workflow.AbstractAction class and implement the abstract execute() method to perform the work of your action. Below is an example implementation of the AbstractAction class. This example prints a message to System.out and the log datastore.
JSCAPE MFT Server Manager uses Java reflection to build the GUI dialogs used to collect action properties. Therefore, all properties of your action should have corresponding getter/setter methods using Java naming conventions and an empty argument constructor for constructing the action. Using the PropertyDescriptor[] property you can define the order of properties and whether they are required. The resultMessage property is the message that will be written to the log file upon executing the action.
Note
Action properties may consist only of Java primitive values e.g. String, int, boolean etc.
For actions to be made available you must create a JAR archive e.g. myactions.jar, that contains your actions and place it in the lib/actions directory of your JSCAPE MFT Server installation. Any third party libraries that your action depends on should be placed in the lib directory of your JSCAPE MFT Server installation. For your action to be recognized by JSCAPE MFT Server restart both JSCAPE MFT Server Service and JSCAPE MFT Server Manager.
Example
For a tutorial and complete source code example please see the following:
http://blog.jscape.com/jscape/2008/11/jscape-secure-f.html
Note
If you are managing your server remotely you MUST place the action JAR file in the libs/actions directory on BOTH the machine running JSCAPE MFT Server and on the machine running JSCAPE MFT Server Manager.
See also
|