Defining custom action types |
Top Previous Next |
You may define your own custom actions using the JSCAPE MFT Server Java Management API classes. To write your own action class 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 libs/actions directory of your JSCAPE MFT Server installation. Any third party libraries that your action depends on should be placed in the libs directory of your JSCAPE MFT Server installation. For your action to be recognized by JSCAPE MFT Server restart the JSCAPE MFT Server Service.
Example
For a tutorial and complete source code example please see the following:
http://www.jscape.com/blog/how-to-create-custom-trigger-actions
Open source custom actions
We invite you to check out the open-source custom actions we've made available for free at the JSCAPE Marketplace. The JSCAPE Marketplace features a large collection of free, open-source custom trigger functions and actions, which you can use to add more functionality to your installations of JSCAPE MFT Server.
See also
|